inventoryTableDetails.vue 26 KB

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