details.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <div>
  3. <FullPage
  4. title="生产排产详情"
  5. :list="list"
  6. @init="init"
  7. :logList="logList"
  8. @searchData="init"
  9. @changePage="changePage"
  10. @changeSize="changeSize"
  11. @selectTable="selectTable"
  12. :tableColums="tableColums"
  13. :tableData="tableData"
  14. :pageIndex="pageIndex"
  15. :total="total"
  16. >
  17. <div slot="titleButton">
  18. <Button @click="back" type="primary" ghost style="margin-right: 10px"
  19. >返回</Button
  20. >
  21. <Button
  22. @click="goOriginalPage($route.query)"
  23. type="primary"
  24. style="margin-right: 10px"
  25. ghost
  26. >打印清单</Button
  27. >
  28. <Button type="primary" ghost @click="batchDispatchOrder"
  29. >批量派工单</Button
  30. >
  31. </div>
  32. <template slot="set" slot-scope="{ row }">
  33. <div>
  34. <a v-if="row.label == 1" style="margi n:0 5px" @click="bingChip(row)"
  35. >更改芯片</a
  36. >
  37. </div>
  38. </template>
  39. <Modal
  40. @on-ok="saveChip"
  41. class-name="vertical-center-modal"
  42. title="更改芯片"
  43. v-model="showChip"
  44. :width="300"
  45. @on-visible-change="vivibleModal"
  46. >
  47. <Form>
  48. <FormItem label="芯片编号">
  49. <Input v-model="chipInfo.tag" placeholder="请输入芯片编号"></Input>
  50. </FormItem>
  51. </Form>
  52. </Modal>
  53. </FullPage>
  54. </div>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. order_no: null,
  61. logList: [{ title: "系统单号", value: "10998765" }],
  62. list: [
  63. {
  64. title: "楼幢",
  65. name: "Select",
  66. multiple: true,
  67. filterable: true,
  68. serverName: "house",
  69. placeholder: "请选择楼幢",
  70. value: "",
  71. option: [{ label: 1, value: 1 }],
  72. },
  73. {
  74. title: "单元",
  75. name: "Select",
  76. multiple: true,
  77. filterable: true,
  78. serverName: "unit",
  79. placeholder: "请选择单元",
  80. value: "",
  81. option: [{ label: 1, value: 1 }],
  82. },
  83. {
  84. title: "楼层",
  85. name: "Select",
  86. multiple: true,
  87. filterable: true,
  88. serverName: "layer",
  89. placeholder: "请选择楼层",
  90. value: "",
  91. option: [{ label: 1, value: 1 }],
  92. },
  93. {
  94. title: "房号",
  95. name: "Select",
  96. multiple: true,
  97. filterable: true,
  98. serverName: "number_detail",
  99. placeholder: "请选择房号",
  100. value: "",
  101. option: [{ label: 1, value: 1 }],
  102. },
  103. {
  104. title: "部件",
  105. name: "Select",
  106. multiple: true,
  107. filterable: true,
  108. value: "",
  109. serverName: "part",
  110. placeholder: "请选择部件",
  111. option: [{ label: 1, value: 1 }],
  112. },
  113. {
  114. title: "工序",
  115. name: "Select",
  116. filterable: true,
  117. value: "",
  118. serverName: "produce",
  119. placeholder: "请选择工序",
  120. option: [],
  121. },
  122. {
  123. title: "产品名称",
  124. name: "Select",
  125. multiple: true,
  126. filterable: true,
  127. serverName: "product",
  128. placeholder: "请选择产品名称",
  129. value: "",
  130. option: [],
  131. },
  132. {
  133. title: "图号",
  134. name: "Select",
  135. multiple: true,
  136. filterable: true,
  137. value: "",
  138. serverName: "url_number",
  139. placeholder: "请选择图号",
  140. option: [],
  141. },
  142. ],
  143. tableColums: [
  144. { type: "selection", align: "center", fixed: "left", width: "100" },
  145. {
  146. title: "房号",
  147. align: "center",
  148. key: "number_detail",
  149. minWidth: 100,
  150. render: (h, params) => {
  151. const { row } = params;
  152. return h(
  153. "span",
  154. `${row.house ? row.house + "-" : ""}${
  155. row.unit ? row.unit + "-" : ""
  156. }${row.layer ? row.layer + "-" : ""}${row.number_detail}`
  157. );
  158. },
  159. },
  160. // {
  161. // title: "图纸",
  162. // align: "center",
  163. // key: "img_url",
  164. // minWidth: 100,
  165. // render: (h, params) => {
  166. // const { row } = params;
  167. // return h("img", {
  168. // attrs: {
  169. // src: this.$store.state.ip + params.row.url[0].img_url,
  170. // style:
  171. // "max-width:50px;max-height:50px;position:relative;top:3px;",
  172. // },
  173. // on: {
  174. // click: (e) => {
  175. // this.$previewImg({
  176. // list: row.url,
  177. // baseUrl: this.$store.state.ip,
  178. // baseImgField: "img_url",
  179. // baseTitleField: "title",
  180. // });
  181. // },
  182. // },
  183. // });
  184. // },
  185. // },
  186. {
  187. title: "图号",
  188. align: "center",
  189. key: "url_number",
  190. minWidth: 100,
  191. },
  192. { title: "位置", align: "center", key: "position", minWidth: 100 },
  193. // {
  194. // title: "位置",
  195. // align: "center",
  196. // key: "position",
  197. // minWidth: 100,
  198. // },
  199. {
  200. title: "产品名称",
  201. align: "center",
  202. key: "product_title",
  203. minWidth: 200,
  204. },
  205. { title: "部件", align: "center", key: "part_title", minWidth: 200 },
  206. {
  207. title: "部件是否贴标签",
  208. align: "center",
  209. minWidth: 200,
  210. render: (h, params) =>
  211. h("span", {}, params.row.label == 0 ? "否" : "是"),
  212. },
  213. // {title:'贴标签零部件',align:'center',minWidth:200,key:'sub_part',
  214. // // render:(h,params)=>h('span',{},params.row.sub_label == 1 ? '是' : '否')
  215. // },
  216. {
  217. title: "工序分类",
  218. align: "center",
  219. key: "basics_procedure_title",
  220. minWidth: 200,
  221. },
  222. {
  223. title: "工序",
  224. align: "center",
  225. key: "procedure_title",
  226. minWidth: 200,
  227. },
  228. {
  229. title: "测量尺寸",
  230. align: "center",
  231. minWidth: 200,
  232. key: "measurement",
  233. },
  234. { title: "单位", align: "center", minWidth: 200, key: "company" },
  235. {
  236. title: "芯片编号",
  237. align: "center",
  238. key: "chip",
  239. minWidth: 200,
  240. ellipsis: "true",
  241. tooltip: "true",
  242. },
  243. // {
  244. // title: '操作',
  245. // align: 'center',
  246. // fixed: 'right',
  247. // width: '120',
  248. // slot: 'set',
  249. // },
  250. ],
  251. tableData: [],
  252. pageIndex: 1,
  253. pageSize: 10,
  254. total: 100,
  255. proxyObj: {},
  256. selects: [],
  257. showChip: false,
  258. chipInfo: {},
  259. arrList: [],
  260. };
  261. },
  262. created() {
  263. this.getOptions();
  264. },
  265. methods: {
  266. init(row) {
  267. this.pageIndex = 1;
  268. row.page_index = this.pageIndex;
  269. row.page_size = this.pageSize;
  270. this.order_no = this.$route.query.order_no;
  271. Object.assign(row, this.$route.query);
  272. if (this.func.isType(row.house) == "Array") {
  273. row.house = row.house.join(",");
  274. }
  275. if (this.func.isType(row.unit) == "Array") {
  276. row.unit = row.unit.join(",");
  277. }
  278. if (this.func.isType(row.layer) == "Array") {
  279. row.layer = row.layer.join(",");
  280. }
  281. if (this.func.isType(row.number_detail) == "Array") {
  282. row.number_detail = row.number_detail.join(",");
  283. }
  284. if (this.func.isType(row.part) == "Array") {
  285. row.part = row.part.join(",");
  286. }
  287. if (this.func.isType(row.produce) == "Array") {
  288. row.produce = row.produce.join(",");
  289. }
  290. if (this.func.isType(row.product) == "Array") {
  291. row.product = row.product.join(",");
  292. }
  293. if (this.func.isType(row.img_number) == "Array") {
  294. row.img_number = row.img_number.join(",");
  295. }
  296. this.proxyObj = row;
  297. this.getData(row);
  298. },
  299. getOptions() {
  300. this.axios("/api/order_detail_word", {
  301. params: { order_no: this.$route.query.order_no },
  302. }).then((res) => {
  303. res.data.part.map((v) => {
  304. v.value = v.title;
  305. v.label = v.title;
  306. });
  307. res.data.produce.map((v) => {
  308. (v.value = v.title), (v.label = v.title);
  309. });
  310. res.data.product.map((v) => {
  311. (v.value = v.title), (v.label = v.title);
  312. });
  313. res.data.url_number.map((v) => {
  314. var j = { value: "", label: "", title: "" };
  315. j.value = v.url_number;
  316. j.label = v.url_number;
  317. j.title = v.url_number;
  318. this.arrList.push(j);
  319. });
  320. this.list[4].option = res.data.part;
  321. this.list[5].option = res.data.produce;
  322. this.list[6].option = res.data.product;
  323. this.list[7].option = this.arrList;
  324. });
  325. },
  326. searchData(row) {},
  327. back() {
  328. this.$router.go(-1);
  329. },
  330. getData(row) {
  331. this.axios
  332. .get("/api/orders_procedure_list", { params: row })
  333. .then((res) => {
  334. this.logList = res.data.detail;
  335. this.tableData = res.data.list;
  336. this.total = res.data.total;
  337. res.data.house.map((v) => {
  338. v.value = v.house;
  339. v.label = v.house;
  340. });
  341. res.data.unit.map((v) => {
  342. v.value = v.unit;
  343. v.label = v.unit;
  344. });
  345. res.data.layer.map((v) => {
  346. v.value = v.layer;
  347. v.label = v.layer;
  348. });
  349. res.data.number_detail.map((v) => {
  350. v.value = v.number;
  351. v.label = v.number;
  352. });
  353. this.list[0].option = res.data.house;
  354. this.list[1].option = res.data.unit;
  355. this.list[2].option = res.data.layer;
  356. this.list[3].option = res.data.number_detail;
  357. });
  358. },
  359. postData() {},
  360. changePage(e) {
  361. this.pageIndex = e;
  362. this.proxyObj.page_index = e;
  363. this.getData(this.proxyObj);
  364. },
  365. selectTable(e) {
  366. let result = [];
  367. e.forEach((v) => result.push(v.id));
  368. this.selects = result;
  369. },
  370. bingChip(row) {
  371. this.showChip = true;
  372. this.chipInfo.pr_id = row.pr_id;
  373. },
  374. vivibleModal(e) {
  375. if (!e) {
  376. this.chipInfo = {};
  377. }
  378. },
  379. saveChip() {
  380. this.axios.post("/api/tag_bind", this.chipInfo).then((res) => {
  381. if (res.code == 200) {
  382. this.$Message.success(res.msg || "操作成功");
  383. this.getData(this.proxyObj);
  384. }
  385. });
  386. },
  387. batchDispatchOrder() {
  388. if (!this.selects || this.selects.length < 1) {
  389. return this.$Message.error("请至少选择一项");
  390. }
  391. this.dispatchOrder({
  392. params: { id: this.selects.join(",") },
  393. batch: true,
  394. then: () => {
  395. this.getData(this.proxyObj);
  396. },
  397. });
  398. },
  399. changeSize(e) {
  400. this.pageSize = e;
  401. this.proxyObj.page_size = this.pageSize;
  402. this.getData(this.proxyObj);
  403. },
  404. goOriginalPage(row) {
  405. this.$router.push({
  406. path: "/cms/rawmateria/index",
  407. query: {
  408. order_no: row.order_no,
  409. type: 4,
  410. },
  411. });
  412. },
  413. },
  414. };
  415. </script>
  416. <style lang="scss" scoped>
  417. .log-list {
  418. display: flex;
  419. flex-wrap: wrap;
  420. padding: 10px 0;
  421. }
  422. </style>