homogeneityInspectDialog.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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. <!-- <el-form :model="requestData" label-width="0" :show-message="false">-->
  13. <!-- <el-descriptions title="" :column="2" border>-->
  14. <!-- <el-descriptions-item label="计划编号">-->
  15. <!-- {{ formData.code }}</el-descriptions-item-->
  16. <!-- >-->
  17. <!-- <el-descriptions-item label="产品编码">{{-->
  18. <!-- formData.productCode-->
  19. <!-- }}</el-descriptions-item>-->
  20. <!-- <el-descriptions-item label="产品名称">{{-->
  21. <!-- formData.productName-->
  22. <!-- }}</el-descriptions-item>-->
  23. <!-- <el-descriptions-item label="牌号|型号">-->
  24. <!-- {{ formData.brandNo }}|{{ formData.model }}</el-descriptions-item-->
  25. <!-- >-->
  26. <!-- <el-descriptions-item label="批次号">{{-->
  27. <!-- formData.batchNo-->
  28. <!-- }}</el-descriptions-item>-->
  29. <!-- <el-descriptions-item label="工艺路线">{{-->
  30. <!-- formData.produceRoutingName-->
  31. <!-- }}</el-descriptions-item>-->
  32. <!-- <el-descriptions-item label="要求生产数量">{{-->
  33. <!-- formData.requiredFormingNum-->
  34. <!-- }}</el-descriptions-item>-->
  35. <!-- <el-descriptions-item label="要求完成日期">{{-->
  36. <!-- formData.reqMoldTime-->
  37. <!-- }}</el-descriptions-item>-->
  38. <!-- </el-descriptions>-->
  39. <!-- </el-form>-->
  40. <!-- <headerTitle title="剩余拆批" class="mt20"> </headerTitle>-->
  41. <div class="optionButton">
  42. <el-button type="primary" @click="merge"
  43. >合并</el-button>
  44. </div>
  45. <el-tabs v-model="activeName" @tab-click="tabClick()" type="card" size="mini">
  46. <el-tab-pane label="自制件" name="first"></el-tab-pane>
  47. <el-tab-pane label="装配件" name="second"></el-tab-pane>
  48. </el-tabs>
  49. <el-form ref="form" :model="form" :rules="rules">
  50. <!-- <ele-pro-table-->
  51. <!-- ref="table"-->
  52. <!-- :needPage="false"-->
  53. <!-- :columns="columns"-->
  54. <!-- :datasource="form.surplusUnpack"-->
  55. <!-- >-->
  56. <!-- <template v-slot:toolbar>-->
  57. <!-- <el-button-->
  58. <!-- size="small"-->
  59. <!-- type="primary"-->
  60. <!-- icon="el-icon-plus"-->
  61. <!-- class="ele-btn-icon"-->
  62. <!-- :disabled="requiredFormingNum == 0 ? true : false"-->
  63. <!-- @click="openUnpack"-->
  64. <!-- >-->
  65. <!-- 拆批-->
  66. <!-- </el-button>-->
  67. <!-- </template>-->
  68. <!-- <template v-slot:requiredFormingNum="scope">-->
  69. <!-- <el-form-item-->
  70. <!-- v-if="requiredFormingNum != 0"-->
  71. <!-- :prop="'surplusUnpack.' + scope.$index + '.requiredFormingNum'"-->
  72. <!-- :rules="[-->
  73. <!-- {-->
  74. <!-- required: true,-->
  75. <!-- message: '请输入要求生产数量',-->
  76. <!-- trigger: 'change'-->
  77. <!-- },-->
  78. <!-- {-->
  79. <!-- pattern: /^\d+(\.{0,1}\d+){0,1}$/,-->
  80. <!-- message: '拆批数超过生产数量',-->
  81. <!-- trigger: ['blur', 'change']-->
  82. <!-- }-->
  83. <!-- ]"-->
  84. <!-- >-->
  85. <!-- <el-input-->
  86. <!-- disabled-->
  87. <!-- v-model="requiredFormingNum"-->
  88. <!-- placeholder="请输入"-->
  89. <!-- ></el-input>-->
  90. <!-- </el-form-item>-->
  91. <!-- <el-form-item v-else> 工单已全部拆完 </el-form-item>-->
  92. <!-- </template>-->
  93. <!-- <template v-slot:splitResidue="scope">-->
  94. <!-- {{ formData.splitResidue }}-->
  95. <!-- </template>-->
  96. <!-- </ele-pro-table>-->
  97. <!-- <headerTitle title="拆批" class="mt20"> </headerTitle>-->
  98. <ele-pro-table
  99. ref="table"
  100. :needPage="false"
  101. :columns="columns"
  102. :key="activeName"
  103. :init-load="false"
  104. :datasource="datasource"
  105. >
  106. <template v-slot:stockCount="{ row }">
  107. <el-link type="primary" :underline="false" @click="stockDetail(row)">
  108. {{ row.stockCount }}
  109. </el-link>
  110. </template>
  111. <template v-slot:currentCount="{ row }">
  112. <el-link type="primary" :underline="false" @click="currentDetail(row)">
  113. {{ row.currentCount }}
  114. </el-link>
  115. </template>
  116. <template v-slot:stockColor="{ row }">
  117. <div :class="{'statusRed' : row.stockStatus == '缺料'}">
  118. {{row.stockStatus}}
  119. </div>
  120. </template>
  121. <template v-slot:currentColor="{ row }">
  122. <div :class="{'statusRed' : row.currentStatus == '缺料'}">
  123. {{row.currentStatus}}
  124. </div>
  125. </template>
  126. <template v-slot:finishColor="{ row }">
  127. <div :class="{'statusRed' : row.finishStatus == '缺料'}">
  128. {{row.finishStatus}}
  129. </div>
  130. </template>
  131. <template v-slot:finishCount="{ row }">
  132. <div>
  133. <div v-if="row.finishCount > 0">{{row.finishCount}}</div>
  134. <div v-else>-</div>
  135. </div>
  136. </template>
  137. <!-- <template v-slot:requiredFormingNum="scope">-->
  138. <!-- <el-form-item-->
  139. <!-- :prop="'unpackList.' + scope.$index + '.requiredFormingNum'"-->
  140. <!-- :rules="{-->
  141. <!-- required: true,-->
  142. <!-- message: '请输入要求生产数量',-->
  143. <!-- trigger: 'change'-->
  144. <!-- }"-->
  145. <!-- >-->
  146. <!-- <el-input-number-->
  147. <!-- type="number"-->
  148. <!-- @change="changeNum(scope.$index)"-->
  149. <!-- :min="0"-->
  150. <!-- v-model="scope.row.requiredFormingNum"-->
  151. <!-- placeholder="请输入"-->
  152. <!-- ></el-input-number>-->
  153. <!-- </el-form-item>-->
  154. <!-- </template>-->
  155. <!-- <template v-slot:reqMoldTime="scope">-->
  156. <!-- <el-form-item-->
  157. <!-- :prop="'unpackList.' + scope.$index + '.reqMoldTime'"-->
  158. <!-- :rules="{-->
  159. <!-- required: true,-->
  160. <!-- message: '请选择开始计划时间',-->
  161. <!-- trigger: 'change'-->
  162. <!-- }"-->
  163. <!-- >-->
  164. <!-- <el-date-picker-->
  165. <!-- class="w100"-->
  166. <!-- v-model="scope.row.reqMoldTime"-->
  167. <!-- type="date"-->
  168. <!-- value-format="yyyy-MM-dd"-->
  169. <!-- ></el-date-picker>-->
  170. <!-- </el-form-item>-->
  171. <!-- </template>-->
  172. </ele-pro-table>
  173. </el-form>
  174. </div>
  175. <div slot="footer">
  176. <el-button plain @click="cancel">取消</el-button>
  177. <el-button type="primary" @click="confirm">确定</el-button>
  178. </div>
  179. </ele-modal>
  180. <stockDetailDialog ref="stockDetailDialog" />
  181. <currentDetailDialog ref="currentDetailDialog" />
  182. </div>
  183. </template>
  184. <script>
  185. import { homogeneityInspect, homogeneityInspectMerge } from '@/api/productionPlan/index.js';
  186. import stockDetailDialog from './stockDetailDialog.vue';
  187. import currentDetailDialog from './currentDetailDialog.vue';
  188. export default {
  189. components: {
  190. stockDetailDialog,
  191. currentDetailDialog
  192. },
  193. data() {
  194. return {
  195. visible: false,
  196. formData: {},
  197. requestData: {
  198. deviceCode: '',
  199. deviceName: '',
  200. deviceId: ''
  201. },
  202. requiredFormingNum: 0,
  203. form: {
  204. homogeneityInspect: []
  205. },
  206. rules: {},
  207. columns: [
  208. {
  209. columnKey: 'index',
  210. label: '序号',
  211. type: 'index',
  212. width: 55,
  213. align: 'center',
  214. showOverflowTooltip: true
  215. },
  216. {
  217. prop: 'productCode',
  218. label: '计划编号',
  219. align: 'center',
  220. minWidth: 100,
  221. showOverflowTooltip: true
  222. },
  223. {
  224. prop: 'opCode',
  225. label: '工序编码',
  226. align: 'center',
  227. minWidth: 100,
  228. showOverflowTooltip: true
  229. },
  230. {
  231. prop: 'opName',
  232. label: '工序名称',
  233. align: 'center',
  234. minWidth: 100
  235. },
  236. {
  237. prop: 'bomCode',
  238. label: '物料编码',
  239. align: 'center',
  240. minWidth: 100,
  241. showOverflowTooltip: true
  242. },
  243. {
  244. prop: 'bomName',
  245. label: '物料名称',
  246. align: 'center',
  247. minWidth: 100
  248. },
  249. {
  250. prop: 'count',
  251. label: '定额数量',
  252. align: 'center',
  253. minWidth: 80
  254. },
  255. {
  256. slot: 'stockCount',
  257. prop: 'stockCount',
  258. label: '库存数量',
  259. align: 'center',
  260. minWidth: 80
  261. },
  262. {
  263. slot: 'stockColor',
  264. prop: 'stockStatus',
  265. label: '库存状态',
  266. align: 'center',
  267. minWidth: 80
  268. },
  269. {
  270. slot: 'currentCount',
  271. prop: 'currentCount',
  272. label: '在途数量',
  273. align: 'center',
  274. minWidth: 80
  275. },
  276. {
  277. slot: 'currentColor',
  278. prop: 'currentStatus',
  279. label: '在途状态',
  280. align: 'center',
  281. minWidth: 80
  282. },
  283. {
  284. slot: 'finishCount',
  285. prop: 'finishCount',
  286. label: '最终缺料数量',
  287. align: 'center',
  288. minWidth: 80
  289. },
  290. {
  291. slot: 'finishColor',
  292. prop: 'finishStatus',
  293. label: '最终状态',
  294. align: 'center',
  295. minWidth: 80
  296. },
  297. ],
  298. ids: [],
  299. activeName: 'first',
  300. };
  301. },
  302. methods: {
  303. reload(where) {
  304. this.$nextTick(() => {
  305. this.$refs.table.reload({ page: 1, where });
  306. });
  307. },
  308. /* 表格数据源 */
  309. datasource({ page, limit, where }) {
  310. return homogeneityInspect({
  311. pageNum: page,
  312. size: limit,
  313. ...where,
  314. });
  315. },
  316. stockDetail(row) {
  317. this.$refs.stockDetailDialog.open(row);
  318. },
  319. currentDetail(row) {
  320. this.$refs.currentDetailDialog.open(row);
  321. },
  322. open(ids) {
  323. this.visible = true;
  324. this.ids = ids;
  325. this.reload({planIds: ids});
  326. },
  327. cancel() {
  328. this.formData = {};
  329. this.visible = false;
  330. },
  331. confirm() {
  332. this.visible = false;
  333. },
  334. async merge(){
  335. if(this.activeName == 'first'){
  336. this.reload({planIds: this.ids, productType: 1, merge: 2});
  337. }
  338. if(this.activeName == 'second'){
  339. this.reload({planIds: this.ids, productType: 2, merge: 2});
  340. }
  341. },
  342. tabClick(){
  343. if(this.activeName == 'first'){
  344. this.reload({planIds: this.ids, productType: 1});
  345. }
  346. if(this.activeName == 'second'){
  347. this.reload({planIds: this.ids, productType: 2});
  348. }
  349. }
  350. }
  351. };
  352. </script>
  353. <style lang="scss" scoped>
  354. .mt20 {
  355. margin-top: 20px;
  356. }
  357. .el-form-item {
  358. margin-bottom: 0 !important;
  359. }
  360. .optionButton {
  361. display: flex;
  362. justify-content: flex-end;
  363. padding-bottom: 3px;
  364. }
  365. .statusRed{
  366. color: red;
  367. }
  368. </style>