inventoryTableDetails.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  1. <template>
  2. <el-form ref="form">
  3. <ele-pro-table
  4. ref="table"
  5. :needPage="false"
  6. :columns="columns"
  7. :datasource="form.datasource"
  8. height="350"
  9. full-height="calc(100vh - 76px)"
  10. class="time-form"
  11. @columns-change="handleColumnChange"
  12. :cache-key="cacheKeyUrl"
  13. >
  14. <template v-slot:technicalDrawings="scope">
  15. <el-form-item
  16. style="margin-bottom: 20px"
  17. :prop="'datasource.' + scope.$index + '.technicalDrawings'"
  18. >
  19. <fileMain
  20. v-model="scope.row.technicalDrawings"
  21. type="view"
  22. ></fileMain>
  23. </el-form-item>
  24. </template>
  25. <template v-slot:customerReqFiles="scope">
  26. <el-form-item
  27. style="margin-bottom: 20px"
  28. :prop="'datasource.' + scope.$index + '.customerReqFiles'"
  29. >
  30. <fileMain v-model="scope.row.customerReqFiles" type="view"></fileMain>
  31. </el-form-item>
  32. </template>
  33. <template v-slot:industryArtFiles="scope">
  34. <el-form-item
  35. style="margin-bottom: 20px"
  36. :prop="'datasource.' + scope.$index + '.industryArtFiles'"
  37. >
  38. <fileMain v-model="scope.row.industryArtFiles" type="view"></fileMain>
  39. </el-form-item>
  40. </template>
  41. <template v-slot:otherFiles="scope">
  42. <el-form-item
  43. style="margin-bottom: 20px"
  44. :prop="'datasource.' + scope.$index + '. otherFiles'"
  45. >
  46. <fileMain v-model="scope.row.otherFiles" type="view"></fileMain>
  47. </el-form-item>
  48. </template>
  49. <template v-slot:customerExpectDeliveryDeadline="scope">
  50. <div v-if="scope.row.arrivalWay == 1 || !scope.row.arrivalWay">
  51. {{ scope.row.customerExpectDeliveryDeadline }}
  52. </div>
  53. <div v-if="scope.row.arrivalWay == 2">
  54. <el-link
  55. type="primary"
  56. :underline="false"
  57. @click.native="handleMethod(scope.row)"
  58. >
  59. 查看分批时间
  60. </el-link>
  61. </div>
  62. </template>
  63. <template v-slot:saleCount="scope">
  64. <el-form-item
  65. style="margin-bottom: 20px"
  66. :prop="'datasource.' + scope.$index + '.' + countObj.countKey"
  67. >
  68. {{ scope.row[countObj.countKey] }}
  69. </el-form-item>
  70. </template>
  71. <template v-slot:saleUnit="scope">
  72. <el-form-item
  73. style="margin-bottom: 20px"
  74. :prop="'datasource.' + scope.$index + '.' + countObj.unitKey"
  75. >
  76. {{ scope.row[countObj.unitKey] }}
  77. </el-form-item>
  78. </template>
  79. <!-- 表头工具栏 -->
  80. <template v-slot:toolbar>
  81. <div class="headbox">
  82. <div class="pricebox">
  83. <span class="amount" v-if="isAllPrice">总计:{{ allPrice }}元</span>
  84. <span class="amount" v-if="isDiscountTotalPrice"
  85. >优惠后总金额:{{ form.discountTotalPrice }}元</span
  86. >
  87. </div>
  88. </div>
  89. </template>
  90. </ele-pro-table>
  91. <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
  92. </el-form>
  93. </template>
  94. <script>
  95. import dictMixins from '@/mixins/dictMixins';
  96. // import fileMain from '@/components/addDoc/index.vue';
  97. import { lbjtList } from '@/enum/dict.js';
  98. import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
  99. import timeDialog from '@/components/timeDialog/index.vue';
  100. import tabMixins from '@/mixins/tableColumnsMixin';
  101. import { levelList } from '@/enum/dict.js';
  102. import { getInventoryTotalAPI } from '@/api/wms';
  103. const dayjs = require('dayjs');
  104. export default {
  105. mixins: [dictMixins, tabMixins],
  106. components: {
  107. // fileMain,
  108. timeDialog
  109. },
  110. props: {
  111. isDiscountTotalPrice: {
  112. default: false,
  113. type: Boolean
  114. },
  115. isDiscount: {
  116. //折让
  117. type: Boolean,
  118. default: true
  119. },
  120. isCustomerMark: {
  121. //客户代号必填
  122. type: Boolean,
  123. default: false
  124. },
  125. pageName: {
  126. default: ''
  127. },
  128. isChangeCount: {
  129. //默认计算
  130. type: Boolean,
  131. default: true
  132. },
  133. contractBookType: {
  134. //合同类型 1销售 2采购
  135. type: [String, Number],
  136. default: 1
  137. },
  138. isArrivalWay: {
  139. //分批到货时间
  140. type: Boolean,
  141. default: false
  142. },
  143. cacheKeyUrl: '',
  144. //是否显示订单编码
  145. isOrderNo: {
  146. type: Boolean,
  147. default: false
  148. },
  149. //显示库存
  150. isWms: {
  151. type: Boolean,
  152. default: false
  153. },
  154. //
  155. isAllPrice: {
  156. type: Boolean,
  157. default: true
  158. },
  159. maxHeight: {
  160. default: 350
  161. },
  162. countObj: {
  163. type: Object,
  164. default: () => {
  165. return {
  166. countKey: 'saleCount',
  167. unitKey: 'saleUnit',
  168. unitIdKey: 'saleUnitId'
  169. };
  170. }
  171. }
  172. },
  173. data() {
  174. return {
  175. allPrice: 0,
  176. supplierObj: [],
  177. form: {
  178. discountTotalPrice: 0,
  179. datasource: []
  180. },
  181. columnsVersion: 1
  182. };
  183. },
  184. computed: {
  185. columns() {
  186. let columnsVersion = this.columnsVersion;
  187. let orderColumn = {
  188. width: 1,
  189. show: false
  190. };
  191. let wmsColumn = {
  192. width: 1,
  193. show: false
  194. };
  195. if (this.isOrderNo) {
  196. orderColumn = {
  197. minWidth: 200,
  198. prop: 'orderNo',
  199. label: '订单编码',
  200. showOverflowTooltip: true,
  201. align: 'center'
  202. };
  203. }
  204. if (this.isWms) {
  205. wmsColumn = {
  206. minWidth: 160,
  207. prop: 'availableCountBase',
  208. label: '库存数量',
  209. showOverflowTooltip: true,
  210. align: 'center'
  211. };
  212. }
  213. return [
  214. {
  215. width: 45,
  216. type: 'index',
  217. columnKey: 'index',
  218. align: 'center'
  219. },
  220. orderColumn,
  221. {
  222. width: 280,
  223. prop: 'productName',
  224. label: '名称',
  225. slot: 'productName',
  226. headerSlot: 'headerProductName',
  227. align: 'center'
  228. },
  229. {
  230. width: 120,
  231. prop: 'productCode',
  232. label: '编码',
  233. slot: 'productCode',
  234. align: 'center'
  235. },
  236. {
  237. width: 200,
  238. prop: 'productCategoryName',
  239. label: '类型',
  240. slot: 'productCategoryName',
  241. align: 'center'
  242. },
  243. {
  244. width: 120,
  245. prop: 'specification',
  246. label: '规格',
  247. slot: 'specification',
  248. align: 'center'
  249. },
  250. {
  251. width: 200,
  252. prop: 'customerMark',
  253. label: this.contractBookType == 1 ? '客户代号' : '供应商代号',
  254. slot: 'customerMark',
  255. headerSlot: 'headerCustomerMark',
  256. align: 'center'
  257. // show: this.contractBookType == 1
  258. },
  259. {
  260. minWidth: 240,
  261. prop: 'taskName',
  262. label: '工序',
  263. slot: 'taskName',
  264. align: 'center'
  265. },
  266. {
  267. minWidth: 160,
  268. prop: 'productionCodes',
  269. label: '生产编号',
  270. align: 'center'
  271. },
  272. this.isCustomerMark
  273. ? {
  274. minWidth: 120,
  275. prop: 'entrustedEnterpriseId',
  276. label: '受托企业',
  277. slot: 'entrustedEnterpriseId',
  278. show: this.isCustomerMark,
  279. align: 'center',
  280. showOverflowTooltip: true,
  281. formatter: (row, column) => {
  282. return (
  283. this.supplierObj[row.productId]?.find(
  284. (item) => item.id === row.entrustedEnterpriseId
  285. )?.name || ''
  286. );
  287. }
  288. }
  289. : {
  290. width: 1
  291. },
  292. {
  293. width: 150,
  294. prop: 'saleCount',
  295. label: '数量',
  296. slot: 'saleCount',
  297. headerSlot: 'headerTotalCount',
  298. align: 'center'
  299. },
  300. {
  301. width: 150,
  302. prop: 'saleUnit',
  303. label: '单位',
  304. slot: 'saleUnit',
  305. headerSlot: 'headerTotalCount',
  306. align: 'center'
  307. },
  308. {
  309. width: 120,
  310. prop: 'packingSpecification',
  311. align: 'center',
  312. label: '包装规格',
  313. showOverflowTooltip: true
  314. },
  315. {
  316. width: 150,
  317. prop: 'totalCount',
  318. label: '计量数量',
  319. slot: 'totalCount',
  320. headerSlot: 'headerTotalCount',
  321. align: 'center'
  322. },
  323. {
  324. width: 120,
  325. prop: 'measuringUnit',
  326. label: '计量单位',
  327. slot: 'measuringUnit',
  328. align: 'center'
  329. },
  330. wmsColumn,
  331. this.pageName == 'send'
  332. ? {
  333. minWidth: 110,
  334. prop: 'sendTotalCount',
  335. label: '已发货数量',
  336. slot: 'sendTotalCount',
  337. align: 'center'
  338. }
  339. : {
  340. width: 1
  341. },
  342. this.pageName == 'send'
  343. ? {
  344. minWidth: 110,
  345. prop: 'notSendTotalCount',
  346. label: '未发货数量',
  347. slot: 'notSendTotalCount',
  348. align: 'center'
  349. }
  350. : {
  351. width: 1
  352. },
  353. {
  354. width: 120,
  355. prop: 'singleWeight',
  356. label: '单重',
  357. slot: 'singleWeight',
  358. headerSlot: 'headerSingleWeight',
  359. align: 'center'
  360. },
  361. {
  362. width: 120,
  363. prop: 'totalWeight',
  364. label: '总重',
  365. slot: 'totalWeight',
  366. align: 'center'
  367. },
  368. {
  369. width: 120,
  370. prop: 'weightUnit',
  371. label: '重量单位',
  372. slot: 'weightUnit',
  373. align: 'center'
  374. },
  375. // {
  376. // width: 160,
  377. // prop: 'pricingWay',
  378. // label: '计价方式',
  379. // slot: 'pricingWay',
  380. // align: 'center',
  381. // formatter: (row, column) => {
  382. // return row.pricingWay == 1
  383. // ? '按数量计费'
  384. // : row.pricingWay == 2
  385. // ? '按重量计费'
  386. // : '';
  387. // }
  388. // },
  389. {
  390. width: 160,
  391. prop: 'goodsPriceType',
  392. label: '价格类型',
  393. formatter: (row, column) => {
  394. return this.getDictValue('商品价格类型', row.goodsPriceType);
  395. },
  396. align: 'center'
  397. },
  398. {
  399. width: 200,
  400. prop: 'singlePrice',
  401. label: '单价',
  402. slot: 'singlePrice',
  403. headerSlot: 'headerSinglePrice',
  404. align: 'center'
  405. },
  406. {
  407. width: 160,
  408. prop: 'taxRate',
  409. label: '税率',
  410. formatter: (_row, _column, cellValue) => {
  411. return _row.taxRate ? _row.taxRate + '%' : '';
  412. },
  413. align: 'center'
  414. },
  415. {
  416. width: 150,
  417. prop: 'notaxSinglePrice',
  418. label: '不含税单价',
  419. slot: 'notaxSinglePrice',
  420. align: 'center'
  421. },
  422. this.isDiscount
  423. ? {
  424. width: 160,
  425. prop: 'discountSinglePrice',
  426. label: '折让单价',
  427. align: 'center',
  428. show: this.isDiscount,
  429. formatter: (_row, _column, cellValue) => {
  430. return _row.discountSinglePrice
  431. ? Number(_row.discountSinglePrice).toFixed(2)
  432. : '';
  433. }
  434. }
  435. : {
  436. width: 1
  437. },
  438. {
  439. width: 120,
  440. prop: 'totalPrice',
  441. label: '合计',
  442. slot: 'totalPrice',
  443. align: 'center'
  444. },
  445. this.isDiscount
  446. ? {
  447. width: 160,
  448. prop: 'discountTotalPrice',
  449. label: '折让合计',
  450. align: 'center',
  451. show: this.isDiscount,
  452. formatter: (_row, _column, cellValue) => {
  453. return _row.discountTotalPrice
  454. ? Number(_row.discountTotalPrice).toFixed(2)
  455. : '';
  456. }
  457. }
  458. : {
  459. width: 1
  460. },
  461. {
  462. minWidth: 120,
  463. prop: 'goodsLevel',
  464. label: '物品级别',
  465. formatter: (_row, _column, cellValue) => {
  466. return levelList.find((item) => item.value == _row.goodsLevel)
  467. ?.label;
  468. },
  469. align: 'center'
  470. },
  471. {
  472. width: 110,
  473. prop: 'batchNo',
  474. label: '批次号',
  475. slot: 'batchNo',
  476. align: 'center'
  477. },
  478. {
  479. width: 160,
  480. prop: 'productBrand',
  481. label: '牌号',
  482. slot: 'productBrand',
  483. align: 'center'
  484. },
  485. {
  486. width: 120,
  487. prop: 'modelType',
  488. label: '型号',
  489. slot: 'modelType',
  490. align: 'center'
  491. },
  492. {
  493. minWidth: 120,
  494. prop: 'modelKey',
  495. label: '机型',
  496. showOverflowTooltip: true,
  497. align: 'center'
  498. },
  499. {
  500. minWidth: 120,
  501. prop: 'colorKey',
  502. showOverflowTooltip: true,
  503. label: '颜色',
  504. align: 'center'
  505. },
  506. {
  507. width: 120,
  508. prop: 'imgCode',
  509. align: 'center',
  510. label: '图号/件号',
  511. showOverflowTooltip: true
  512. },
  513. {
  514. prop: 'provenance',
  515. label: '产地',
  516. slot: 'provenance',
  517. align: 'center',
  518. // show:this.contractBookType==2,
  519. minWidth: 200,
  520. showOverflowTooltip: true,
  521. formatter: (row, column) => {
  522. return row.provenance && row.provenance.length
  523. ? row.provenance
  524. .map((item) => this.getDictValue('产地', item))
  525. .join(',')
  526. : '';
  527. }
  528. },
  529. {
  530. width: 120,
  531. prop: 'produceType',
  532. align: 'center',
  533. label: '属性类型',
  534. showOverflowTooltip: true,
  535. formatter: (row, column) => {
  536. if (row.produceType) {
  537. return row.produceType
  538. .map((item) => {
  539. return lbjtList[item];
  540. })
  541. .toString();
  542. }
  543. }
  544. },
  545. // {
  546. // width: 120,
  547. // prop: 'approvalNumber',
  548. // align: 'center',
  549. // label: '批准文号',
  550. // showOverflowTooltip: true
  551. // },
  552. // {
  553. // width: 120,
  554. // prop: 'packingSpecification',
  555. // align: 'center',
  556. // label: '包装规格',
  557. // showOverflowTooltip: true
  558. // },
  559. this.isArrivalWay
  560. ? {
  561. width: 160,
  562. prop: 'arrivalWay',
  563. label: '到货方式',
  564. align: 'center',
  565. formatter: (_row, _column, cellValue) => {
  566. return _row.arrivalWay == 1
  567. ? '一次性到货'
  568. : _row.arrivalWay == 2
  569. ? '分批到货'
  570. : '';
  571. }
  572. }
  573. : {
  574. width: 1
  575. },
  576. {
  577. width: 160,
  578. prop: 'customerExpectDeliveryDeadline',
  579. label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
  580. slot: 'customerExpectDeliveryDeadline',
  581. align: 'center'
  582. },
  583. this.contractBookType == 1
  584. ? {
  585. width: 160,
  586. prop: 'produceDeliveryDeadline',
  587. label: '生产交付交期',
  588. slot: 'produceDeliveryDeadline',
  589. headerSlot: 'headerProduceDeliveryDeadline',
  590. align: 'center'
  591. }
  592. : {
  593. width: 1
  594. },
  595. {
  596. width: 200,
  597. prop: 'guaranteePeriod',
  598. label: '有效期',
  599. slot: 'guaranteePeriod',
  600. align: 'center',
  601. formatter: (_row, _column, cellValue) => {
  602. return (
  603. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  604. );
  605. }
  606. },
  607. {
  608. width: 200,
  609. prop: 'guaranteePeriodDeadline',
  610. label: '有效期截止日期',
  611. slot: 'guaranteePeriodDeadline',
  612. align: 'center'
  613. },
  614. {
  615. width: 220,
  616. prop: 'customerReqFiles',
  617. label: '客户需求',
  618. slot: 'customerReqFiles',
  619. align: 'center'
  620. },
  621. {
  622. width: 100,
  623. prop: 'density',
  624. label: '密度',
  625. align: 'center'
  626. },
  627. {
  628. width: 150,
  629. prop: 'productType',
  630. label: '生产加工方式',
  631. align: 'center',
  632. formatter: (_row, _column, cellValue) => {
  633. return _row.productType == 2
  634. ? '加工'
  635. : _row.productType == 3
  636. ? '装配'
  637. : '';
  638. }
  639. },
  640. {
  641. width: 130,
  642. prop: 'technicalAnswerName',
  643. label: '技术答疑人',
  644. slot: 'technicalAnswerName',
  645. align: 'center'
  646. },
  647. {
  648. width: 220,
  649. prop: 'technicalParams',
  650. label: '技术参数',
  651. slot: 'technicalParams',
  652. align: 'center'
  653. },
  654. {
  655. width: 240,
  656. prop: 'technicalDrawings',
  657. label: '技术图纸',
  658. slot: 'technicalDrawings',
  659. align: 'center'
  660. },
  661. {
  662. width: 120,
  663. prop: 'drawingVersion',
  664. label: '图纸版本',
  665. align: 'center'
  666. },
  667. {
  668. width: 240,
  669. prop: 'technologyRouteName',
  670. label: '工艺路线',
  671. slot: 'technologyRouteName',
  672. align: 'center'
  673. },
  674. {
  675. width: 240,
  676. prop: 'industryArtFiles',
  677. label: '工艺附件',
  678. slot: 'industryArtFiles',
  679. align: 'center'
  680. },
  681. {
  682. width: 240,
  683. prop: 'otherFiles',
  684. label: '其他附件',
  685. slot: 'otherFiles',
  686. align: 'center'
  687. },
  688. {
  689. width: 220,
  690. prop: 'remark',
  691. label: '备注',
  692. slot: 'remark',
  693. align: 'center'
  694. }
  695. ];
  696. }
  697. },
  698. created() {
  699. this.requestDict('产地');
  700. this.requestDict('商品价格类型');
  701. },
  702. methods: {
  703. async getSupplierObj(productList, queryName) {
  704. try {
  705. let categoryIds = productList
  706. .filter((item) => item[queryName])
  707. .map((item) => item[queryName]);
  708. return await contactQueryByCategoryIdsAPI({
  709. categoryIds,
  710. isQueryEE: 1
  711. });
  712. } catch (e) {
  713. return Promise.resolve({});
  714. }
  715. },
  716. // 返回列表数据
  717. getTableValue() {
  718. let comitDatasource = this.form.datasource;
  719. if (comitDatasource.length === 0) return [];
  720. comitDatasource.forEach((v) => {
  721. if (v.guaranteePeriodUnitCode) {
  722. v.guaranteePeriodUnitName = this.getDictValue(
  723. '保质期单位',
  724. v.guaranteePeriodUnitCode
  725. );
  726. }
  727. v.technicalDrawings = v.technicalDrawings ? v.technicalDrawings : [];
  728. v.customerReqFiles = v.customerReqFiles || [];
  729. v.industryArtFiles = v.industryArtFiles || [];
  730. v.otherFiles = v.otherFiles || [];
  731. });
  732. return comitDatasource;
  733. },
  734. handleMethod(row) {
  735. this.$refs.timeDialogRef.open(row);
  736. },
  737. setDeliveryDays() {
  738. console.log(this.form.datasource, 'this.form.datasource');
  739. this.form.datasource.forEach((item, i) => {
  740. let guaranteePeriodUnitName = this.guaranteePeriodUnit(
  741. item.guaranteePeriodUnitCode
  742. );
  743. this.$set(
  744. this.form.datasource[i],
  745. 'guaranteePeriodDeadline',
  746. guaranteePeriodUnitName != 'second'
  747. ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
  748. : ''
  749. );
  750. // }
  751. });
  752. },
  753. guaranteePeriodUnit(code) {
  754. return code == 3
  755. ? 'day'
  756. : code == 4
  757. ? 'month'
  758. : code == 5
  759. ? 'year'
  760. : 'second';
  761. },
  762. setDay(addDay, dateType = 'day') {
  763. console.log(addDay);
  764. return dayjs(this.contractStartDate || new Date())
  765. .add(addDay, dateType)
  766. .format('YYYY-MM-DD');
  767. },
  768. //修改回显
  769. async putTableValue(data) {
  770. console.log(data, 'data');
  771. let productList =
  772. (data &&
  773. (data.redressProductList ||
  774. data.quoteProductList ||
  775. data.productList ||
  776. data.detailList)) ||
  777. [];
  778. if (productList) {
  779. this.form.datasource = productList;
  780. this.allPrice =
  781. data.totalAmount || data.totalPrice || data?.contractVO?.totalPrice;
  782. if (this.isDiscountTotalPrice) {
  783. this.form.discountTotalPrice =
  784. data.payAmount ||
  785. data.discountTotalPrice ||
  786. data?.contractVO?.discountTotalPrice;
  787. }
  788. if (this.isWms) {
  789. let codeList = this.form.datasource
  790. .filter((item) => item.productCode)
  791. .map((item) => item.productCode);
  792. //获取仓库库存
  793. let inventoryTotalList = await getInventoryTotalAPI(codeList);
  794. this.form.datasource
  795. .filter((item) => item.productCode)
  796. .forEach((item, index) => {
  797. let find =
  798. inventoryTotalList.find(
  799. (key) => key.code == item.productCode
  800. ) || {};
  801. this.form.datasource;
  802. this.$set(
  803. this.form.datasource[index],
  804. 'availableCountBase',
  805. find.availableCountBase
  806. );
  807. });
  808. }
  809. this.supplierObj = await this.getSupplierObj(
  810. productList,
  811. 'productId'
  812. );
  813. this.$refs.table && this.$refs.table.reload();
  814. }
  815. }
  816. }
  817. };
  818. </script>
  819. <style lang="scss" scoped>
  820. .headbox {
  821. display: flex;
  822. justify-content: space-between;
  823. align-items: center;
  824. .amount {
  825. font-size: 14px;
  826. font-weight: bold;
  827. padding-right: 30px;
  828. }
  829. }
  830. .time-form .el-form-item {
  831. margin-bottom: 0 !important;
  832. }
  833. ::v-deep .period {
  834. display: flex;
  835. .borderleftnone {
  836. .el-input--medium .el-input__inner {
  837. border-top-right-radius: 0;
  838. border-bottom-right-radius: 0;
  839. }
  840. }
  841. .borderrightnone {
  842. .el-input--medium .el-input__inner {
  843. border-top-left-radius: 0;
  844. border-bottom-left-radius: 0;
  845. }
  846. }
  847. }
  848. ::v-deep .time-form tbody > tr:hover > td {
  849. background-color: transparent !important;
  850. }
  851. ::v-deep .time-form .el-table tr {
  852. background-color: #ffffff;
  853. }
  854. .pricebox {
  855. display: flex;
  856. justify-content: flex-start;
  857. align-items: center;
  858. font-weight: bold;
  859. }
  860. </style>