inquiryTable.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. <template>
  2. <el-form :model="form" ref="form">
  3. <ele-pro-table
  4. ref="table"
  5. :needPage="false"
  6. :columns="columns"
  7. :toolkit="[]"
  8. max-height="500px"
  9. :span-method="objectSpanMethod"
  10. :datasource="form.resultList"
  11. cache-key="systemRoleTable17"
  12. class="time-form"
  13. >
  14. <!-- 表头工具栏 -->
  15. <template v-slot:toolbar>
  16. <el-row type="flex" justify="end" align="middle">
  17. <el-popconfirm
  18. class="ele-action"
  19. title="确定要删除吗?"
  20. @confirm="removeSupplier"
  21. v-if="status !== 'Detail'"
  22. >
  23. <template v-slot:reference>
  24. <el-link
  25. type="danger"
  26. title="删除供应商"
  27. :underline="false"
  28. icon="el-icon-delete"
  29. >
  30. 删除
  31. </el-link>
  32. </template>
  33. </el-popconfirm>
  34. </el-row>
  35. </template>
  36. <template v-slot:supplierName="{ row, $index }">
  37. {{ form.supplierName }}
  38. </template>
  39. <template v-slot:supplierTotalPrice="{ row, $index }">
  40. {{ form.totalPrice }}
  41. </template>
  42. <template v-slot:preferentialPrice="{ row, $index }">
  43. <el-form-item
  44. prop="preferentialPrice"
  45. :rules="{
  46. required: true,
  47. message: '请输入优惠价',
  48. trigger: 'blur'
  49. }"
  50. >
  51. <el-input
  52. v-model="form.preferentialPrice"
  53. :disabled="status == 'Detail'"
  54. ></el-input>
  55. </el-form-item>
  56. </template>
  57. <template v-slot:settlementMode="{ row, $index }">
  58. <el-form-item
  59. prop="settlementMode"
  60. :rules="{
  61. required: true,
  62. message: '请输入优惠价',
  63. trigger: 'change'
  64. }"
  65. >
  66. <DictSelection
  67. dictName="结算方式"
  68. clearable
  69. v-model="form.settlementMode"
  70. @itemChange="chaengMode"
  71. :disabled="status == 'Detail'"
  72. >
  73. </DictSelection>
  74. </el-form-item>
  75. </template>
  76. <template v-slot:deliveryDate="{ row, $index }">
  77. <el-form-item
  78. prop="deliveryDate"
  79. :rules="{
  80. required: true,
  81. message: '请选择交货日期',
  82. trigger: 'change'
  83. }"
  84. >
  85. <el-date-picker
  86. style="width: 100%"
  87. clearable
  88. type="date"
  89. :disabled="status == 'Detail'"
  90. v-model="form.deliveryDate"
  91. value-format="yyyy-MM-dd"
  92. placeholder="请选择日期"
  93. >
  94. </el-date-picker>
  95. </el-form-item>
  96. </template>
  97. <template v-slot:taxRate="{ row, $index }">
  98. <el-form-item prop="taxRate">
  99. <el-input
  100. v-model="form.taxRate"
  101. style="width: 100%"
  102. :disabled="status == 'Detail'"
  103. >
  104. <template slot="suffix">%</template>
  105. </el-input>
  106. </el-form-item>
  107. </template>
  108. <template v-slot:files="{ row, $index }">
  109. <el-form-item prop="files">
  110. <fileMain
  111. v-model="form.files"
  112. :type="status == 'Detail' ? 'view' : ''"
  113. ></fileMain>
  114. <!-- <fileUpload-->
  115. <!-- v-if="status != 'Detail'"-->
  116. <!-- v-model="form.files"-->
  117. <!-- module="main"-->
  118. <!-- :showLib="false"-->
  119. <!-- :limit="5"-->
  120. <!-- />-->
  121. <!-- <div-->
  122. <!-- v-if=" form.files && form.files?.length && status == 'Detail' ">-->
  123. <!-- <el-link-->
  124. <!-- v-for="link in form.files"-->
  125. <!-- :key="link.id"-->
  126. <!-- type="primary"-->
  127. <!-- :underline="false"-->
  128. <!-- @click="downloadFile(link)"-->
  129. <!-- >-->
  130. <!-- {{ link.name }}-->
  131. <!-- </el-link-->
  132. <!-- >-->
  133. <!-- </div>-->
  134. </el-form-item>
  135. </template>
  136. <template v-slot:isWinner="{ row, $index }">
  137. <el-form-item
  138. style="margin-bottom: 20px"
  139. :prop="'resultList.' + $index + '.isWinner'"
  140. :rules="{
  141. required: true,
  142. message: '请输入',
  143. trigger: 'change'
  144. }"
  145. >
  146. <el-select v-model="row.isWinner" :disabled="status == 'Detail'">
  147. <el-option label="是" :value="1"></el-option>
  148. <el-option label="否" :value="0"></el-option>
  149. </el-select>
  150. </el-form-item>
  151. </template>
  152. <template v-slot:supplierProductName="{ row, $index }">
  153. <el-form-item
  154. style="margin-bottom: 20px"
  155. :prop="'resultList.' + $index + '.supplierProductName'"
  156. :rules="{
  157. required: true,
  158. message: '请输入',
  159. trigger: 'change'
  160. }"
  161. >
  162. <el-input
  163. v-model="row.supplierProductName"
  164. placeholder="请输入"
  165. :disabled="status == 'Detail'"
  166. ></el-input>
  167. </el-form-item>
  168. </template>
  169. <template v-slot:supplierProductCode="scope">
  170. <el-form-item
  171. style="margin-bottom: 20px"
  172. :prop="'resultList.' + scope.$index + '.supplierProductCode'"
  173. :rules="{
  174. required: false,
  175. message: '请输入',
  176. trigger: 'blur'
  177. }"
  178. >
  179. <el-input
  180. v-model="scope.row.supplierProductCode"
  181. :disabled="status == 'Detail'"
  182. ></el-input>
  183. </el-form-item>
  184. </template>
  185. <template v-slot:deliveryDays="scope">
  186. <el-form-item
  187. style="margin-bottom: 20px"
  188. :prop="'resultList.' + scope.$index + '.deliveryDays'"
  189. >
  190. <el-input
  191. v-model="scope.row.deliveryDays"
  192. :disabled="status == 'Detail'"
  193. ></el-input>
  194. </el-form-item>
  195. </template>
  196. <template v-slot:guaranteePeriod="scope">
  197. <el-form-item
  198. style="margin-bottom: 20px"
  199. :prop="'resultList.' + scope.$index + '.guaranteePeriod'"
  200. >
  201. <el-input
  202. v-model="scope.row.guaranteePeriod"
  203. :disabled="status == 'Detail'"
  204. ></el-input>
  205. </el-form-item>
  206. </template>
  207. <template v-slot:guaranteePeriodUnitCode="scope">
  208. <el-form-item
  209. style="margin-bottom: 20px"
  210. :prop="'resultList.' + scope.$index + '.guaranteePeriodUnitCode'"
  211. >
  212. <DictSelection
  213. dictName="质保期单位"
  214. clearable
  215. v-model="scope.row.guaranteePeriodUnitCode"
  216. :disabled="status == 'Detail'"
  217. @itemChange="chaengUnitCode"
  218. >
  219. </DictSelection>
  220. </el-form-item>
  221. </template>
  222. <template v-slot:singlePrice="scope">
  223. <el-form-item
  224. style="margin-bottom: 20px"
  225. :prop="'resultList.' + scope.$index + '.singlePrice'"
  226. :rules="{
  227. required: true,
  228. message: '请输入',
  229. trigger: 'change'
  230. }"
  231. >
  232. <el-input
  233. @blur="changeGetPrice(scope.row)"
  234. v-model="scope.row.singlePrice"
  235. :disabled="status == 'Detail'"
  236. type="number"
  237. >
  238. <template slot="suffix">元</template>
  239. </el-input>
  240. </el-form-item>
  241. </template>
  242. <template v-slot:totalCount="scope">
  243. <el-form-item
  244. :prop="'resultList.' + scope.$index + '.totalCount'"
  245. :rules="{
  246. required: true,
  247. pattern: numberReg,
  248. message: '请输入数字',
  249. trigger: 'blur'
  250. }"
  251. >
  252. <el-input
  253. @blur="changeGetPrice(scope.row)"
  254. v-model="scope.row.totalCount"
  255. :disabled="status == 'Detail'"
  256. placeholder="请输入"
  257. ></el-input>
  258. </el-form-item>
  259. </template>
  260. <template v-slot:totalPrice="scope">
  261. <span>{{
  262. totalPrice(scope.row.totalCount, scope.row.singlePrice, scope.row)
  263. }}</span>
  264. </template>
  265. <template v-slot:modelType="scope">
  266. <el-form-item
  267. style="margin-bottom: 20px"
  268. :prop="'resultList.' + scope.$index + '.modelType'"
  269. >
  270. <el-input
  271. v-model="scope.row.modelType"
  272. :disabled="status == 'Detail'"
  273. ></el-input>
  274. </el-form-item>
  275. </template>
  276. <template v-slot:specification="scope">
  277. <el-form-item
  278. style="margin-bottom: 20px"
  279. :prop="'resultList.' + scope.$index + '.specification'"
  280. >
  281. <el-input
  282. v-model="scope.row.specification"
  283. :disabled="status == 'Detail'"
  284. ></el-input>
  285. </el-form-item>
  286. </template>
  287. <!-- <template v-slot:measuringUnit="scope">-->
  288. <!-- <el-form-item-->
  289. <!-- style="margin-bottom: 20px"-->
  290. <!-- :prop="'resultList.' + scope.$index + '.measuringUnit'"-->
  291. <!-- :rules="{-->
  292. <!-- required: false,-->
  293. <!-- message: '请输入',-->
  294. <!-- trigger: 'blur'-->
  295. <!-- }"-->
  296. <!-- >-->
  297. <!-- <el-input-->
  298. <!-- v-model="scope.row.measuringUnit"-->
  299. <!-- placeholder="请输入"-->
  300. <!-- :disabled="true"-->
  301. <!-- ></el-input>-->
  302. <!-- </el-form-item>-->
  303. <!-- </template>-->
  304. <template v-slot:remark="scope">
  305. <el-form-item
  306. style="margin-bottom: 20px"
  307. :prop="'resultList.' + scope.$index + '.remark'"
  308. >
  309. <el-input
  310. v-model="scope.row.remark"
  311. type="textarea"
  312. placeholder="请输入"
  313. :disabled="status == 'Detail'"
  314. ></el-input>
  315. </el-form-item>
  316. </template>
  317. <template v-slot:isRequired="{ column }">
  318. <span class="is-required">{{ column.label }}</span>
  319. </template>
  320. <!-- <template v-slot:files="scope">
  321. <el-form-item prop="files">
  322. <fileUpload
  323. v-model="scope.row.files"
  324. module="main"
  325. :showLib="false"
  326. :limit="5"
  327. />
  328. </el-form-item>
  329. </template> -->
  330. </ele-pro-table>
  331. </el-form>
  332. </template>
  333. <script>
  334. import { numberReg } from 'ele-admin';
  335. import dictMixins from '@/mixins/dictMixins';
  336. import fileUpload from '@/components/upload/fileUpload';
  337. import { copyObj } from '@/utils/util';
  338. import { getFile } from '@/api/system/file';
  339. import fileMain from '@/components/addDoc/index.vue';
  340. // import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
  341. const defaultColumns = [
  342. {
  343. width: 50,
  344. label: '序号',
  345. type: 'index',
  346. columnKey: 'index',
  347. align: 'center',
  348. fixed: 'left'
  349. },
  350. {
  351. minWidth: 120,
  352. prop: 'supplierName',
  353. label: '供应商',
  354. slot: 'supplierName',
  355. align: 'center',
  356. showOverflowTooltip: true,
  357. isMerge: true,
  358. fixed: 'left'
  359. },
  360. {
  361. minWidth: 80,
  362. prop: 'supplierTotalPrice',
  363. label: '总价',
  364. slot: 'supplierTotalPrice',
  365. align: 'center',
  366. showOverflowTooltip: true,
  367. isMerge: true,
  368. fixed: 'left'
  369. },
  370. {
  371. minWidth: 120,
  372. prop: 'preferentialPrice',
  373. label: '优惠后总价',
  374. slot: 'preferentialPrice',
  375. headerSlot: 'isRequired',
  376. align: 'center',
  377. showOverflowTooltip: true,
  378. isMerge: true,
  379. fixed: 'left'
  380. },
  381. {
  382. minWidth: 120,
  383. prop: 'settlementMode',
  384. label: '结算方式',
  385. slot: 'settlementMode',
  386. headerSlot: 'isRequired',
  387. align: 'center',
  388. showOverflowTooltip: true,
  389. isMerge: true,
  390. fixed: 'left'
  391. },
  392. {
  393. minWidth: 160,
  394. prop: 'deliveryDate',
  395. label: '交货日期',
  396. slot: 'deliveryDate',
  397. headerSlot: 'isRequired',
  398. align: 'center',
  399. showOverflowTooltip: true,
  400. isMerge: true,
  401. fixed: 'left'
  402. },
  403. {
  404. minWidth: 100,
  405. prop: 'productCode',
  406. label: '编码',
  407. slot: 'productCode',
  408. align: 'center',
  409. showOverflowTooltip: true
  410. },
  411. {
  412. minWidth: 100,
  413. prop: 'productName',
  414. label: '产品名称',
  415. slot: 'productName',
  416. align: 'center',
  417. showOverflowTooltip: true
  418. },
  419. {
  420. minWidth: 100,
  421. prop: 'isWinner',
  422. label: '是否中标',
  423. slot: 'isWinner',
  424. align: 'center',
  425. headerSlot: 'isRequired',
  426. showOverflowTooltip: true
  427. },
  428. {
  429. minWidth: 140,
  430. prop: 'supplierProductCode',
  431. label: '供应商产品编码',
  432. slot: 'supplierProductCode',
  433. align: 'center'
  434. },
  435. {
  436. minWidth: 160,
  437. prop: 'supplierProductName',
  438. label: '供应商产品名称',
  439. slot: 'supplierProductName',
  440. headerSlot: 'isRequired',
  441. align: 'center'
  442. },
  443. {
  444. minWidth: 90,
  445. prop: 'totalCount',
  446. label: '购买数量',
  447. slot: 'totalCount',
  448. headerSlot: 'isRequired',
  449. align: 'center'
  450. },
  451. {
  452. minWidth: 80,
  453. prop: 'measuringUnit',
  454. label: '计量单位',
  455. slot: 'measuringUnit',
  456. align: 'center'
  457. },
  458. {
  459. minWidth: 120,
  460. prop: 'singlePrice',
  461. label: '采购单价',
  462. slot: 'singlePrice',
  463. headerSlot: 'isRequired',
  464. align: 'center'
  465. },
  466. {
  467. minWidth: 80,
  468. prop: 'totalPrice',
  469. label: '采购金额',
  470. slot: 'totalPrice',
  471. align: 'center'
  472. },
  473. {
  474. minWidth: 120,
  475. prop: 'modelType',
  476. label: '型号',
  477. slot: 'modelType',
  478. align: 'center'
  479. },
  480. {
  481. minWidth: 120,
  482. prop: 'specification',
  483. label: '规格',
  484. slot: 'specification',
  485. align: 'center'
  486. },
  487. // {
  488. // width: 130,
  489. // prop: 'brand',
  490. // label: '品牌',
  491. // slot: 'brand'
  492. // },
  493. {
  494. minWidth: 80,
  495. prop: 'deliveryDays',
  496. label: '交期(天)',
  497. slot: 'deliveryDays',
  498. align: 'center'
  499. },
  500. {
  501. minWidth: 100,
  502. prop: 'guaranteePeriod',
  503. label: '质保期',
  504. slot: 'guaranteePeriod',
  505. align: 'center'
  506. },
  507. {
  508. minWidth: 120,
  509. prop: 'guaranteePeriodUnitCode',
  510. label: '质保期单位',
  511. slot: 'guaranteePeriodUnitCode',
  512. align: 'center'
  513. },
  514. {
  515. minWidth: 220,
  516. prop: 'remark',
  517. label: '备注',
  518. slot: 'remark',
  519. align: 'center'
  520. },
  521. {
  522. minWidth: 90,
  523. prop: 'taxRate',
  524. label: '税率',
  525. slot: 'taxRate',
  526. align: 'center',
  527. isMerge: true,
  528. showOverflowTooltip: true
  529. },
  530. {
  531. minWidth: 220,
  532. prop: 'files',
  533. label: '附件',
  534. slot: 'files',
  535. align: 'center',
  536. isMerge: true,
  537. showOverflowTooltip: true
  538. }
  539. ];
  540. export default {
  541. mixins: [dictMixins],
  542. components: {
  543. fileMain,
  544. fileUpload
  545. // headList
  546. },
  547. props: {
  548. obj: {},
  549. status: {
  550. default: 'edit'
  551. },
  552. radio: {
  553. default: ''
  554. },
  555. isUpdate: {
  556. default: false
  557. }
  558. },
  559. data() {
  560. const defaultForm = {
  561. key: null,
  562. endTime: '',
  563. isFirst: 0,
  564. name: ''
  565. };
  566. return {
  567. numberReg,
  568. defaultForm,
  569. radio1: '',
  570. form: {
  571. resultList: [
  572. {
  573. supplierProductCode: '',
  574. deliveryDays: '',
  575. guaranteePeriod: '',
  576. guaranteePeriodUnitCode: '',
  577. guaranteePeriodUnitName: '',
  578. measuringUnit: '',
  579. modelType: '',
  580. productCode: '',
  581. isWinner: '',
  582. remark: '',
  583. singlePrice: '',
  584. specification: '',
  585. supplierProductName: '',
  586. technicalAnswerName: '',
  587. technicalParams: '',
  588. totalCount: '',
  589. totalPrice: ''
  590. }
  591. ]
  592. },
  593. dataList: [],
  594. spanArr: [],
  595. columns: [...defaultColumns]
  596. };
  597. },
  598. computed: {},
  599. watch: {
  600. radio(n, v) {
  601. this.radio1 = n;
  602. }
  603. },
  604. created() {
  605. this.obj.resultList.forEach((item) => {
  606. this.obj['deliveryDate'] =
  607. this.obj.deliveryDate || item.expectReceiveDate;
  608. });
  609. this.form = copyObj(this.obj);
  610. console.log(this.obj);
  611. this.radio1 = this.radio;
  612. this.getSpanArr();
  613. this.setDeliveryDays();
  614. this.setIsInquiry();
  615. },
  616. methods: {
  617. //计算交期
  618. setDeliveryDays() {
  619. this.form.resultList.forEach((item) => {
  620. let day =
  621. this.form.deliveryDate &&
  622. (new Date(this.form.deliveryDate).getTime() -
  623. new Date().getTime()) /
  624. 1000 /
  625. 60 /
  626. 60 /
  627. 24;
  628. item.deliveryDays = Math.ceil(day) || 1;
  629. });
  630. this.$forceUpdate();
  631. },
  632. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  633. if (this.columns[columnIndex]?.isMerge) {
  634. const _row = this.spanArr[rowIndex]?.supplierName || 0;
  635. const _col = _row > 0 ? 1 : 0;
  636. return {
  637. rowspan: _row,
  638. colspan: _col
  639. };
  640. }
  641. return {
  642. rowspan: 1,
  643. colspan: 1
  644. };
  645. },
  646. getSpanArr() {
  647. let pos = 0;
  648. this.spanArr = [];
  649. this.form.resultList.forEach((item, index) => {
  650. // item.guaranteePeriodUnitCode = Number(item.guaranteePeriodUnitCode);
  651. // console.log(item.guaranteePeriodUnitCode,'item.guaranteePeriodUnitCode')
  652. if (index === 0) {
  653. let obj = {};
  654. this.columns.forEach((col) => {
  655. if (col.isMerge) {
  656. obj[col.prop] = 1;
  657. }
  658. });
  659. this.spanArr.push(obj);
  660. } else {
  661. let nameSame =
  662. item.supplierName ===
  663. this.form.resultList[index - 1].supplierName;
  664. if (nameSame) {
  665. this.spanArr[pos].supplierName += 1;
  666. this.spanArr.push({
  667. supplierName: 0,
  668. supplierTotalPrice: 0,
  669. preferentialPrice: 0,
  670. settlementMode: 0,
  671. taxRate: 0,
  672. files: 0,
  673. deliveryDate: 0
  674. });
  675. } else {
  676. pos = index;
  677. let obj = {};
  678. this.columns.forEach((col) => {
  679. if (col.isMerge) {
  680. obj[col.prop] = 1;
  681. }
  682. });
  683. this.spanArr.push(obj);
  684. }
  685. // let totalPriceSame = item.totalPrice === this.form.resultList[index - 1].totalPrice;
  686. // if (totalPriceSame) {
  687. // this.spanArr[pos].totalPrice += 1;
  688. // this.spanArr.push({ totalPrice: 0 });
  689. // } else {
  690. // pos = index;
  691. // this.spanArr.push({ totalPrice: 1 });
  692. // }
  693. }
  694. });
  695. },
  696. setIsInquiry() {
  697. this.$emit('setIsInquiry');
  698. },
  699. deliveryDateChange(row) {
  700. this.$emit('deliveryDateChange', (data) => {
  701. let is = false;
  702. if (data.length > 0) {
  703. data.forEach((item) => {
  704. if (
  705. new Date(this.form.deliveryDate).getTime() >
  706. new Date(item.expectReceiveDate).getTime()
  707. ) {
  708. is = true;
  709. }
  710. });
  711. }
  712. if (is) {
  713. this.$message.error('交货日期大于到货日期');
  714. }
  715. });
  716. this.setDeliveryDays();
  717. },
  718. downloadFile(file) {
  719. getFile({ objectName: file.storePath }, file.name);
  720. },
  721. //
  722. changeGetPrice(row) {
  723. if (row.singlePrice && row.totalCount) {
  724. let num = 0;
  725. this.form.resultList.forEach((item) => {
  726. num += item.totalPrice || 0;
  727. });
  728. this.form.preferentialPrice = parseFloat(num.toFixed(2));
  729. }
  730. },
  731. //计算销售金额
  732. totalPrice(a, b, row) {
  733. if (!a || !b) {
  734. return;
  735. }
  736. row.totalPrice = parseFloat((a * b).toFixed(2));
  737. this.totalPriceAll();
  738. return row.totalPrice;
  739. },
  740. //计算销售总价
  741. totalPriceAll() {
  742. let num = 0;
  743. this.form.resultList.forEach((item) => {
  744. num += item.totalPrice || 0;
  745. });
  746. this.form.totalPrice = parseFloat(num.toFixed(2));
  747. // this.form.preferentialPrice = parseFloat(num.toFixed(2));
  748. // console.log(this.form.resultList,'dasdasd')
  749. },
  750. // 返回列表数据
  751. getTableValue() {
  752. return this.form;
  753. },
  754. chaengMode(data) {
  755. this.form.settlementModeName = data.dictValue;
  756. },
  757. chaengUnitCode(data) {
  758. this.form.settlementModeName = data.dictValue;
  759. },
  760. //修改回显
  761. putTableValue(data) {
  762. this.form.resultList = copyObj(data);
  763. this.setDeliveryDays();
  764. this.setIsInquiry();
  765. },
  766. remove(productCode) {
  767. let index = this.form.resultList.findIndex(
  768. (item) => item.productCode == productCode
  769. );
  770. this.form.resultList.splice(index, 1);
  771. this.setIsInquiry();
  772. this.setSort();
  773. },
  774. removeSupplier() {
  775. this.$emit('removeSupplier', this.form.supplierId);
  776. },
  777. // 清空表格
  778. restTable() {
  779. this.form.resultList = [];
  780. },
  781. // 重新排序
  782. setSort() {
  783. this.form.resultList.forEach((n, index) => {
  784. n.key = index + 1;
  785. });
  786. },
  787. validateForm(callback) {
  788. //开始表单校验
  789. this.$refs.form.validate((valid) => {
  790. callback(valid);
  791. });
  792. }
  793. }
  794. };
  795. </script>
  796. <style lang="scss" scoped>
  797. .headbox {
  798. display: flex;
  799. justify-content: space-between;
  800. align-items: center;
  801. .amount {
  802. font-size: 14px;
  803. font-weight: bold;
  804. }
  805. }
  806. .time-form .el-form-item {
  807. margin-bottom: 0 !important;
  808. }
  809. ::v-deep .period {
  810. display: flex;
  811. .borderleftnone {
  812. .el-input--medium .el-input__inner {
  813. border-top-right-radius: 0;
  814. border-bottom-right-radius: 0;
  815. }
  816. }
  817. .borderrightnone {
  818. .el-input--medium .el-input__inner {
  819. border-top-left-radius: 0;
  820. border-bottom-left-radius: 0;
  821. }
  822. }
  823. }
  824. ::v-deep .time-form tbody > tr:hover > td {
  825. background-color: transparent !important;
  826. }
  827. ::v-deep .time-form .el-table tr {
  828. background-color: #ffffff;
  829. }
  830. ::v-deep .el-upload-list--text {
  831. width: 75%;
  832. }
  833. </style>