details.vue 11 KB

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