outbound.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468
  1. <template>
  2. <div>
  3. <el-card shadow="never">
  4. <header-title title="出库信息"></header-title>
  5. <el-form
  6. :model="formData"
  7. ref="formName"
  8. label-width="110px"
  9. :rules="rules"
  10. >
  11. <el-row :gutter="20">
  12. <el-col :span="6">
  13. <el-form-item label="出库场景" prop="bizType">
  14. <!-- <el-select
  15. filterable
  16. placeholder="请选择"
  17. v-model="formData.bizType"
  18. clearable
  19. @change="handleBizSceneChange"
  20. :disabled="!!(productList && productList.length)"
  21. >
  22. <el-option
  23. v-for="item in outputSceneState"
  24. :key="item.code"
  25. :value="item.code"
  26. :label="item.label"
  27. ></el-option>
  28. </el-select> -->
  29. <el-select
  30. filterable
  31. disabled
  32. placeholder="请选择"
  33. v-model="formData.bizType"
  34. clearable
  35. @change="handleBizSceneChange"
  36. >
  37. <el-option
  38. v-for="item in outputSceneState"
  39. :key="item.code"
  40. :value="item.code"
  41. :label="item.label"
  42. ></el-option>
  43. </el-select> </el-form-item
  44. ></el-col>
  45. <el-col :span="6">
  46. <el-form-item label="单据来源" prop="documentSource">
  47. <el-input
  48. placeholder="请选择"
  49. disabled
  50. v-model="formData.sourceBizNo"
  51. @click.native="openDocumentSourceDialog"
  52. >
  53. </el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="6">
  57. <el-form-item label="出库物品类型" prop="extInfo.assetType">
  58. <el-select
  59. style="width: 100%"
  60. multiple
  61. disabled
  62. v-model="formData.extInfo.assetType"
  63. placeholder="请选择"
  64. >
  65. <el-option
  66. v-for="item in goodsLists"
  67. :key="item.id"
  68. :label="item.name"
  69. :value="item.id"
  70. >
  71. </el-option>
  72. </el-select>
  73. <!-- <el-select
  74. style="width: 100%"
  75. multiple
  76. :disabled="!!(productList && productList.length)"
  77. v-model="formData.extInfo.assetType"
  78. placeholder="请选择"
  79. >
  80. <el-option
  81. v-for="item in goodsLists"
  82. :key="item.id"
  83. :label="item.name"
  84. :value="item.id"
  85. >
  86. </el-option>
  87. </el-select> -->
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="6">
  91. <el-form-item label="出库时间">
  92. <el-date-picker
  93. v-model="formData.storageTime"
  94. type="datetime"
  95. value-format="yyyy-MM-dd HH:mm:ss"
  96. placeholder="选择日期时间"
  97. >
  98. </el-date-picker></el-form-item
  99. ></el-col>
  100. <el-col :span="6">
  101. <el-form-item label="出库登记人">
  102. <el-input
  103. placeholder="登记人"
  104. disabled
  105. v-model="formData.extInfo.createUserName"
  106. clearable /></el-form-item
  107. ></el-col>
  108. <el-col :span="6">
  109. <el-form-item
  110. :label="this.bizType == 10 ? '申请人部门' : '领料人部门'"
  111. prop="extInfo.verifyDeptCode"
  112. >
  113. <selectTree
  114. ref="tree"
  115. class="form-ipt"
  116. size="medium"
  117. style="width: 100%"
  118. clearable
  119. :value="formData.extInfo.verifyDeptCode"
  120. :options="treeList"
  121. :props="{
  122. value: 'id',
  123. label: 'name',
  124. children: 'children'
  125. }"
  126. @getValue="auditorDeptClick"
  127. />
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="6">
  131. <el-form-item
  132. :label="this.bizType == 10 ? '申请人' : '领料人'"
  133. prop="fromId"
  134. >
  135. <el-select
  136. v-model="formData.fromId"
  137. filterable
  138. placeholder="请选择"
  139. >
  140. <el-option
  141. v-for="item in llrLsit"
  142. :key="item.id"
  143. :label="item.name"
  144. :value="item.id"
  145. @click.native="userSlected(item)"
  146. >
  147. </el-option>
  148. </el-select> </el-form-item
  149. ></el-col>
  150. <el-col :span="6">
  151. <el-form-item label="客户名称">
  152. <span>{{ formData.clientName }}</span>
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="12">
  156. <el-form-item label="备注" prop="remark">
  157. <el-input
  158. v-model="formData.remark"
  159. placeholder="请详细说明"
  160. ></el-input>
  161. </el-form-item>
  162. </el-col>
  163. </el-row>
  164. </el-form>
  165. <div>
  166. <el-button
  167. style="margin-bottom: 20px; float: right; margin-right: 20px"
  168. type="primary"
  169. @click="addStock"
  170. v-if="isEdit"
  171. >添加</el-button
  172. >
  173. </div>
  174. <div class="material">
  175. <div>
  176. <header-title title="出库物品清单"></header-title>
  177. <div class="mt10 form-table">
  178. <ele-pro-table
  179. ref="table"
  180. :columns="columns"
  181. :datasource="productList"
  182. height="200"
  183. full-height="calc(100vh - 116px)"
  184. tool-class="ele-toolbar-form"
  185. @columns-change="handleColumnChange"
  186. :cache-key="cacheKeyUrl"
  187. >
  188. <!-- 单价列 -->
  189. <template v-if="isPrice == 1" v-slot:price="{ row }">
  190. {{ row.price ? row.price : ' ' + '元' }}/{{ row.measureUnit }}
  191. </template>
  192. <!-- 金额列 -->
  193. <template v-if="isPrice == 1" v-slot:totalMoney="{ row }">
  194. {{ row.totalMoney ? row.totalMoney : 0 }}
  195. </template>
  196. <!-- 操作列 -->
  197. <template v-if="isEdit" v-slot:action="{ row, $index }">
  198. <el-link type="danger" @click="deleteProductList(row, $index)">删除</el-link>
  199. </template>
  200. </ele-pro-table>
  201. </div>
  202. <header-title class="mt20" title="包装清单"></header-title>
  203. <div class="mt10 form-table">
  204. <el-table
  205. ref="showPackingListTable"
  206. :data="showPackingList"
  207. tooltip-effect="dark"
  208. :max-height="300"
  209. :row-class-name="tableRowClassName"
  210. :header-cell-style="rowClass"
  211. border
  212. v-el-table-infinite-scroll="pickingHandleScroll"
  213. >
  214. <el-table-column label="序号" type="index" width="50">
  215. </el-table-column>
  216. <el-table-column
  217. label="编码"
  218. prop="categoryCode"
  219. :show-overflow-tooltip="true"
  220. ></el-table-column>
  221. <el-table-column
  222. label="名称"
  223. prop="categoryName"
  224. :show-overflow-tooltip="true"
  225. ></el-table-column>
  226. <el-table-column
  227. label="批次号"
  228. prop="batchNo"
  229. :show-overflow-tooltip="true"
  230. ></el-table-column>
  231. <el-table-column
  232. label="发货条码"
  233. prop="barcodes"
  234. :show-overflow-tooltip="true"
  235. ></el-table-column>
  236. <el-table-column
  237. label="包装编码"
  238. prop="packageNo"
  239. :show-overflow-tooltip="true"
  240. ></el-table-column>
  241. <el-table-column
  242. label="包装数量"
  243. prop="packingQuantity"
  244. :show-overflow-tooltip="true"
  245. ></el-table-column>
  246. <el-table-column
  247. label="单位"
  248. prop="packingUnit"
  249. :show-overflow-tooltip="true"
  250. ></el-table-column>
  251. <el-table-column
  252. label="计量数量"
  253. prop="measureQuantity"
  254. :show-overflow-tooltip="true"
  255. ></el-table-column>
  256. <el-table-column
  257. label="计量单位"
  258. prop="measureUnit"
  259. :show-overflow-tooltip="true"
  260. ></el-table-column>
  261. <el-table-column
  262. label="物料代号"
  263. prop="materielDesignation"
  264. :show-overflow-tooltip="true"
  265. >
  266. </el-table-column>
  267. <el-table-column
  268. label="客户代号"
  269. prop="clientCode"
  270. :show-overflow-tooltip="true"
  271. >
  272. </el-table-column>
  273. <el-table-column
  274. label="刻码"
  275. prop="engrave"
  276. :show-overflow-tooltip="true"
  277. >
  278. </el-table-column>
  279. <el-table-column
  280. label="重量"
  281. prop="weight"
  282. :show-overflow-tooltip="true"
  283. >
  284. </el-table-column>
  285. <el-table-column
  286. label="重量单位"
  287. prop="weightUnit"
  288. :show-overflow-tooltip="true"
  289. >
  290. </el-table-column>
  291. <el-table-column label="机型" prop="modelKey" width="200">
  292. </el-table-column>
  293. <el-table-column label="颜色" prop="colorKey" width="200">
  294. </el-table-column>
  295. <el-table-column
  296. label="质检结果"
  297. prop="result"
  298. :show-overflow-tooltip="true"
  299. >
  300. <template slot-scope="{ row }">
  301. <span>{{ qualityResults[row.result] }}</span>
  302. </template>
  303. </el-table-column>
  304. <el-table-column
  305. label="质检状态"
  306. prop="status"
  307. :show-overflow-tooltip="true"
  308. >
  309. <template slot-scope="{ row }">
  310. <span>{{ qualityStatus[row.status] }}</span>
  311. </template>
  312. </el-table-column>
  313. <el-table-column
  314. label="生产日期"
  315. prop="productionDate"
  316. :show-overflow-tooltip="true"
  317. >
  318. </el-table-column>
  319. <el-table-column
  320. label="采购日期"
  321. prop="purchaseDate"
  322. :show-overflow-tooltip="true"
  323. >
  324. </el-table-column>
  325. <el-table-column
  326. prop="supplierName"
  327. label="供应商"
  328. min-width="200"
  329. :show-overflow-tooltip="true"
  330. ></el-table-column>
  331. <el-table-column
  332. prop="supplierCode"
  333. label="供应商代号"
  334. min-width="200"
  335. :show-overflow-tooltip="true"
  336. ></el-table-column>
  337. </el-table>
  338. </div>
  339. </div>
  340. <!-- <div class="mt20">
  341. <header-title class="mt20" title="物料明细"></header-title>
  342. <el-table ref="multipleTable" :data="showMaterialList" tooltip-effect="dark" :max-height="300"
  343. :row-class-name="tableRowClassName" :header-cell-style="rowClass" border style="width: 100%" stripe
  344. height="300px" v-el-table-infinite-scroll="materielHandleScroll">
  345. <el-table-column label="序号" type="index" width="50">
  346. </el-table-column>
  347. <el-table-column label="编码" prop="categoryCode" :show-overflow-tooltip="true"></el-table-column>
  348. <el-table-column label="名称" prop="categoryName" :show-overflow-tooltip="true"></el-table-column>
  349. <el-table-column label="批次号" prop="batchNo"></el-table-column>
  350. <el-table-column label="物料编码" prop="materialCode" :show-overflow-tooltip="true"></el-table-column>
  351. <el-table-column label="发货条码" prop="barcodes" :show-overflow-tooltip="true"></el-table-column>
  352. <el-table-column label="计量数量" prop="minPackingQuantity"></el-table-column>
  353. <el-table-column label="计量单位" prop="measureUnit"></el-table-column>
  354. <el-table-column label="物料代号" prop="materielDesignation">
  355. </el-table-column>
  356. <el-table-column label="客户代号" prop="clientCode">
  357. </el-table-column>
  358. <el-table-column label="刻码" prop="engrave"> </el-table-column>
  359. <el-table-column width="100" label="重量" prop="weight">
  360. </el-table-column>
  361. <el-table-column label="重量单位" prop="weightUnit">
  362. </el-table-column>
  363. <el-table-column label="质检结果" prop="result" width="120">
  364. <template slot-scope="{ row }">
  365. <span>{{ qualityResults[row.result] }}</span>
  366. </template>
  367. </el-table-column>
  368. <el-table-column label="质检状态" prop="status" width="120">
  369. <template slot-scope="{ row }">
  370. <span>{{ qualityStatus[row.status] }}</span>
  371. </template>
  372. </el-table-column>
  373. </el-table>
  374. </div> -->
  375. </div>
  376. </el-card>
  377. <AssetsDialog
  378. ref="assetsDialogRef"
  379. :treeIds="formData.extInfo?.assetType"
  380. @detailData="detailData"
  381. :productLists="this.productList"
  382. />
  383. </div>
  384. </template>
  385. <script>
  386. import storageApi from '@/api/warehouseManagement/index.js';
  387. import elTableInfiniteScroll from 'el-table-infinite-scroll';
  388. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  389. import { getTreeByGroup } from '@/api/classifyManage';
  390. import {
  391. outputSceneState,
  392. qualityResults,
  393. qualityStatus
  394. } from '@/utils/dict/index';
  395. import selectTree from '@/components/selectTree';
  396. import AssetsDialog from './components/AssetsDialog.vue';
  397. import { deepClone } from '@/components/FormGenerator/utils/index';
  398. import { mapGetters } from 'vuex';
  399. import { parameterGetByCode } from '@/api/main/index.js';
  400. import tableColumnsMixin from '@/mixins/tableColumnsMixin';
  401. export default {
  402. mixins: [tableColumnsMixin],
  403. components: {
  404. selectTree,
  405. AssetsDialog
  406. },
  407. props: {
  408. form: { type: Object, default: {} },
  409. bizType: { type: Number, default: 1 },
  410. sourceBizNo: { type: String, default: '' },
  411. type: { type: String, default: '正常出库' },
  412. detailList: { type: Array, default: () => [] },
  413. saleProductList: { type: Array, default: () => [] },
  414. extractedList: { type: Array, default: () => [] },
  415. wwType: { type: Number, default: null },
  416. isEdit: { type: Boolean, default: true } //是否可编辑
  417. },
  418. directives: {
  419. 'el-table-infinite-scroll': elTableInfiniteScroll
  420. },
  421. data() {
  422. return {
  423. cacheKeyUrl: 'wt-outbound-table',
  424. newColumns: [], // 动态表头
  425. goodsLists: [], // 商品列表
  426. productList: [], // 产品列表
  427. showPackingList: [], // 展示的包装列表
  428. packingList: [], // 包装列表
  429. showMaterialList: [], // 展示物料列表
  430. materialList: [], // 物料列表
  431. extInfo: {}, // 扩展信息
  432. pageSize: 20,
  433. pickingPageNum: 1,
  434. materielPageNum: 1,
  435. dimension: '3',
  436. outputSceneState,
  437. qualityStatus, // 质检状态
  438. qualityResults, // 质检结果
  439. treeList: [],
  440. formData: {
  441. storageTime: '',
  442. extInfo: {
  443. assetType: [], //物品类型id
  444. assetTypeName: '', //物品类型名称
  445. deptCode: '', //部门code
  446. deptName: '', //部门名称
  447. verifyDeptCode: '', //审核部门编码
  448. verifyDeptName: '', //审核部门名称
  449. deliveryName: '', //送货人名称
  450. fromUserPhone: '', //送货人电话
  451. sourceBizNo: '', //销售订单
  452. urgent: '', //紧急状态
  453. supplierId: '', //供应商ID
  454. supplierName: '', //供应商名称
  455. createUserName: '', //创建人名字
  456. contentImage: [] //图片数组
  457. },
  458. fromId: '', //领料人
  459. fromUser: '', //送货人
  460. bizType: '', //物品类型
  461. verifyId: '', //审核人Id
  462. verifyName: '', //审核人名称
  463. createUserId: '',
  464. remark: ''
  465. },
  466. rules: {
  467. bizType: {
  468. required: true,
  469. message: '请选择出库场景',
  470. trigger: 'change'
  471. },
  472. 'extInfo[verifyDeptCode]': {
  473. required: true,
  474. message: '请选择领料人部门',
  475. trigger: ['change', 'blur']
  476. },
  477. fromId: {
  478. required: true,
  479. message: '请选择',
  480. trigger: 'change'
  481. }
  482. },
  483. llrLsit: [],
  484. isPrice: 1
  485. };
  486. },
  487. computed: {
  488. ...mapGetters(['user']),
  489. clientEnvironmentId() {
  490. return this.$store.state.user.info.clientEnvironmentId;
  491. },
  492. // 出库物品清单表格列配置
  493. columns() {
  494. const columns = [
  495. {
  496. label: '序号',
  497. type: 'index',
  498. width: 50,
  499. align: 'center'
  500. },
  501. {
  502. label: '编码',
  503. prop: 'categoryCode',
  504. align: 'center',
  505. width: 150,
  506. showOverflowTooltip: true
  507. },
  508. {
  509. label: '名称',
  510. prop: 'categoryName',
  511. align: 'center',
  512. width: 150,
  513. showOverflowTooltip: true
  514. }
  515. ];
  516. // 级别 - 仅 clientEnvironmentId == 4 时显示
  517. if (this.clientEnvironmentId == 4) {
  518. columns.push({
  519. label: '级别',
  520. prop: 'level',
  521. align: 'center'
  522. });
  523. }
  524. // 型号、规格、牌号
  525. columns.push(
  526. {
  527. label: '型号',
  528. prop: 'categoryModel',
  529. align: 'center',
  530. showOverflowTooltip: true
  531. },
  532. {
  533. label: '规格',
  534. prop: 'specification',
  535. align: 'center',
  536. showOverflowTooltip: true
  537. },
  538. {
  539. label: '牌号',
  540. prop: 'brandNum',
  541. align: 'center',
  542. showOverflowTooltip: true
  543. }
  544. );
  545. // 动态列
  546. this.newColumns.forEach(item => {
  547. columns.push({
  548. label: item.label,
  549. prop: item.prop,
  550. width: 120,
  551. align: item.align,
  552. showOverflowTooltip: item.showOverflowTooltip
  553. });
  554. });
  555. // 批次号
  556. columns.push({
  557. label: '批次号',
  558. prop: 'batchNo',
  559. align: 'center',
  560. showOverflowTooltip: true
  561. });
  562. // 包装数量、单位
  563. columns.push(
  564. {
  565. label: '包装数量',
  566. prop: 'packingQuantity',
  567. width: 80
  568. },
  569. {
  570. label: '单位',
  571. prop: 'packingUnit'
  572. }
  573. );
  574. // 计量数量、计量单位
  575. columns.push(
  576. {
  577. label: '计量数量',
  578. prop: 'measureQuantity',
  579. showOverflowTooltip: true
  580. },
  581. {
  582. label: '计量单位',
  583. prop: 'measureUnit'
  584. }
  585. );
  586. // 重量、重量单位
  587. columns.push(
  588. {
  589. label: '重量',
  590. prop: 'weight',
  591. align: 'center',
  592. showOverflowTooltip: true
  593. },
  594. {
  595. label: '重量单位',
  596. prop: 'weightUnit',
  597. align: 'center',
  598. showOverflowTooltip: true
  599. }
  600. );
  601. // 机型、颜色、锁定数量、库存
  602. columns.push(
  603. {
  604. label: '机型',
  605. prop: 'modelKey',
  606. width: 150
  607. },
  608. {
  609. label: '颜色',
  610. prop: 'colorKey',
  611. width: 150
  612. },
  613. {
  614. label: '锁定数量',
  615. prop: 'lockQuantity',
  616. width: 100
  617. },
  618. {
  619. label: '库存',
  620. prop: 'stockNum',
  621. align: 'center',
  622. showOverflowTooltip: true
  623. }
  624. );
  625. // 单价 - 条件显示
  626. if (this.isPrice == 1) {
  627. columns.push({
  628. label: '单价',
  629. prop: 'price',
  630. align: 'center',
  631. slot: 'price'
  632. });
  633. }
  634. // 金额 - 条件显示
  635. if (this.isPrice == 1) {
  636. columns.push({
  637. label: '金额',
  638. prop: 'totalMoney',
  639. align: 'center',
  640. showOverflowTooltip: true,
  641. slot: 'totalMoney'
  642. });
  643. }
  644. // 采购原因 - 仅 clientEnvironmentId == 4 时显示
  645. if (this.clientEnvironmentId == 4) {
  646. columns.push({
  647. label: '采购原因',
  648. prop: 'purpose',
  649. align: 'center',
  650. showOverflowTooltip: true
  651. });
  652. }
  653. // 仓库、供应商、供应商代号
  654. columns.push(
  655. {
  656. label: '仓库',
  657. prop: 'warehouseName',
  658. width: 150,
  659. showOverflowTooltip: true
  660. },
  661. {
  662. label: '供应商',
  663. prop: 'supplierName',
  664. minWidth: 150,
  665. showOverflowTooltip: true
  666. },
  667. {
  668. label: '供应商代号',
  669. prop: 'supplierCode',
  670. minWidth: 150,
  671. showOverflowTooltip: true
  672. }
  673. );
  674. // 操作列 - 仅在可编辑时显示
  675. if (this.isEdit) {
  676. columns.push({
  677. label: '操作',
  678. width: 120,
  679. align: 'center',
  680. slot: 'action'
  681. });
  682. }
  683. return columns;
  684. }
  685. },
  686. async created() {
  687. //仓库出入库是否显示金额(0:不显示 1:显示)
  688. parameterGetByCode({
  689. code: 'wms_price'
  690. }).then((res) => {
  691. this.isPrice = res.value;
  692. });
  693. this.getFieldModel();
  694. this.getListItems();
  695. this.initDeptData().then(() => {
  696. this.initFormData();
  697. this.getNowFormatDate();
  698. });
  699. },
  700. methods: {
  701. // 获取当前时间函数
  702. getNowDate() {
  703. let date = new Date(),
  704. obj = {
  705. year: date.getFullYear(), //获取当前月份(0-11,0代表1月)
  706. month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
  707. strDate: date.getDate(), // 获取当前日(1-31)
  708. hour: date.getHours(), //获取当前小时(0 ~ 23)
  709. minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
  710. second: date.getSeconds() //获取当前秒数(0 ~ 59)
  711. };
  712. Object.keys(obj).forEach((key) => {
  713. if (obj[key] < 10) obj[key] = `0${obj[key]}`;
  714. });
  715. return obj;
  716. },
  717. // 赋值入库时间
  718. getNowFormatDate() {
  719. const obj = this.getNowDate();
  720. const defaultTime = '00:00:00';
  721. const currentTime = `${obj.hour}:${obj.minute}:${obj.second}`;
  722. this.formData.storageTime = `${obj.year}-${obj.month}-${obj.strDate} ${currentTime}`;
  723. },
  724. // 获取动态表头
  725. getFieldModel() {
  726. storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
  727. let newRes = res.map((m) => {
  728. return {
  729. prop: 'extField.' + m.prop,
  730. label: m.label,
  731. align: 'center',
  732. showOverflowTooltip: true
  733. };
  734. });
  735. this.newColumns = [...newRes];
  736. });
  737. },
  738. userSlected(data) {
  739. this.formData.fromId = data.id;
  740. this.formData.fromUser = data.name;
  741. this.formData.fromUserPhone = data.phone;
  742. },
  743. openDocumentSourceDialog() {
  744. console.log('打开单据来源弹窗');
  745. },
  746. clearDocumentSource() {
  747. console.log('清空');
  748. },
  749. pickingHandleScroll() {
  750. console.log('---------pickingHandleScroll------------');
  751. if (this.showPackingList.length < this.packingList.length) {
  752. if (this.packingList.length > this.pageSize) {
  753. this.pickingPageNum += 1;
  754. }
  755. this.pickingFetchData();
  756. }
  757. },
  758. pickingFetchData() {
  759. const start = (this.pickingPageNum - 1) * this.pageSize;
  760. const end = start + this.pageSize;
  761. this.showPackingList = this.showPackingList.concat(
  762. this.packingList.slice(start, end)
  763. );
  764. },
  765. materielHandleScroll() {
  766. console.log('---------materielHandleScroll------------');
  767. if (this.showMaterialList.length < this.materialList.length) {
  768. if (this.materialList.length > this.pageSize) {
  769. this.materielPageNum += 1;
  770. }
  771. this.materielFetchData();
  772. }
  773. },
  774. materielFetchData() {
  775. const start = (this.materielPageNum - 1) * this.pageSize;
  776. const end = start + this.pageSize;
  777. this.showMaterialList = this.showMaterialList.concat(
  778. this.materialList.slice(start, end)
  779. );
  780. console.log(this.showMaterialList);
  781. },
  782. // 获取物品列表
  783. async getListItems() {
  784. const { data } = await getTreeByGroup({});
  785. this.goodsLists = data;
  786. },
  787. // 打开单据来源弹窗
  788. openDocumentSourceDialog() {
  789. console.log('打开单据来源弹窗');
  790. },
  791. tableRowClassName({ row, rowIndex }) {
  792. console.log(row);
  793. // 结果 0=默认,1=合格,2=不合格
  794. if (row.result == 1) {
  795. return 'warning-row';
  796. } else {
  797. return '';
  798. }
  799. },
  800. detailData(data, dimension) {
  801. this.dimension = dimension;
  802. const mergedData = [...(this.formData.outInDetailList || []), ...data];
  803. this.formData.outInDetailList = mergedData;
  804. this.productList = data.map((productItem) => {
  805. return {
  806. ...productItem,
  807. suspendBatchNo: productItem.batchNo || '',
  808. outInDetailRecordRequestList:
  809. productItem.outInDetailRecordRequestList.map((packingItem) => {
  810. return {
  811. ...packingItem,
  812. workOrderId:
  813. this.type === '自选领用出库'
  814. ? this.form.detailList[0].workOrderId
  815. : '',
  816. pickOrderId:
  817. this.type === '自选领用出库'
  818. ? this.form.detailList[0].pickOrderId
  819. : '',
  820. taskId:
  821. this.type === '自选领用出库'
  822. ? this.form.detailList[0].taskId
  823. : '',
  824. categoryName: productItem.categoryName,
  825. categoryCode: productItem.categoryCode,
  826. supplierCode: productItem.supplierCode,
  827. supplierName: productItem.supplierName,
  828. materialDetailList: packingItem.materialDetailList.map(
  829. (materialItem) => {
  830. return {
  831. ...materialItem,
  832. categoryName: productItem.categoryName,
  833. categoryCode: productItem.categoryCode,
  834. supplierCode: productItem.supplierCode,
  835. supplierName: productItem.supplierName
  836. };
  837. }
  838. )
  839. };
  840. })
  841. };
  842. });
  843. const newProducts = mergedData.map((productItem) => ({
  844. ...productItem,
  845. suspendBatchNo: productItem.batchNo || '',
  846. outInDetailRecordRequestList:
  847. productItem.outInDetailRecordRequestList.map((packingItem) => ({
  848. ...packingItem,
  849. categoryName: productItem.categoryName,
  850. categoryCode: productItem.categoryCode,
  851. supplierCode: productItem.supplierCode,
  852. supplierName: productItem.supplierName,
  853. workOrderId:
  854. this.type === '自选领用出库'
  855. ? this.form.detailList[0].workOrderId
  856. : '',
  857. pickOrderId:
  858. this.type === '自选领用出库'
  859. ? this.form.detailList[0].pickOrderId
  860. : '',
  861. taskId:
  862. this.type === '自选领用出库'
  863. ? this.form.detailList[0].taskId
  864. : '',
  865. materialDetailList: packingItem.materialDetailList.map(
  866. (materialItem) => ({
  867. ...materialItem,
  868. categoryName: productItem.categoryName,
  869. categoryCode: productItem.categoryCode,
  870. supplierCode: productItem.supplierCode,
  871. supplierName: productItem.supplierName
  872. })
  873. )
  874. }))
  875. }));
  876. // 去重合并产品列表和新产品列表
  877. const uniqueProducts = [
  878. ...new Map(
  879. [...this.productList, ...newProducts].map((item) => [item.id, item])
  880. ).values()
  881. ];
  882. this.productList = uniqueProducts;
  883. console.log('111111111111111');
  884. console.log(this.productList);
  885. // 排序
  886. this.productList.sort((a, b) => a.categoryCode - b.categoryCode);
  887. // 获取包装维度数据
  888. const arr = [];
  889. for (const key in this.productList) {
  890. for (const k in this.productList[key].outInDetailRecordRequestList) {
  891. arr.push({
  892. ...this.productList[key].outInDetailRecordRequestList[k]
  893. });
  894. }
  895. }
  896. this.packingList = arr;
  897. const newPacking = [];
  898. newProducts.forEach((item) => {
  899. newPacking.push(...item.outInDetailRecordRequestList);
  900. });
  901. //去重
  902. const newPackingList = [
  903. ...new Map(
  904. [...this.packingList, ...newPacking].map((item) => [item.id, item])
  905. ).values()
  906. ];
  907. this.packingList = newPackingList;
  908. this.packingList.sort((a, b) => a.categoryCode - b.categoryCode);
  909. // 获取物料维度数据
  910. let iArr = [];
  911. arr.forEach((item) => {
  912. item.materialDetailList.forEach((ele) => {
  913. iArr.push({ ...ele });
  914. });
  915. });
  916. this.materialList = iArr;
  917. const newMaterial = [];
  918. newPacking.forEach((item) => {
  919. newMaterial.push(...item.materialDetailList);
  920. });
  921. this.materialList = [...this.materialList, ...newMaterial];
  922. // 触发分页更新
  923. this.pickingPageNum = 1;
  924. this.materielPageNum = 1;
  925. this.pickingFetchData();
  926. this.materielFetchData();
  927. this.formData.outInDetailList = this.productList;
  928. console.log(this.productList, 'this.productList');
  929. console.log(this.packingList, 'this.packingList');
  930. },
  931. async getReturnStorage() {
  932. return new Promise((resolve) => {
  933. console.log(this.formData);
  934. this.$refs.formName.validate(async (valid) => {
  935. if (!this.productList?.length) {
  936. return this.$message.error('请添加出库明细!');
  937. }
  938. let obj = deepClone({ ...this.formData, type: 2 });
  939. obj.extInfo.sourceBizNo = obj.sourceBizNo;
  940. obj.fromType = obj.type;
  941. // 处理物品类型assetType
  942. obj.extInfo.assetType = obj.extInfo?.assetType.join(',');
  943. // 处理仓库id
  944. let warehouseId = [];
  945. let warehouseName = [];
  946. let warehouseIds = this.productList
  947. .map((item) => item.warehouseId)
  948. .flat();
  949. let warehouseNames = this.productList
  950. .map((item) => item.warehouseName)
  951. .flat();
  952. warehouseIds.forEach((item, index) => {
  953. if (!warehouseId.includes(item)) {
  954. warehouseId.push(item);
  955. warehouseName.push(warehouseNames[index]);
  956. }
  957. });
  958. obj.warehouseIds = warehouseId;
  959. obj.warehouseNames = warehouseName;
  960. console.log('2222', obj);
  961. let isPass = false;
  962. // 1按数量计费 2按重量计费
  963. if (this.form.pricingWay == 2) {
  964. if (this.materialList.length > 0) {
  965. // 判断物料
  966. isPass = this.materialCodeReqList.every(
  967. (item) => item.weight > 0
  968. );
  969. } else {
  970. // 判断包装重量是否全部大于0
  971. isPass = this.packingList.every((item) => item.weight > 0);
  972. }
  973. } else {
  974. isPass = true;
  975. }
  976. if (isPass) {
  977. resolve(obj);
  978. } else {
  979. this.$message.error('委外发货重量不能为空');
  980. }
  981. });
  982. });
  983. },
  984. onClear() {
  985. this.formData.sourceBizNo = '';
  986. this.warehousingMaterialList = [];
  987. this.$refs.trees.valueTitle = '';
  988. this.formData.clientName = '';
  989. this.formData.clientUser = '';
  990. this.formData.clientPhone = '';
  991. this.$forceUpdate();
  992. },
  993. rowClass({ row, column, rowIndex, columnIndex }) {
  994. if (rowIndex === 1) {
  995. return {
  996. display: 'none',
  997. background: '#EEEEEE'
  998. };
  999. }
  1000. return { background: '#0000' };
  1001. },
  1002. // 部门点击事件
  1003. async auditorDeptClick(data) {
  1004. console.log(data);
  1005. this.formData.extInfo.verifyDeptCode = data?.id;
  1006. this.formData.extInfo.verifyDeptName = data?.name;
  1007. this.formData.verifyId = '';
  1008. this.formData.verifyName = '';
  1009. this.$refs.formName.validateField('verifyDeptName');
  1010. if (data) {
  1011. this.getStaffList(data);
  1012. }
  1013. },
  1014. getStaffList(data) {
  1015. return new Promise(async (resolve) => {
  1016. let res = await warehouseDefinition.getUserPage({
  1017. groupId: data.id,
  1018. size: 9999,
  1019. page: 1
  1020. });
  1021. this.llrLsit = res.list;
  1022. resolve();
  1023. });
  1024. },
  1025. // 初始化用户信息
  1026. async initFormData() {
  1027. console.log(this.form, 'ddddddddddddddddddddddddddddd123form');
  1028. // const res = await warehouseDefinition.tree();
  1029. // let obj = res.find(
  1030. // (item) =>
  1031. // item.id ===
  1032. // this.user.info.deptIds[this.user.info.deptIds.length - 1]
  1033. // );
  1034. // if (!obj) return;
  1035. // this.formData.extInfo.deptCode = obj.id;
  1036. // this.formData.extInfo.deptName = obj.name;
  1037. // this.formData.extInfo.createUserName = this.user.info.name;
  1038. // this.formData.createUserId = this.user.info.userId;
  1039. this.formData.extInfo.assetType = Array.from(
  1040. new Set(this.form.categoryLevelTopId?.split(','))
  1041. );
  1042. //委外出库
  1043. if (this.bizType == 7 && this.form.productList) {
  1044. const categoryids = this.form.productList.map(
  1045. (p) => p.categoryLevelTopId
  1046. );
  1047. console.log(categoryids, '委外出库的物品id');
  1048. this.formData.extInfo.assetType = categoryids;
  1049. }
  1050. // 出库类型
  1051. this.formData.bizType = this.bizType;
  1052. // 添加单据来源
  1053. this.formData.sourceBizNo = this.sourceBizNo || this.form?.code;
  1054. // 将出库状态改成出库状态 2出库 1入库
  1055. this.formData.type = 2;
  1056. // 入库登记人
  1057. this.formData.extInfo.createUserId = this.$store.state.user.info.userId;
  1058. this.formData.extInfo.createUserName = this.$store.state.user.info.name;
  1059. this.formData.createUserId = this.$store.state.user.info.userId;
  1060. await this.initDeptData(); // 确保部门树加载
  1061. if (this.form.makerId) {
  1062. warehouseDefinition.getGroupById(this.form.makerId).then((res) => {
  1063. console.log(res, 'makerId');
  1064. this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
  1065. this.$set(this.formData.extInfo, 'verifyDeptName', res.groupName);
  1066. });
  1067. }
  1068. // 生产相关逻辑
  1069. console.log(this.detailList, 'this.detailList');
  1070. console.log(this.saleProductList, 'this.saleProductList');
  1071. console.log(this.productList, 'this.productList');
  1072. console.log('11111111111111111111');
  1073. if (this.detailList?.length > 0) {
  1074. // 获取领料人列表
  1075. if (this.form.executorDeptId) {
  1076. this.getStaffList({ id: this.form.executorDeptId }).then(() => {
  1077. // 获取领料人和领料部门
  1078. this.formData.fromId = this.form.executorId;
  1079. this.formData.fromUser = this.form.executorName;
  1080. this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
  1081. this.formData.extInfo.verifyDeptName = this.form.executorDeptName;
  1082. });
  1083. } else {
  1084. this.formData.fromId = this.form.createUserId;
  1085. warehouseDefinition
  1086. .getGroupById(this.form.createUserId)
  1087. .then((res) => {
  1088. console.log(res, 'form没有executorDeptId有createUserId');
  1089. this.$set(this.formData, 'fromUser', res.name);
  1090. this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
  1091. this.$set(
  1092. this.formData.extInfo,
  1093. 'verifyDeptName',
  1094. res.groupName
  1095. );
  1096. });
  1097. }
  1098. console.log(this.saleProductList, 'this.saleProductList33333');
  1099. let pData = {
  1100. type: '1',
  1101. deliveryNo: this.formData.sourceBizNo,
  1102. builders: this.detailList.map((item) => {
  1103. return {
  1104. categoryId:
  1105. item.categoryId || item.instanceId || item.productId,
  1106. num: item.demandQuantity || item.measurementCount,
  1107. warehouseId: this.bizType == 11 ? item.warehouseId : '',
  1108. batchNo: item.batchNo || ''
  1109. };
  1110. })
  1111. };
  1112. let pData2 = {
  1113. type: this.wwType,
  1114. deliveryNo: this.formData.sourceBizNo,
  1115. taskIds: this.extractedList.map((item) => item.taskId),
  1116. workOrderIds: this.extractedList.map((item) => item.workOrderId),
  1117. };
  1118. let pData3 = {
  1119. //销售退货处理 外协出库
  1120. type: 3,
  1121. deliveryNo: this.formData.sourceBizNo,
  1122. outInIds: this.form?.returnInReceiptId?.split(','),
  1123. packageNos: this.detailList.map((item) => item.packageNo)
  1124. };
  1125. let pData4 = {
  1126. //受托退货
  1127. type: 3,
  1128. deliveryNo: this.formData.sourceBizNo,
  1129. ids: this.detailList.map((item) => item.packageId)?.toString()
  1130. };
  1131. let api = this.bizType == 8 ? 'getHierarchyList' : 'getHierarchyFifo';
  1132. storageApi[api](
  1133. this.wwType == 3
  1134. ? pData2
  1135. : this.bizType == 6
  1136. ? pData3
  1137. : this.bizType == 8
  1138. ? pData4
  1139. : pData
  1140. )
  1141. .then((data) => {
  1142. this.detailData(data, this.dimension);
  1143. })
  1144. .catch((err) => {
  1145. console.log(err);
  1146. });
  1147. return;
  1148. }
  1149. // 销售相关逻辑
  1150. if (this.saleProductList?.length > 0) {
  1151. this.formData.clientName = this.form.contactName;
  1152. this.formData.clientCode = this.form.contactCode;
  1153. // 获取领料人列表
  1154. this.getStaffList({ id: this.form.deptId }).then(() => {
  1155. // 获取领料人和领料部门
  1156. this.formData.fromId = this.form.makerId;
  1157. this.formData.fromUser = this.form.makerName;
  1158. this.formData.extInfo.verifyDeptCode = this.form.deptId;
  1159. this.formData.extInfo.verifyDeptName = this.form.deptName;
  1160. });
  1161. console.log(this.saleProductList, 'this.saleProductList11111');
  1162. let pData = {
  1163. type: '1',
  1164. deliveryNo: this.formData.sourceBizNo,
  1165. builders: this.saleProductList.map((item) => {
  1166. return {
  1167. categoryId: item.productId || item.categoryId,
  1168. num: item.totalCount,
  1169. // warehouseId: this.bizType == 3 ? item.warehouseId : ''
  1170. batchNo: item.batchNo || '',
  1171. };
  1172. })
  1173. };
  1174. let pData2 = {
  1175. type: this.wwType,
  1176. deliveryNo: this.formData.sourceBizNo,
  1177. taskIds: this.extractedList.map((item) => item.taskId),
  1178. workOrderIds: this.extractedList.map((item) => item.workOrderId)
  1179. };
  1180. console.log('111~~~~~~~~', pData)
  1181. storageApi
  1182. .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
  1183. .then((data) => {
  1184. this.detailData(data, this.dimension);
  1185. })
  1186. .catch((err) => {
  1187. console.log(err);
  1188. });
  1189. return;
  1190. }
  1191. //采购委外
  1192. if (this.form.productList?.length > 0) {
  1193. this.getStaffList({ id: this.form.deptId }).then(() => {
  1194. this.formData.fromId = this.form.makerId;
  1195. this.formData.fromUser = this.form.makerName;
  1196. this.formData.extInfo.verifyDeptCode = this.form.deptId;
  1197. this.formData.extInfo.verifyDeptName = this.form.deptName;
  1198. });
  1199. console.log(this.saleProductList, 'this.saleProductList22222');
  1200. let pData = {
  1201. type: '1',
  1202. builders: this.form.productList.map((item) => {
  1203. return {
  1204. categoryId: item.productId,
  1205. num: item.totalCount,
  1206. price: item.totalPrice,
  1207. unitPrice: item.singlePrice,
  1208. weight: item.singleWeight * item.totalCount || 0,
  1209. batchNo: item.batchNo || '',
  1210. taskId: item.taskId || ''
  1211. };
  1212. })
  1213. };
  1214. let pData2 = {
  1215. type: 3,
  1216. taskIds: this.form.productList.map((item) => item.taskId),
  1217. workOrderIds: [this.form.sourceId]
  1218. };
  1219. storageApi
  1220. .getHierarchyFifo(this.form.sourceId ? pData2 : pData)
  1221. .then((data) => {
  1222. this.detailData(data, this.dimension);
  1223. })
  1224. .catch((err) => {
  1225. console.log(err);
  1226. });
  1227. }
  1228. // if (this.form.productList?.length > 0) {
  1229. // this.getStaffList({ id: this.form.deptId }).then(() => {
  1230. // this.formData.fromId = this.form.makerId;
  1231. // this.formData.fromUser = this.form.makerName;
  1232. // this.formData.extInfo.verifyDeptCode = this.form.deptId;
  1233. // this.formData.extInfo.verifyDeptName = this.form.deptName;
  1234. // });
  1235. // let pData = {
  1236. // type: '1',
  1237. // builders: this.form.productList.map((item) => {
  1238. // return {
  1239. // categoryId: item.productId,
  1240. // num: item.totalCount,
  1241. // price: item.totalPrice,
  1242. // unitPrice: item.singlePrice,
  1243. // weight: item.singleWeight * item.totalCount || 0,
  1244. // batchNo: item.batchNo || '',
  1245. // taskId: item.taskId || ''
  1246. // };
  1247. // })
  1248. // };
  1249. // let pData2 = {
  1250. // type: 3,
  1251. // taskIds: this.form.productList.map((item) => item.taskId),
  1252. // workOrderIds: [this.form.sourceId]
  1253. // };
  1254. // storageApi
  1255. // .getHierarchyFifo(this.form.sourceId ? pData2 : pData)
  1256. // .then((data) => {
  1257. // this.detailData(data, this.dimension);
  1258. // })
  1259. // .catch((err) => {
  1260. // console.log(err);
  1261. // });
  1262. // }
  1263. },
  1264. // 初始化部门数据
  1265. initDeptData() {
  1266. return new Promise(async (resolve) => {
  1267. const res = await warehouseDefinition.tree();
  1268. this.treeList = this.$util.toTreeData({
  1269. data: res,
  1270. idField: 'id',
  1271. parentIdField: 'parentId'
  1272. });
  1273. this.$nextTick(() => {
  1274. resolve();
  1275. });
  1276. });
  1277. },
  1278. addStock() {
  1279. console.log(this.formData.extInfo.assetType);
  1280. if (
  1281. !(
  1282. this.formData.extInfo.assetType &&
  1283. this.formData.extInfo.assetType.length > 0
  1284. )
  1285. )
  1286. return this.$message.error('请选择出库产品类型');
  1287. if (!this.formData.bizType && this.formData.bizType !== 0)
  1288. return this.$message.error('请选择出库场景');
  1289. this.$refs.assetsDialogRef.open(this.productList);
  1290. },
  1291. handleBizSceneChange() {
  1292. if (this.formData.extInfo.assetType == 7) {
  1293. this.formData.extInfo.sourceBizNo = '';
  1294. }
  1295. this.formData.sourceBizNo = '';
  1296. },
  1297. deleteProductList(row, index) {
  1298. // 1. 获取当前物料的所有包装列表
  1299. const targetPackages = row.outInDetailRecordRequestList || [];
  1300. const packageIds = new Set(targetPackages.map((p) => p.id));
  1301. console.log('targetPackages', targetPackages);
  1302. console.log('packageIds包装的id', packageIds);
  1303. // 从packingList中移除相关包装
  1304. this.packingList = this.packingList.filter(
  1305. (p) => !packageIds.has(p.id) && p.categoryCode !== row.categoryCode
  1306. );
  1307. console.log('包装列表', this.packingList);
  1308. // 从materialList中移除关联物料
  1309. const materialIds = new Set();
  1310. targetPackages.forEach((packageItem) => {
  1311. packageItem.materialDetailList.forEach((material) => {
  1312. materialIds.add(material.id);
  1313. });
  1314. });
  1315. this.materialList = this.materialList.filter(
  1316. (m) => !materialIds.has(m.id) && m.categoryCode !== row.categoryCode
  1317. );
  1318. this.productList.splice(index, 1);
  1319. // this.$nextTick(() => {
  1320. // this.$refs.productListTable?.doLayout()
  1321. // this.$refs.showPackingListTable?.doLayout()
  1322. // this.$refs.multipleTable?.doLayout()
  1323. // })
  1324. }
  1325. },
  1326. watch: {
  1327. packingList: {
  1328. handler(newVal) {
  1329. console.log('包装列表', newVal);
  1330. console.log('当前包装列表加载页数2', this.pickingPageNum);
  1331. this.showPackingList = newVal.slice(
  1332. 0,
  1333. this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
  1334. );
  1335. },
  1336. deep: true
  1337. },
  1338. materialList: {
  1339. handler(newVal) {
  1340. console.log('物料列表', newVal);
  1341. console.log('当前物料列表加载页数', this.materielPageNum);
  1342. this.showMaterialList = newVal.slice(
  1343. 0,
  1344. this.pageSize *
  1345. (this.materielPageNum > 0 ? this.materielPageNum : 1)
  1346. );
  1347. },
  1348. deep: true
  1349. }
  1350. // detailList: {
  1351. // handler(newVal) {
  1352. // if (newVal.length) {
  1353. // this.initFormData();
  1354. // }
  1355. // },
  1356. // deep: true
  1357. // }
  1358. }
  1359. };
  1360. </script>
  1361. <style lang="scss" scoped>
  1362. ::v-deep .el-row {
  1363. display: flex;
  1364. flex-wrap: wrap;
  1365. }
  1366. ::v-deep.form-table {
  1367. .el-form-item {
  1368. margin-bottom: 0;
  1369. }
  1370. .el-input__inner {
  1371. padding: 0 10px;
  1372. }
  1373. }
  1374. .p20 {
  1375. padding: 20px;
  1376. }
  1377. .el-select,
  1378. .el-date-editor {
  1379. width: 100%;
  1380. }
  1381. .el-form-item {
  1382. margin-bottom: 22px;
  1383. }
  1384. .material {
  1385. margin-top: 20px;
  1386. .flex {
  1387. display: flex;
  1388. justify-content: space-between;
  1389. font-size: 14px;
  1390. align-items: center;
  1391. .red {
  1392. color: #ff4949;
  1393. }
  1394. }
  1395. }
  1396. .mt10 {
  1397. margin-top: 10px;
  1398. }
  1399. .mt20 {
  1400. margin-top: 20px;
  1401. }
  1402. .center {
  1403. text-align: center;
  1404. }
  1405. </style>