orderHomogeneityInspectDialog.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <div>
  3. <ele-modal
  4. width="80vw"
  5. :visible.sync="visible"
  6. :close-on-click-modal="false"
  7. row-key="code"
  8. custom-class="ele-dialog-form"
  9. :title="'齐套性检查'"
  10. >
  11. <div class="form-wrapper">
  12. <div v-if="leftShow" :style="{width: leftWidth}">
  13. <el-tree :expand-on-click-node="false" :data="cardList" :props="treeProps" @node-click="handleNodeClick"></el-tree>
  14. </div>
  15. <div :style="{width: rightWidth}">
  16. <div v-if="!leftShow" class="planInfo">
  17. <el-row style="width: 100%;">
  18. <!-- <el-col :span="planInfo.salesCode ? 6 : planInfo.salesCode.length * 6">-->
  19. <!-- <div style="color: blue; display: flex;">-->
  20. <!-- <div>销售单号:</div><div v-if="planInfo.salesCode"><span v-for="item in planInfo.salesCode"> {{item}}</span></div>-->
  21. <!-- </div>-->
  22. <!-- </el-col>-->
  23. <el-col :span="6">
  24. 销售单号:{{orderInfo.code}}
  25. </el-col>
  26. <el-col :span="6">
  27. 编号:{{orderInfo.productCode}}
  28. </el-col>
  29. <el-col :span="6">
  30. 名称:{{orderInfo.productName}}
  31. </el-col>
  32. <el-col :span="6">
  33. 规格:{{orderInfo.specification}}
  34. </el-col>
  35. <el-col :span="6">
  36. 型号:{{orderInfo.model}}
  37. </el-col>
  38. <el-col :span="6">
  39. 合同数量:{{orderInfo.contractNum}}
  40. </el-col>
  41. </el-row>
  42. </div>
  43. <div>
  44. <ele-pro-table
  45. ref="table"
  46. :needPage="false"
  47. :columns="columns"
  48. key="checkTable"
  49. :init-load="false"
  50. :datasource="datasource"
  51. >
  52. <template v-slot:stockCount="{ row }">
  53. <el-link type="primary" :underline="false" @click="stockDetail(row)">
  54. {{ row.stockCount }}
  55. </el-link>
  56. </template>
  57. <template v-slot:currentCount="{ row }">
  58. <el-link type="primary" :underline="false" @click="currentDetail(row)">
  59. {{ row.currentCount }}
  60. </el-link>
  61. </template>
  62. <template v-slot:stockColor="{ row }">
  63. <div :class="{'statusRed' : row.stockStatus == '缺料'}">
  64. {{row.stockStatus}}
  65. </div>
  66. </template>
  67. <template v-slot:currentColor="{ row }">
  68. <div :class="{'statusRed' : row.currentStatus == '缺料'}">
  69. {{row.currentStatus}}
  70. </div>
  71. </template>
  72. <template v-slot:finishColor="{ row }">
  73. <div :class="{'statusRed' : row.finishStatus == '缺料'}">
  74. {{row.finishStatus}}
  75. </div>
  76. </template>
  77. <template v-slot:finishCount="{ row }">
  78. <div>
  79. <div v-if="row.finishCount > 0">{{row.finishCount}}</div>
  80. <div v-else>-</div>
  81. </div>
  82. </template>
  83. </ele-pro-table>
  84. </div>
  85. </div>
  86. </div>
  87. <div slot="footer">
  88. <el-button plain @click="cancel">取消</el-button>
  89. <el-button type="primary" @click="confirm">确定</el-button>
  90. </div>
  91. </ele-modal>
  92. <stockDetailDialog ref="stockDetailDialog" />
  93. <currentDetailDialog ref="currentDetailDialog" />
  94. </div>
  95. </template>
  96. <script>
  97. import { orderHomogeneityInspect } from '@/api/saleOrder/index.js';
  98. import stockDetailDialog from '../../productionPlan/components/stockDetailDialog.vue';
  99. import currentDetailDialog from '../../productionPlan/components/currentDetailDialog.vue';
  100. export default {
  101. components: {
  102. stockDetailDialog,
  103. currentDetailDialog
  104. },
  105. data() {
  106. return {
  107. visible: false,
  108. bomIdList: [],
  109. formData: {},
  110. requestData: {
  111. deviceCode: '',
  112. deviceName: '',
  113. deviceId: ''
  114. },
  115. requiredFormingNum: 0,
  116. form: {
  117. homogeneityInspect: []
  118. },
  119. rules: {},
  120. columns: [
  121. {
  122. prop: 'opCode',
  123. label: '工序编码',
  124. align: 'center',
  125. minWidth: 100,
  126. showOverflowTooltip: true
  127. },
  128. {
  129. prop: 'opName',
  130. label: '工序名称',
  131. align: 'center',
  132. minWidth: 100
  133. },
  134. {
  135. prop: 'bomCode',
  136. label: '物料编码',
  137. align: 'center',
  138. minWidth: 100,
  139. showOverflowTooltip: true
  140. },
  141. {
  142. prop: 'bomName',
  143. label: '物料名称',
  144. align: 'center',
  145. minWidth: 100
  146. },
  147. {
  148. prop: 'count',
  149. label: '定额数量',
  150. align: 'center',
  151. minWidth: 80
  152. },
  153. {
  154. slot: 'stockCount',
  155. prop: 'stockCount',
  156. label: '库存数量',
  157. align: 'center',
  158. minWidth: 80
  159. },
  160. {
  161. slot: 'stockColor',
  162. prop: 'stockStatus',
  163. label: '库存状态',
  164. align: 'center',
  165. minWidth: 80
  166. },
  167. {
  168. slot: 'currentCount',
  169. prop: 'currentCount',
  170. label: '在途数量',
  171. align: 'center',
  172. minWidth: 80
  173. },
  174. {
  175. slot: 'currentColor',
  176. prop: 'currentStatus',
  177. label: '在途状态',
  178. align: 'center',
  179. minWidth: 80
  180. },
  181. {
  182. slot: 'finishCount',
  183. prop: 'finishCount',
  184. label: '最终缺料数量',
  185. align: 'center',
  186. minWidth: 80
  187. },
  188. {
  189. slot: 'finishColor',
  190. prop: 'finishStatus',
  191. label: '最终状态',
  192. align: 'center',
  193. minWidth: 80
  194. },
  195. ],
  196. ids: [],
  197. leftShow: false,
  198. leftWidth: '0%',
  199. rightWidth: '100%',
  200. cardList: [],
  201. treeProps: {
  202. label: 'code',
  203. children: 'children',
  204. },
  205. planInfo: {
  206. salesCode: '',
  207. },
  208. orderInfo: {
  209. code: '',
  210. productCode: '',
  211. productName: '',
  212. contractNum: '',
  213. specification: '',
  214. model: '',
  215. }
  216. };
  217. },
  218. watch: {
  219. leftShow(newVal, oldVal){
  220. if(newVal){
  221. this.leftWidth = '15%';
  222. this.rightWidth = '85%';
  223. } else {
  224. this.leftWidth = '0%';
  225. this.rightWidth = '100%';
  226. }
  227. }
  228. },
  229. methods: {
  230. reload(where) {
  231. this.$nextTick(() => {
  232. this.$refs.table.reload({ page: 1, where });
  233. });
  234. },
  235. /* 表格数据源 */
  236. datasource({ page, limit, where }) {
  237. return orderHomogeneityInspect({
  238. pageNum: page,
  239. size: limit,
  240. ...where,
  241. });
  242. },
  243. stockDetail(row) {
  244. this.$refs.stockDetailDialog.open(row);
  245. },
  246. currentDetail(row) {
  247. this.$refs.currentDetailDialog.open(row);
  248. },
  249. open(data, order) {
  250. this.visible = true;
  251. this.bomIdList = [];
  252. if(data){
  253. if(data.length == 1){
  254. this.orderInfo = data[0];
  255. this.orderInfo.code = order.code;
  256. console.log(this.orderInfo);
  257. this.leftShow = false;
  258. } else {
  259. this.leftShow = true;
  260. }
  261. let list = [];
  262. for(let item of data){
  263. list.push({bomId: item.bomCategoryId, planNum: item.contractNum});
  264. }
  265. this.bomIdList = list;
  266. this.reload({bomIdList: this.bomIdList});
  267. }
  268. },
  269. cancel() {
  270. this.formData = {};
  271. this.visible = false;
  272. },
  273. confirm() {
  274. this.visible = false;
  275. },
  276. handleNodeClick(data){
  277. console.log(data);
  278. // this.reload({planIds: [data.id]});
  279. },
  280. }
  281. };
  282. </script>
  283. <style lang="scss" scoped>
  284. .mt20 {
  285. margin-top: 20px;
  286. }
  287. .el-form-item {
  288. margin-bottom: 0 !important;
  289. }
  290. .planInfo{
  291. display: flex;
  292. font-size: 16px;
  293. }
  294. </style>