details.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  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. title: "是否完成",
  144. name: "Select",
  145. filterable: true,
  146. value: "",
  147. serverName: "sub_state",
  148. placeholder: " ",
  149. option: [{ label: '否', value: 0 },{ label: '是', value: 1 }],
  150. },
  151. ],
  152. tableColums: [
  153. { type: "selection", align: "center", fixed: "left", width: "100" },
  154. {
  155. title: "房号",
  156. align: "center",
  157. key: "number_detail",
  158. minWidth: 100,
  159. render: (h, params) => {
  160. const { row } = params;
  161. return h(
  162. "span",
  163. `${row.house}-${row.unit}-${row.layer}-${row.number_detail}`
  164. );
  165. },
  166. },
  167. // {
  168. // title: "图纸",
  169. // align: "center",
  170. // key: "img_url",
  171. // minWidth: 100,
  172. // render: (h, params) => {
  173. // const { row } = params;
  174. // return h("img", {
  175. // attrs: {
  176. // src: this.$store.state.ip + params.row.url[0].img_url,
  177. // style:
  178. // "max-width:50px;max-height:50px;position:relative;top:3px;",
  179. // },
  180. // on: {
  181. // click: (e) => {
  182. // this.$previewImg({
  183. // list: row.url,
  184. // baseUrl: this.$store.state.ip,
  185. // baseImgField: "img_url",
  186. // baseTitleField: "title",
  187. // });
  188. // },
  189. // },
  190. // });
  191. // },
  192. // },
  193. {
  194. title: "图号",
  195. align: "center",
  196. key: "url_number",
  197. minWidth: 390,
  198. },
  199. { title: "位置", align: "center", key: "position", minWidth: 100 },
  200. // {
  201. // title: "位置",
  202. // align: "center",
  203. // key: "position",
  204. // minWidth: 100,
  205. // },
  206. { title: "产品名称", align: "center", key: "product_title", minWidth: 200 },
  207. { title: "部件", align: "center", key: "part_title", minWidth: 200 },
  208. {
  209. title: "部件是否贴标签",
  210. align: "center",
  211. minWidth: 200,
  212. render: (h, params) =>
  213. h("span", {}, params.row.label == 0 ? "否" : "是"),
  214. },
  215. // {title:'贴标签零部件',align:'center',minWidth:200,key:'sub_part',
  216. // // render:(h,params)=>h('span',{},params.row.sub_label == 1 ? '是' : '否')
  217. // },
  218. {
  219. title: "工序分类",
  220. align: "center",
  221. key: "basics_procedure_title",
  222. minWidth: 200,
  223. },
  224. {
  225. title: "工序",
  226. align: "center",
  227. key: "procedure_title",
  228. minWidth: 200,
  229. },
  230. {
  231. title: "是否完成",
  232. align: "center",
  233. key: "is_complete",
  234. minWidth: 200,
  235. render: (h, params) =>
  236. h("span", {}, params.row.sub_state == 3 ? "已完成" : "未完成"),
  237. },
  238. {
  239. title: "测量尺寸",
  240. align: "center",
  241. minWidth: 200,
  242. key: "measurement",
  243. },
  244. { title: "单位", align: "center", minWidth: 200, key: "company" },
  245. {
  246. title: "芯片编号",
  247. align: "center",
  248. key: "chip",
  249. minWidth: 200,
  250. ellipsis: "true",
  251. tooltip: "true",
  252. },
  253. // {
  254. // title: '操作',
  255. // align: 'center',
  256. // fixed: 'right',
  257. // width: '120',
  258. // slot: 'set',
  259. // },
  260. ],
  261. tableData: [],
  262. pageIndex: 1,
  263. pageSize: 10,
  264. total: 100,
  265. proxyObj: {},
  266. selects: [],
  267. showChip: false,
  268. chipInfo: {},
  269. arrList: [],
  270. };
  271. },
  272. created() {
  273. this.getOptions();
  274. },
  275. methods: {
  276. init(row) {
  277. this.pageIndex = 1;
  278. row.page_index = this.pageIndex;
  279. row.page_size = this.pageSize;
  280. this.order_no = this.$route.query.order_no;
  281. Object.assign(row, this.$route.query);
  282. if (this.func.isType(row.house) == "Array") {
  283. row.house = row.house.join(",");
  284. }
  285. if (this.func.isType(row.unit) == "Array") {
  286. row.unit = row.unit.join(",");
  287. }
  288. if (this.func.isType(row.layer) == "Array") {
  289. row.layer = row.layer.join(",");
  290. }
  291. if (this.func.isType(row.number_detail) == "Array") {
  292. row.number_detail = row.number_detail.join(",");
  293. }
  294. if (this.func.isType(row.part) == "Array") {
  295. row.part = row.part.join(",");
  296. }
  297. if (this.func.isType(row.produce) == "Array") {
  298. row.produce = row.produce.join(",");
  299. }
  300. if (this.func.isType(row.product) == "Array") {
  301. row.product = row.product.join(",");
  302. }
  303. if (this.func.isType(row.img_number) == "Array") {
  304. row.img_number = row.img_number.join(",");
  305. }
  306. this.proxyObj = row;
  307. this.getData(row);
  308. },
  309. getOptions() {
  310. this.axios("/api/order_detail_word", {
  311. params: { order_no: this.$route.query.order_no },
  312. }).then((res) => {
  313. res.data.house.map((v) => {
  314. v.value = v.house;
  315. v.label = v.house;
  316. });
  317. res.data.unit.map((v) => {
  318. v.value = v.unit;
  319. v.label = v.unit;
  320. });
  321. res.data.layer.map((v) => {
  322. v.value = v.layer;
  323. v.label = v.layer;
  324. });
  325. res.data.number_detail.map((v) => {
  326. v.value = v.number_detail;
  327. v.label = v.number_detail;
  328. });
  329. res.data.part.map((v) => {
  330. v.value = v.title;
  331. v.label = v.title;
  332. });
  333. res.data.produce.map((v) => {
  334. (v.value = v.title), (v.label = v.title);
  335. });
  336. res.data.product.map((v) => {
  337. (v.value = v.title), (v.label = v.title);
  338. });
  339. res.data.url_number.map((v) => {
  340. var j = {value:'',label:'',title:''};
  341. j.value = v.url_number;
  342. j.label = v.url_number;
  343. j.title = v.url_number;
  344. this.arrList.push(j)
  345. });
  346. this.list[0].option = res.data.house;
  347. this.list[1].option = res.data.unit;
  348. this.list[2].option = res.data.layer;
  349. this.list[3].option = res.data.number_detail;
  350. this.list[4].option = res.data.part;
  351. this.list[5].option = res.data.produce;
  352. this.list[6].option = res.data.product;
  353. this.list[7].option = this.arrList;
  354. });
  355. },
  356. searchData(row) {},
  357. back() {
  358. this.$router.go(-1);
  359. },
  360. getData(row) {
  361. this.axios.get("/api/orders_procedure_list", { params: row }).then((res) => {
  362. this.logList = res.data.detail;
  363. this.tableData = res.data.list;
  364. this.total = res.data.total;
  365. });
  366. },
  367. postData() {},
  368. changePage(e) {
  369. this.pageIndex = e;
  370. this.proxyObj.page_index = e;
  371. this.getData(this.proxyObj);
  372. },
  373. selectTable(e) {
  374. let result = [];
  375. e.forEach((v) => result.push(v.id));
  376. this.selects = result;
  377. },
  378. bingChip(row) {
  379. this.showChip = true;
  380. this.chipInfo.pr_id = row.pr_id;
  381. },
  382. vivibleModal(e) {
  383. if (!e) {
  384. this.chipInfo = {};
  385. }
  386. },
  387. saveChip() {
  388. this.axios.post("/api/tag_bind", this.chipInfo).then((res) => {
  389. if (res.code == 200) {
  390. this.$Message.success(res.msg || "操作成功");
  391. this.getData(this.proxyObj);
  392. }
  393. });
  394. },
  395. batchDispatchOrder() {
  396. if (!this.selects || this.selects.length < 1) {
  397. return this.$Message.error("请至少选择一项");
  398. }
  399. this.dispatchOrder({
  400. params: { id: this.selects.join(",") },
  401. batch: true,
  402. then: () => {
  403. this.getData(this.proxyObj);
  404. },
  405. });
  406. },
  407. changeSize(e) {
  408. this.pageSize = e;
  409. this.proxyObj.page_size = this.pageSize;
  410. this.getData(this.proxyObj);
  411. },
  412. goOriginalPage(row) {
  413. this.$router.push({
  414. path: "/cms/rawmateria/index",
  415. query: {
  416. order_no: row.order_no,
  417. type: 4,
  418. },
  419. });
  420. },
  421. },
  422. };
  423. </script>
  424. <style lang="scss" scoped>
  425. .log-list {
  426. display: flex;
  427. flex-wrap: wrap;
  428. padding: 10px 0;
  429. }
  430. </style>