outbound.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  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. columnKey: 'index',
  497. label: '序号',
  498. type: 'index',
  499. width: 55,
  500. align: 'center',
  501. showOverflowTooltip: true,
  502. fixed: 'left'
  503. },
  504. {
  505. label: '编码',
  506. prop: 'categoryCode',
  507. align: 'center',
  508. width: 150,
  509. showOverflowTooltip: true
  510. },
  511. {
  512. label: '名称',
  513. prop: 'categoryName',
  514. align: 'center',
  515. width: 150,
  516. showOverflowTooltip: true
  517. }
  518. ];
  519. // 级别 - 仅 clientEnvironmentId == 4 时显示
  520. if (this.clientEnvironmentId == 4) {
  521. columns.push({
  522. label: '级别',
  523. prop: 'level',
  524. align: 'center'
  525. });
  526. }
  527. // 型号、规格、牌号
  528. columns.push(
  529. {
  530. label: '型号',
  531. prop: 'categoryModel',
  532. align: 'center',
  533. showOverflowTooltip: true
  534. },
  535. {
  536. label: '规格',
  537. prop: 'specification',
  538. align: 'center',
  539. showOverflowTooltip: true
  540. },
  541. {
  542. label: '牌号',
  543. prop: 'brandNum',
  544. align: 'center',
  545. showOverflowTooltip: true
  546. }
  547. );
  548. // 动态列
  549. this.newColumns.forEach(item => {
  550. columns.push({
  551. label: item.label,
  552. prop: item.prop,
  553. width: 120,
  554. align: item.align,
  555. showOverflowTooltip: item.showOverflowTooltip
  556. });
  557. });
  558. // 批次号
  559. columns.push({
  560. label: '批次号',
  561. prop: 'batchNo',
  562. align: 'center',
  563. showOverflowTooltip: true
  564. });
  565. // 包装数量、单位
  566. columns.push(
  567. {
  568. label: '包装数量',
  569. prop: 'packingQuantity',
  570. width: 80
  571. },
  572. {
  573. label: '单位',
  574. prop: 'packingUnit'
  575. }
  576. );
  577. // 计量数量、计量单位
  578. columns.push(
  579. {
  580. label: '计量数量',
  581. prop: 'measureQuantity',
  582. showOverflowTooltip: true
  583. },
  584. {
  585. label: '计量单位',
  586. prop: 'measureUnit'
  587. }
  588. );
  589. // 重量、重量单位
  590. columns.push(
  591. {
  592. label: '重量',
  593. prop: 'weight',
  594. align: 'center',
  595. showOverflowTooltip: true
  596. },
  597. {
  598. label: '重量单位',
  599. prop: 'weightUnit',
  600. align: 'center',
  601. showOverflowTooltip: true
  602. }
  603. );
  604. // 机型、颜色、锁定数量、库存
  605. columns.push(
  606. {
  607. label: '机型',
  608. prop: 'modelKey',
  609. width: 150
  610. },
  611. {
  612. label: '颜色',
  613. prop: 'colorKey',
  614. width: 150
  615. },
  616. {
  617. label: '锁定数量',
  618. prop: 'lockQuantity',
  619. width: 100
  620. },
  621. {
  622. label: '库存',
  623. prop: 'stockNum',
  624. align: 'center',
  625. showOverflowTooltip: true
  626. }
  627. );
  628. // 单价 - 条件显示
  629. if (this.isPrice == 1) {
  630. columns.push({
  631. label: '单价',
  632. prop: 'price',
  633. align: 'center',
  634. slot: 'price'
  635. });
  636. }
  637. // 金额 - 条件显示
  638. if (this.isPrice == 1) {
  639. columns.push({
  640. label: '金额',
  641. prop: 'totalMoney',
  642. align: 'center',
  643. showOverflowTooltip: true,
  644. slot: 'totalMoney'
  645. });
  646. }
  647. // 采购原因 - 仅 clientEnvironmentId == 4 时显示
  648. if (this.clientEnvironmentId == 4) {
  649. columns.push({
  650. label: '采购原因',
  651. prop: 'purpose',
  652. align: 'center',
  653. showOverflowTooltip: true
  654. });
  655. }
  656. // 仓库、供应商、供应商代号
  657. columns.push(
  658. {
  659. label: '仓库',
  660. prop: 'warehouseName',
  661. width: 150,
  662. showOverflowTooltip: true
  663. },
  664. {
  665. label: '供应商',
  666. prop: 'supplierName',
  667. minWidth: 150,
  668. showOverflowTooltip: true
  669. },
  670. {
  671. label: '供应商代号',
  672. prop: 'supplierCode',
  673. minWidth: 150,
  674. showOverflowTooltip: true
  675. }
  676. );
  677. // 操作列 - 仅在可编辑时显示
  678. if (this.isEdit) {
  679. columns.push({
  680. label: '操作',
  681. width: 120,
  682. align: 'center',
  683. slot: 'action',
  684. fixed: 'right'
  685. });
  686. }
  687. return columns;
  688. }
  689. },
  690. async created() {
  691. //仓库出入库是否显示金额(0:不显示 1:显示)
  692. parameterGetByCode({
  693. code: 'wms_price'
  694. }).then((res) => {
  695. this.isPrice = res.value;
  696. });
  697. this.getFieldModel();
  698. this.getListItems();
  699. this.initDeptData().then(() => {
  700. this.initFormData();
  701. this.getNowFormatDate();
  702. });
  703. },
  704. methods: {
  705. // 获取当前时间函数
  706. getNowDate() {
  707. let date = new Date(),
  708. obj = {
  709. year: date.getFullYear(), //获取当前月份(0-11,0代表1月)
  710. month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
  711. strDate: date.getDate(), // 获取当前日(1-31)
  712. hour: date.getHours(), //获取当前小时(0 ~ 23)
  713. minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
  714. second: date.getSeconds() //获取当前秒数(0 ~ 59)
  715. };
  716. Object.keys(obj).forEach((key) => {
  717. if (obj[key] < 10) obj[key] = `0${obj[key]}`;
  718. });
  719. return obj;
  720. },
  721. // 赋值入库时间
  722. getNowFormatDate() {
  723. const obj = this.getNowDate();
  724. const defaultTime = '00:00:00';
  725. const currentTime = `${obj.hour}:${obj.minute}:${obj.second}`;
  726. this.formData.storageTime = `${obj.year}-${obj.month}-${obj.strDate} ${currentTime}`;
  727. },
  728. // 获取动态表头
  729. getFieldModel() {
  730. storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
  731. let newRes = res.map((m) => {
  732. return {
  733. prop: 'extField.' + m.prop,
  734. label: m.label,
  735. align: 'center',
  736. showOverflowTooltip: true
  737. };
  738. });
  739. this.newColumns = [...newRes];
  740. });
  741. },
  742. userSlected(data) {
  743. this.formData.fromId = data.id;
  744. this.formData.fromUser = data.name;
  745. this.formData.fromUserPhone = data.phone;
  746. },
  747. openDocumentSourceDialog() {
  748. console.log('打开单据来源弹窗');
  749. },
  750. clearDocumentSource() {
  751. console.log('清空');
  752. },
  753. pickingHandleScroll() {
  754. console.log('---------pickingHandleScroll------------');
  755. if (this.showPackingList.length < this.packingList.length) {
  756. if (this.packingList.length > this.pageSize) {
  757. this.pickingPageNum += 1;
  758. }
  759. this.pickingFetchData();
  760. }
  761. },
  762. pickingFetchData() {
  763. const start = (this.pickingPageNum - 1) * this.pageSize;
  764. const end = start + this.pageSize;
  765. this.showPackingList = this.showPackingList.concat(
  766. this.packingList.slice(start, end)
  767. );
  768. },
  769. materielHandleScroll() {
  770. console.log('---------materielHandleScroll------------');
  771. if (this.showMaterialList.length < this.materialList.length) {
  772. if (this.materialList.length > this.pageSize) {
  773. this.materielPageNum += 1;
  774. }
  775. this.materielFetchData();
  776. }
  777. },
  778. materielFetchData() {
  779. const start = (this.materielPageNum - 1) * this.pageSize;
  780. const end = start + this.pageSize;
  781. this.showMaterialList = this.showMaterialList.concat(
  782. this.materialList.slice(start, end)
  783. );
  784. console.log(this.showMaterialList);
  785. },
  786. // 获取物品列表
  787. async getListItems() {
  788. const { data } = await getTreeByGroup({});
  789. this.goodsLists = data;
  790. },
  791. // 打开单据来源弹窗
  792. openDocumentSourceDialog() {
  793. console.log('打开单据来源弹窗');
  794. },
  795. tableRowClassName({ row, rowIndex }) {
  796. console.log(row);
  797. // 结果 0=默认,1=合格,2=不合格
  798. if (row.result == 1) {
  799. return 'warning-row';
  800. } else {
  801. return '';
  802. }
  803. },
  804. detailData(data, dimension) {
  805. this.dimension = dimension;
  806. const mergedData = [...(this.formData.outInDetailList || []), ...data];
  807. this.formData.outInDetailList = mergedData;
  808. this.productList = data.map((productItem) => {
  809. return {
  810. ...productItem,
  811. suspendBatchNo: productItem.batchNo || '',
  812. outInDetailRecordRequestList:
  813. productItem.outInDetailRecordRequestList.map((packingItem) => {
  814. return {
  815. ...packingItem,
  816. workOrderId:
  817. this.type === '自选领用出库'
  818. ? this.form.detailList[0].workOrderId
  819. : '',
  820. pickOrderId:
  821. this.type === '自选领用出库'
  822. ? this.form.detailList[0].pickOrderId
  823. : '',
  824. taskId:
  825. this.type === '自选领用出库'
  826. ? this.form.detailList[0].taskId
  827. : '',
  828. categoryName: productItem.categoryName,
  829. categoryCode: productItem.categoryCode,
  830. supplierCode: productItem.supplierCode,
  831. supplierName: productItem.supplierName,
  832. materialDetailList: packingItem.materialDetailList.map(
  833. (materialItem) => {
  834. return {
  835. ...materialItem,
  836. categoryName: productItem.categoryName,
  837. categoryCode: productItem.categoryCode,
  838. supplierCode: productItem.supplierCode,
  839. supplierName: productItem.supplierName
  840. };
  841. }
  842. )
  843. };
  844. })
  845. };
  846. });
  847. const newProducts = mergedData.map((productItem) => ({
  848. ...productItem,
  849. suspendBatchNo: productItem.batchNo || '',
  850. outInDetailRecordRequestList:
  851. productItem.outInDetailRecordRequestList.map((packingItem) => ({
  852. ...packingItem,
  853. categoryName: productItem.categoryName,
  854. categoryCode: productItem.categoryCode,
  855. supplierCode: productItem.supplierCode,
  856. supplierName: productItem.supplierName,
  857. workOrderId:
  858. this.type === '自选领用出库'
  859. ? this.form.detailList[0].workOrderId
  860. : '',
  861. pickOrderId:
  862. this.type === '自选领用出库'
  863. ? this.form.detailList[0].pickOrderId
  864. : '',
  865. taskId:
  866. this.type === '自选领用出库'
  867. ? this.form.detailList[0].taskId
  868. : '',
  869. materialDetailList: packingItem.materialDetailList.map(
  870. (materialItem) => ({
  871. ...materialItem,
  872. categoryName: productItem.categoryName,
  873. categoryCode: productItem.categoryCode,
  874. supplierCode: productItem.supplierCode,
  875. supplierName: productItem.supplierName
  876. })
  877. )
  878. }))
  879. }));
  880. // 去重合并产品列表和新产品列表
  881. const uniqueProducts = [
  882. ...new Map(
  883. [...this.productList, ...newProducts].map((item) => [item.id, item])
  884. ).values()
  885. ];
  886. this.productList = uniqueProducts;
  887. console.log('111111111111111');
  888. console.log(this.productList);
  889. // 排序
  890. this.productList.sort((a, b) => a.categoryCode - b.categoryCode);
  891. // 获取包装维度数据
  892. const arr = [];
  893. for (const key in this.productList) {
  894. for (const k in this.productList[key].outInDetailRecordRequestList) {
  895. arr.push({
  896. ...this.productList[key].outInDetailRecordRequestList[k]
  897. });
  898. }
  899. }
  900. this.packingList = arr;
  901. const newPacking = [];
  902. newProducts.forEach((item) => {
  903. newPacking.push(...item.outInDetailRecordRequestList);
  904. });
  905. //去重
  906. const newPackingList = [
  907. ...new Map(
  908. [...this.packingList, ...newPacking].map((item) => [item.id, item])
  909. ).values()
  910. ];
  911. this.packingList = newPackingList;
  912. this.packingList.sort((a, b) => a.categoryCode - b.categoryCode);
  913. // 获取物料维度数据
  914. let iArr = [];
  915. arr.forEach((item) => {
  916. item.materialDetailList.forEach((ele) => {
  917. iArr.push({ ...ele });
  918. });
  919. });
  920. this.materialList = iArr;
  921. const newMaterial = [];
  922. newPacking.forEach((item) => {
  923. newMaterial.push(...item.materialDetailList);
  924. });
  925. this.materialList = [...this.materialList, ...newMaterial];
  926. // 触发分页更新
  927. this.pickingPageNum = 1;
  928. this.materielPageNum = 1;
  929. this.pickingFetchData();
  930. this.materielFetchData();
  931. this.formData.outInDetailList = this.productList;
  932. console.log(this.productList, 'this.productList');
  933. console.log(this.packingList, 'this.packingList');
  934. },
  935. async getReturnStorage() {
  936. return new Promise((resolve) => {
  937. console.log(this.formData);
  938. this.$refs.formName.validate(async (valid) => {
  939. if (!this.productList?.length) {
  940. return this.$message.error('请添加出库明细!');
  941. }
  942. let obj = deepClone({ ...this.formData, type: 2 });
  943. obj.extInfo.sourceBizNo = obj.sourceBizNo;
  944. obj.fromType = obj.type;
  945. // 处理物品类型assetType
  946. obj.extInfo.assetType = obj.extInfo?.assetType.join(',');
  947. // 处理仓库id
  948. let warehouseId = [];
  949. let warehouseName = [];
  950. let warehouseIds = this.productList
  951. .map((item) => item.warehouseId)
  952. .flat();
  953. let warehouseNames = this.productList
  954. .map((item) => item.warehouseName)
  955. .flat();
  956. warehouseIds.forEach((item, index) => {
  957. if (!warehouseId.includes(item)) {
  958. warehouseId.push(item);
  959. warehouseName.push(warehouseNames[index]);
  960. }
  961. });
  962. obj.warehouseIds = warehouseId;
  963. obj.warehouseNames = warehouseName;
  964. console.log('2222', obj);
  965. let isPass = false;
  966. // 1按数量计费 2按重量计费
  967. if (this.form.pricingWay == 2) {
  968. if (this.materialList.length > 0) {
  969. // 判断物料
  970. isPass = this.materialCodeReqList.every(
  971. (item) => item.weight > 0
  972. );
  973. } else {
  974. // 判断包装重量是否全部大于0
  975. isPass = this.packingList.every((item) => item.weight > 0);
  976. }
  977. } else {
  978. isPass = true;
  979. }
  980. if (isPass) {
  981. resolve(obj);
  982. } else {
  983. this.$message.error('委外发货重量不能为空');
  984. }
  985. });
  986. });
  987. },
  988. onClear() {
  989. this.formData.sourceBizNo = '';
  990. this.warehousingMaterialList = [];
  991. this.$refs.trees.valueTitle = '';
  992. this.formData.clientName = '';
  993. this.formData.clientUser = '';
  994. this.formData.clientPhone = '';
  995. this.$forceUpdate();
  996. },
  997. rowClass({ row, column, rowIndex, columnIndex }) {
  998. if (rowIndex === 1) {
  999. return {
  1000. display: 'none',
  1001. background: '#EEEEEE'
  1002. };
  1003. }
  1004. return { background: '#0000' };
  1005. },
  1006. // 部门点击事件
  1007. async auditorDeptClick(data) {
  1008. console.log(data);
  1009. this.formData.extInfo.verifyDeptCode = data?.id;
  1010. this.formData.extInfo.verifyDeptName = data?.name;
  1011. this.formData.verifyId = '';
  1012. this.formData.verifyName = '';
  1013. this.$refs.formName.validateField('verifyDeptName');
  1014. if (data) {
  1015. this.getStaffList(data);
  1016. }
  1017. },
  1018. getStaffList(data) {
  1019. return new Promise(async (resolve) => {
  1020. let res = await warehouseDefinition.getUserPage({
  1021. groupId: data.id,
  1022. size: 9999,
  1023. page: 1
  1024. });
  1025. this.llrLsit = res.list;
  1026. resolve();
  1027. });
  1028. },
  1029. // 初始化用户信息
  1030. async initFormData() {
  1031. console.log(this.form, 'ddddddddddddddddddddddddddddd123form');
  1032. // const res = await warehouseDefinition.tree();
  1033. // let obj = res.find(
  1034. // (item) =>
  1035. // item.id ===
  1036. // this.user.info.deptIds[this.user.info.deptIds.length - 1]
  1037. // );
  1038. // if (!obj) return;
  1039. // this.formData.extInfo.deptCode = obj.id;
  1040. // this.formData.extInfo.deptName = obj.name;
  1041. // this.formData.extInfo.createUserName = this.user.info.name;
  1042. // this.formData.createUserId = this.user.info.userId;
  1043. this.formData.extInfo.assetType = Array.from(
  1044. new Set(this.form.categoryLevelTopId?.split(','))
  1045. );
  1046. //委外出库
  1047. if (this.bizType == 7 && this.form.productList) {
  1048. const categoryids = this.form.productList.map(
  1049. (p) => p.categoryLevelTopId
  1050. );
  1051. console.log(categoryids, '委外出库的物品id');
  1052. this.formData.extInfo.assetType = categoryids;
  1053. }
  1054. // 出库类型
  1055. this.formData.bizType = this.bizType;
  1056. // 添加单据来源
  1057. this.formData.sourceBizNo = this.sourceBizNo || this.form?.code;
  1058. // 将出库状态改成出库状态 2出库 1入库
  1059. this.formData.type = 2;
  1060. // 入库登记人
  1061. this.formData.extInfo.createUserId = this.$store.state.user.info.userId;
  1062. this.formData.extInfo.createUserName = this.$store.state.user.info.name;
  1063. this.formData.createUserId = this.$store.state.user.info.userId;
  1064. await this.initDeptData(); // 确保部门树加载
  1065. if (this.form.makerId) {
  1066. warehouseDefinition.getGroupById(this.form.makerId).then((res) => {
  1067. console.log(res, 'makerId');
  1068. this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
  1069. this.$set(this.formData.extInfo, 'verifyDeptName', res.groupName);
  1070. });
  1071. }
  1072. // 生产相关逻辑
  1073. console.log(this.detailList, 'this.detailList');
  1074. console.log(this.saleProductList, 'this.saleProductList');
  1075. console.log(this.productList, 'this.productList');
  1076. console.log('11111111111111111111');
  1077. if (this.detailList?.length > 0) {
  1078. // 获取领料人列表
  1079. if (this.form.executorDeptId) {
  1080. this.getStaffList({ id: this.form.executorDeptId }).then(() => {
  1081. // 获取领料人和领料部门
  1082. this.formData.fromId = this.form.executorId;
  1083. this.formData.fromUser = this.form.executorName;
  1084. this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
  1085. this.formData.extInfo.verifyDeptName = this.form.executorDeptName;
  1086. });
  1087. } else {
  1088. this.formData.fromId = this.form.createUserId;
  1089. warehouseDefinition
  1090. .getGroupById(this.form.createUserId)
  1091. .then((res) => {
  1092. console.log(res, 'form没有executorDeptId有createUserId');
  1093. this.$set(this.formData, 'fromUser', res.name);
  1094. this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
  1095. this.$set(
  1096. this.formData.extInfo,
  1097. 'verifyDeptName',
  1098. res.groupName
  1099. );
  1100. });
  1101. }
  1102. console.log(this.saleProductList, 'this.saleProductList33333');
  1103. let pData = {
  1104. type: '1',
  1105. deliveryNo: this.formData.sourceBizNo,
  1106. builders: this.detailList.map((item) => {
  1107. return {
  1108. categoryId:
  1109. item.categoryId || item.instanceId || item.productId,
  1110. num: item.demandQuantity || item.measurementCount,
  1111. warehouseId: this.bizType == 11 ? item.warehouseId : '',
  1112. batchNo: item.batchNo || ''
  1113. };
  1114. })
  1115. };
  1116. let pData2 = {
  1117. type: this.wwType,
  1118. deliveryNo: this.formData.sourceBizNo,
  1119. taskIds: this.extractedList.map((item) => item.taskId),
  1120. workOrderIds: this.extractedList.map((item) => item.workOrderId),
  1121. };
  1122. let pData3 = {
  1123. //销售退货处理 外协出库
  1124. type: 3,
  1125. deliveryNo: this.formData.sourceBizNo,
  1126. outInIds: this.form?.returnInReceiptId?.split(','),
  1127. packageNos: this.detailList.map((item) => item.packageNo)
  1128. };
  1129. let pData4 = {
  1130. //受托退货
  1131. type: 3,
  1132. deliveryNo: this.formData.sourceBizNo,
  1133. ids: this.detailList.map((item) => item.packageId)?.toString()
  1134. };
  1135. let api = this.bizType == 8 ? 'getHierarchyList' : 'getHierarchyFifo';
  1136. storageApi[api](
  1137. this.wwType == 3
  1138. ? pData2
  1139. : this.bizType == 6
  1140. ? pData3
  1141. : this.bizType == 8
  1142. ? pData4
  1143. : pData
  1144. )
  1145. .then((data) => {
  1146. this.detailData(data, this.dimension);
  1147. })
  1148. .catch((err) => {
  1149. console.log(err);
  1150. });
  1151. return;
  1152. }
  1153. // 销售相关逻辑
  1154. if (this.saleProductList?.length > 0) {
  1155. this.formData.clientName = this.form.contactName;
  1156. this.formData.clientCode = this.form.contactCode;
  1157. // 获取领料人列表
  1158. this.getStaffList({ id: this.form.deptId }).then(() => {
  1159. // 获取领料人和领料部门
  1160. this.formData.fromId = this.form.makerId;
  1161. this.formData.fromUser = this.form.makerName;
  1162. this.formData.extInfo.verifyDeptCode = this.form.deptId;
  1163. this.formData.extInfo.verifyDeptName = this.form.deptName;
  1164. });
  1165. console.log(this.saleProductList, 'this.saleProductList11111');
  1166. let pData = {
  1167. type: '1',
  1168. deliveryNo: this.formData.sourceBizNo,
  1169. builders: this.saleProductList.map((item) => {
  1170. return {
  1171. categoryId: item.productId || item.categoryId,
  1172. num: item.totalCount,
  1173. // 处理销售发货时物品清单和出库清单仓库不一致的问题
  1174. warehouseId: this.bizType == 3 ? item.warehouseId : '',
  1175. colorKey: item.colorKey || '',
  1176. batchNo: item.batchNo || '',
  1177. categoryModel: item.modelType || ''
  1178. };
  1179. })
  1180. };
  1181. let pData2 = {
  1182. type: this.wwType,
  1183. deliveryNo: this.formData.sourceBizNo,
  1184. taskIds: this.extractedList.map((item) => item.taskId),
  1185. workOrderIds: this.extractedList.map((item) => item.workOrderId)
  1186. };
  1187. console.log('111~~~~~~~~', pData)
  1188. storageApi
  1189. .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
  1190. .then((data) => {
  1191. this.detailData(data, this.dimension);
  1192. })
  1193. .catch((err) => {
  1194. console.log(err);
  1195. });
  1196. return;
  1197. }
  1198. //采购委外
  1199. if (this.form.productList?.length > 0) {
  1200. this.getStaffList({ id: this.form.deptId }).then(() => {
  1201. this.formData.fromId = this.form.makerId;
  1202. this.formData.fromUser = this.form.makerName;
  1203. this.formData.extInfo.verifyDeptCode = this.form.deptId;
  1204. this.formData.extInfo.verifyDeptName = this.form.deptName;
  1205. });
  1206. console.log(this.saleProductList, 'this.saleProductList22222');
  1207. let pData = {
  1208. type: '1',
  1209. builders: this.form.productList.map((item) => {
  1210. return {
  1211. categoryId: item.productId,
  1212. num: item.totalCount,
  1213. price: item.totalPrice,
  1214. unitPrice: item.singlePrice,
  1215. weight: item.singleWeight * item.totalCount || 0,
  1216. batchNo: item.batchNo || '',
  1217. taskId: item.taskId || ''
  1218. };
  1219. })
  1220. };
  1221. let pData2 = {
  1222. type: 3,
  1223. taskIds: this.form.productList.map((item) => item.taskId),
  1224. workOrderIds: [this.form.sourceId]
  1225. };
  1226. storageApi
  1227. .getHierarchyFifo(this.form.sourceId ? pData2 : pData)
  1228. .then((data) => {
  1229. this.detailData(data, this.dimension);
  1230. })
  1231. .catch((err) => {
  1232. console.log(err);
  1233. });
  1234. }
  1235. // if (this.form.productList?.length > 0) {
  1236. // this.getStaffList({ id: this.form.deptId }).then(() => {
  1237. // this.formData.fromId = this.form.makerId;
  1238. // this.formData.fromUser = this.form.makerName;
  1239. // this.formData.extInfo.verifyDeptCode = this.form.deptId;
  1240. // this.formData.extInfo.verifyDeptName = this.form.deptName;
  1241. // });
  1242. // let pData = {
  1243. // type: '1',
  1244. // builders: this.form.productList.map((item) => {
  1245. // return {
  1246. // categoryId: item.productId,
  1247. // num: item.totalCount,
  1248. // price: item.totalPrice,
  1249. // unitPrice: item.singlePrice,
  1250. // weight: item.singleWeight * item.totalCount || 0,
  1251. // batchNo: item.batchNo || '',
  1252. // taskId: item.taskId || ''
  1253. // };
  1254. // })
  1255. // };
  1256. // let pData2 = {
  1257. // type: 3,
  1258. // taskIds: this.form.productList.map((item) => item.taskId),
  1259. // workOrderIds: [this.form.sourceId]
  1260. // };
  1261. // storageApi
  1262. // .getHierarchyFifo(this.form.sourceId ? pData2 : pData)
  1263. // .then((data) => {
  1264. // this.detailData(data, this.dimension);
  1265. // })
  1266. // .catch((err) => {
  1267. // console.log(err);
  1268. // });
  1269. // }
  1270. },
  1271. // 初始化部门数据
  1272. initDeptData() {
  1273. return new Promise(async (resolve) => {
  1274. const res = await warehouseDefinition.tree();
  1275. this.treeList = this.$util.toTreeData({
  1276. data: res,
  1277. idField: 'id',
  1278. parentIdField: 'parentId'
  1279. });
  1280. this.$nextTick(() => {
  1281. resolve();
  1282. });
  1283. });
  1284. },
  1285. addStock() {
  1286. console.log(this.formData.extInfo.assetType);
  1287. if (
  1288. !(
  1289. this.formData.extInfo.assetType &&
  1290. this.formData.extInfo.assetType.length > 0
  1291. )
  1292. )
  1293. return this.$message.error('请选择出库产品类型');
  1294. if (!this.formData.bizType && this.formData.bizType !== 0)
  1295. return this.$message.error('请选择出库场景');
  1296. this.$refs.assetsDialogRef.open(this.productList);
  1297. },
  1298. handleBizSceneChange() {
  1299. if (this.formData.extInfo.assetType == 7) {
  1300. this.formData.extInfo.sourceBizNo = '';
  1301. }
  1302. this.formData.sourceBizNo = '';
  1303. },
  1304. deleteProductList(row, index) {
  1305. // 1. 获取当前物料的所有包装列表
  1306. const targetPackages = row.outInDetailRecordRequestList || [];
  1307. const packageIds = new Set(targetPackages.map((p) => p.id));
  1308. console.log('targetPackages', targetPackages);
  1309. console.log('packageIds包装的id', packageIds);
  1310. // 从packingList中移除相关包装
  1311. this.packingList = this.packingList.filter(
  1312. (p) => !packageIds.has(p.id) && p.categoryCode !== row.categoryCode
  1313. );
  1314. console.log('包装列表', this.packingList);
  1315. // 从materialList中移除关联物料
  1316. const materialIds = new Set();
  1317. targetPackages.forEach((packageItem) => {
  1318. packageItem.materialDetailList.forEach((material) => {
  1319. materialIds.add(material.id);
  1320. });
  1321. });
  1322. this.materialList = this.materialList.filter(
  1323. (m) => !materialIds.has(m.id) && m.categoryCode !== row.categoryCode
  1324. );
  1325. this.productList.splice(index, 1);
  1326. // this.$nextTick(() => {
  1327. // this.$refs.productListTable?.doLayout()
  1328. // this.$refs.showPackingListTable?.doLayout()
  1329. // this.$refs.multipleTable?.doLayout()
  1330. // })
  1331. }
  1332. },
  1333. watch: {
  1334. packingList: {
  1335. handler(newVal) {
  1336. console.log('包装列表', newVal);
  1337. console.log('当前包装列表加载页数2', this.pickingPageNum);
  1338. this.showPackingList = newVal.slice(
  1339. 0,
  1340. this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
  1341. );
  1342. },
  1343. deep: true
  1344. },
  1345. materialList: {
  1346. handler(newVal) {
  1347. console.log('物料列表', newVal);
  1348. console.log('当前物料列表加载页数', this.materielPageNum);
  1349. this.showMaterialList = newVal.slice(
  1350. 0,
  1351. this.pageSize *
  1352. (this.materielPageNum > 0 ? this.materielPageNum : 1)
  1353. );
  1354. },
  1355. deep: true
  1356. }
  1357. // detailList: {
  1358. // handler(newVal) {
  1359. // if (newVal.length) {
  1360. // this.initFormData();
  1361. // }
  1362. // },
  1363. // deep: true
  1364. // }
  1365. }
  1366. };
  1367. </script>
  1368. <style lang="scss" scoped>
  1369. ::v-deep .el-row {
  1370. display: flex;
  1371. flex-wrap: wrap;
  1372. }
  1373. ::v-deep.form-table {
  1374. .el-form-item {
  1375. margin-bottom: 0;
  1376. }
  1377. .el-input__inner {
  1378. padding: 0 10px;
  1379. }
  1380. }
  1381. .p20 {
  1382. padding: 20px;
  1383. }
  1384. .el-select,
  1385. .el-date-editor {
  1386. width: 100%;
  1387. }
  1388. .el-form-item {
  1389. margin-bottom: 22px;
  1390. }
  1391. .material {
  1392. margin-top: 20px;
  1393. .flex {
  1394. display: flex;
  1395. justify-content: space-between;
  1396. font-size: 14px;
  1397. align-items: center;
  1398. .red {
  1399. color: #ff4949;
  1400. }
  1401. }
  1402. }
  1403. .mt10 {
  1404. margin-top: 10px;
  1405. }
  1406. .mt20 {
  1407. margin-top: 20px;
  1408. }
  1409. .center {
  1410. text-align: center;
  1411. }
  1412. </style>