detailDialog.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. <template>
  2. <div>
  3. <div class="switch">
  4. <div class="switch_left">
  5. <ul>
  6. <li
  7. v-for="item in tabOptions"
  8. :key="item.key"
  9. :class="{ active: activeComp == item.key }"
  10. @click="changeActive(item)"
  11. >
  12. {{ item.name }}
  13. </li>
  14. </ul>
  15. </div>
  16. </div>
  17. <div v-show="activeComp == 'main'">
  18. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  19. <headerTitle title="发货信息"></headerTitle>
  20. <el-row>
  21. <el-col :span="12">
  22. <el-form-item
  23. label="客户名称:"
  24. prop="contactName"
  25. style="margin-bottom: 16px"
  26. >
  27. {{ form.contactName }}
  28. </el-form-item>
  29. <el-form-item
  30. label="客户联系人:"
  31. prop="linkName"
  32. style="margin-bottom: 16px"
  33. >
  34. {{ form.linkName }}
  35. </el-form-item>
  36. <el-form-item
  37. label="客户电话:"
  38. prop="linkPhone"
  39. style="margin-bottom: 16px"
  40. >
  41. {{ form.linkPhone }}
  42. </el-form-item>
  43. <el-form-item
  44. label="客户地址:"
  45. prop="partaAddress"
  46. style="margin-bottom: 16px"
  47. >
  48. {{ form.receiveAddress }}
  49. </el-form-item>
  50. <el-form-item
  51. label="发货附件:"
  52. prop="sendFiles"
  53. style="margin-bottom: 16px"
  54. >
  55. <fileMain v-model="detailData.sendFiles" type="view"></fileMain>
  56. <!-- <div v-if="detailData.sendFiles && detailData.sendFiles?.length">-->
  57. <!-- <el-link-->
  58. <!-- v-for="link in detailData.sendFiles"-->
  59. <!-- :key="link.id"-->
  60. <!-- type="primary"-->
  61. <!-- :underline="false"-->
  62. <!-- @click="downloadFile(link)"-->
  63. <!-- >-->
  64. <!-- {{ link.name }}</el-link-->
  65. <!-- >-->
  66. <!-- </div>-->
  67. </el-form-item>
  68. <el-form-item
  69. label="回执附件:"
  70. prop="sendFiles"
  71. style="margin-bottom: 16px"
  72. >
  73. <fileMain
  74. v-model="detailData.repliedFiles"
  75. type="view"
  76. ></fileMain>
  77. <!-- <div-->
  78. <!-- v-if="-->
  79. <!-- detailData.repliedFiles && detailData.repliedFiles?.length-->
  80. <!-- "-->
  81. <!-- >-->
  82. <!-- <el-link-->
  83. <!-- v-for="link in detailData.repliedFiles"-->
  84. <!-- :key="link.id"-->
  85. <!-- type="primary"-->
  86. <!-- :underline="false"-->
  87. <!-- @click="downloadFile(link)"-->
  88. <!-- >-->
  89. <!-- {{ link.name }}</el-link-->
  90. <!-- >-->
  91. <!-- </div>-->
  92. </el-form-item>
  93. <el-form-item label="计价方式:" style="margin-bottom: 22px">
  94. {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="12">
  98. <el-form-item
  99. label="车牌号:"
  100. prop="carNo"
  101. style="margin-bottom: 16px"
  102. >
  103. {{ form.carNo }}
  104. </el-form-item>
  105. <el-form-item
  106. label="发货单据编码:"
  107. prop="docNo"
  108. style="margin-bottom: 16px"
  109. >
  110. {{ form.docNo }}
  111. </el-form-item>
  112. <el-form-item
  113. label="制单人:"
  114. prop="makerName"
  115. style="margin-bottom: 16px"
  116. >
  117. {{ form.makerName }}
  118. </el-form-item>
  119. <el-form-item prop="orderNo" label="订单编码:">
  120. {{ form.orderNo }}
  121. </el-form-item>
  122. <el-form-item prop="replied" label="是否回执:">
  123. {{ form.replied == 1 ? '是' : '否' }}
  124. </el-form-item>
  125. <el-form-item
  126. label="审核状态:"
  127. prop="reviewStatus"
  128. style="margin-bottom: 16px"
  129. >
  130. {{ reviewStatusEnum[form.reviewStatus]?.label }}
  131. </el-form-item>
  132. </el-col>
  133. </el-row>
  134. </el-form>
  135. <headerTitle title="物品清单"></headerTitle>
  136. <ele-pro-table
  137. ref="table"
  138. :needPage="false"
  139. :columns="competAnalysisListcolumns"
  140. :toolkit="[]"
  141. :datasource="detailData.productList"
  142. row-key="id"
  143. >
  144. <!-- <template v-slot:toolbar>
  145. <div class="headbox">
  146. <span class="amount">总计:{{detailData.totalAmount}}元</span>
  147. <span class="amount">应付金额:{{detailData.payAmount}}元</span>
  148. </div>
  149. </template> -->
  150. <template v-slot:stockLedger="scope">
  151. <el-popover placement="right" width="60%" trigger="hover">
  152. <ele-pro-table
  153. :ref="'childrenTable' + scope.$index"
  154. row-key="id"
  155. max-height="300px"
  156. :needPage="false"
  157. :columns="childrenColumns"
  158. :toolkit="[]"
  159. :datasource="scope.row.sendProductDetail"
  160. cache-key="stockLedgerRoleTable"
  161. class="time-form"
  162. >
  163. </ele-pro-table>
  164. <el-button type="text" slot="reference">明细</el-button>
  165. </el-popover>
  166. </template>
  167. <template v-slot:industryArtFiles="{ row, $index }">
  168. <el-form-item
  169. style="margin-bottom: 20px"
  170. :prop="'datasource.' + $index + '.industryArtFiles'"
  171. >
  172. <fileMain v-model="row.industryArtFiles" type="view"></fileMain>
  173. <!-- <div v-if="row.industryArtFiles && row.industryArtFiles?.length">-->
  174. <!-- <el-link-->
  175. <!-- v-for="link in row.industryArtFiles"-->
  176. <!-- :key="link.id"-->
  177. <!-- type="primary"-->
  178. <!-- :underline="false"-->
  179. <!-- @click="downloadFile(link)"-->
  180. <!-- >-->
  181. <!-- {{ link.name }}</el-link-->
  182. <!-- >-->
  183. <!-- </div>-->
  184. </el-form-item>
  185. </template>
  186. <template v-slot:otherFiles="{ row, $index }">
  187. <el-form-item
  188. style="margin-bottom: 20px"
  189. :prop="'datasource.' + $index + '.otherFiles'"
  190. >
  191. <fileMain v-model="row.otherFiles" type="view"></fileMain>
  192. <!-- <div v-if="row.otherFiles && row.otherFiles?.length">-->
  193. <!-- <el-link-->
  194. <!-- v-for="link in row.otherFiles"-->
  195. <!-- :key="link.id"-->
  196. <!-- type="primary"-->
  197. <!-- :underline="false"-->
  198. <!-- @click="downloadFile(link)"-->
  199. <!-- >-->
  200. <!-- {{ link.name }}</el-link-->
  201. <!-- >-->
  202. <!-- </div>-->
  203. </el-form-item>
  204. </template>
  205. <template v-slot:technicalDrawings="{ row }">
  206. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  207. <!-- <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
  208. <!-- <el-link-->
  209. <!-- v-for="link in row.technicalDrawings"-->
  210. <!-- :key="link.id"-->
  211. <!-- type="primary"-->
  212. <!-- :underline="false"-->
  213. <!-- @click="downloadFile(link)"-->
  214. <!-- >-->
  215. <!-- {{ link.name }}</el-link-->
  216. <!-- >-->
  217. <!-- </div>-->
  218. </template>
  219. </ele-pro-table>
  220. </div>
  221. <keep-alive>
  222. <add
  223. ref="add"
  224. v-if="activeComp == 'outBound'"
  225. :form="form"
  226. :sourceBizNo="form.docNo"
  227. :bizType="3"
  228. :saleProductList="form.productList"
  229. type="销售发货出库"
  230. ></add>
  231. </keep-alive>
  232. </div>
  233. </template>
  234. <script>
  235. import { getFile } from '@/api/system/file';
  236. import dictMixins from '@/mixins/dictMixins';
  237. import {
  238. getSendSaleOrderrecordDetail,
  239. getByIdOnlyReplace
  240. } from '@/api/bpm/components/saleManage/saleorder';
  241. import { reviewStatusEnum } from '@/enum/dict';
  242. import { copyObj } from '@/utils/util';
  243. import add from '@/views/bpm/outgoingManagement/outbound.vue';
  244. import fileMain from '@/components/addDoc/index.vue';
  245. export default {
  246. mixins: [dictMixins],
  247. components: {
  248. fileMain,
  249. add
  250. },
  251. data() {
  252. return {
  253. activeComp: 'main',
  254. tabOptions: [{ key: 'main', name: '发货单详情' }],
  255. reviewStatusEnum,
  256. visible: false,
  257. detailId: '',
  258. title: '详情',
  259. row: {},
  260. activeName: 'base',
  261. form: {
  262. orderFiles: []
  263. },
  264. rules: {},
  265. detailData: {},
  266. childrenColumns: [
  267. {
  268. width: 45,
  269. type: 'index',
  270. columnKey: 'index',
  271. align: 'center',
  272. fixed: 'left'
  273. },
  274. {
  275. minWidth: 100,
  276. prop: 'code',
  277. label: '编码',
  278. align: 'center'
  279. },
  280. {
  281. minWidth: 140,
  282. prop: 'barcodes',
  283. label: '发货条码',
  284. align: 'center'
  285. },
  286. {
  287. minWidth: 100,
  288. prop: 'engrave',
  289. label: '刻码',
  290. align: 'center'
  291. }
  292. ],
  293. competAnalysisListcolumns: [
  294. {
  295. width: 45,
  296. type: 'index',
  297. columnKey: 'index',
  298. align: 'center',
  299. fixed: 'left'
  300. },
  301. {
  302. width: 200,
  303. prop: 'productName',
  304. label: '名称',
  305. slot: 'productName',
  306. align: 'center'
  307. },
  308. {
  309. width: 120,
  310. prop: 'productCode',
  311. label: '编码',
  312. slot: 'productCode',
  313. align: 'center'
  314. },
  315. {
  316. width: 200,
  317. prop: 'productCategoryName',
  318. label: '类型',
  319. slot: 'productCategoryName',
  320. align: 'center'
  321. },
  322. {
  323. width: 160,
  324. prop: 'productBrand',
  325. label: '牌号',
  326. slot: 'productBrand',
  327. align: 'center'
  328. },
  329. {
  330. width: 120,
  331. prop: 'modelType',
  332. label: '型号',
  333. slot: 'modelType',
  334. align: 'center'
  335. },
  336. {
  337. width: 120,
  338. prop: 'specification',
  339. label: '规格',
  340. slot: 'specification',
  341. align: 'center'
  342. },
  343. {
  344. width: 200,
  345. prop: 'customerMark',
  346. label: '客户代号',
  347. slot: 'customerMark',
  348. align: 'center'
  349. },
  350. {
  351. width: 200,
  352. prop: 'warehouseName',
  353. label: '仓库名称',
  354. slot: 'warehouseName',
  355. align: 'center'
  356. },
  357. {
  358. width: 100,
  359. prop: 'stockLedger',
  360. label: '发货明细',
  361. slot: 'stockLedger',
  362. align: 'center'
  363. },
  364. {
  365. width: 120,
  366. prop: 'totalCount',
  367. label: '数量',
  368. slot: 'totalCount',
  369. align: 'center'
  370. },
  371. {
  372. width: 120,
  373. prop: 'measuringUnit',
  374. label: '计量单位',
  375. slot: 'measuringUnit',
  376. align: 'center'
  377. },
  378. {
  379. width: 120,
  380. prop: 'singleWeight',
  381. label: '单重',
  382. slot: 'singleWeight',
  383. align: 'center'
  384. },
  385. {
  386. width: 100,
  387. prop: 'receiveTotalWeight',
  388. label: '收货总重',
  389. slot: 'receiveTotalWeight',
  390. align: 'center'
  391. },
  392. {
  393. width: 200,
  394. prop: 'sendTotalWeight',
  395. label: '发货总重',
  396. slot: 'sendTotalWeight',
  397. align: 'center',
  398. headerSlot: 'headerTotalCount'
  399. },
  400. {
  401. width: 100,
  402. prop: 'increaseTotalWeight',
  403. label: '增重重量',
  404. slot: 'increaseTotalWeight',
  405. align: 'center'
  406. },
  407. {
  408. width: 100,
  409. prop: 'weightUnit',
  410. label: '重量单位',
  411. slot: 'weightUnit',
  412. align: 'center'
  413. },
  414. {
  415. width: 160,
  416. prop: 'pricingWay',
  417. label: '计价方式',
  418. slot: 'pricingWay',
  419. align: 'center',
  420. formatter: (row, column) => {
  421. return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
  422. }
  423. },
  424. {
  425. width: 160,
  426. prop: 'singlePrice',
  427. label: '单价',
  428. slot: 'singlePrice',
  429. align: 'center'
  430. },
  431. {
  432. width: 120,
  433. prop: 'totalPrice',
  434. label: '销售总金额',
  435. slot: 'totalPrice',
  436. formatter: (_row, _column, cellValue) => {
  437. return _row.totalPrice ? _row.totalPrice + '元' : '';
  438. },
  439. align: 'center'
  440. },
  441. {
  442. width: 120,
  443. prop: 'deliveryDays',
  444. label: '交期(天)',
  445. slot: 'deliveryDays',
  446. align: 'center'
  447. },
  448. {
  449. width: 200,
  450. prop: 'guaranteePeriod',
  451. label: '质保期',
  452. slot: 'guaranteePeriod',
  453. formatter: (_row, _column, cellValue) => {
  454. return (
  455. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  456. );
  457. },
  458. align: 'center'
  459. },
  460. // {
  461. // width: 120,
  462. // prop: 'guaranteePeriodUnitCode',
  463. // label: '',
  464. // slot: 'guaranteePeriodUnitCode'
  465. // },
  466. {
  467. width: 120,
  468. prop: 'technicalAnswerName',
  469. label: '技术答疑人',
  470. slot: 'technicalAnswerName',
  471. align: 'center'
  472. },
  473. {
  474. width: 220,
  475. prop: 'technicalParams',
  476. label: '技术参数',
  477. slot: 'technicalParams',
  478. align: 'center'
  479. },
  480. {
  481. width: 240,
  482. prop: 'technicalDrawings',
  483. label: '技术图纸',
  484. slot: 'technicalDrawings',
  485. align: 'center'
  486. },
  487. {
  488. width: 220,
  489. prop: 'remark',
  490. label: '备注',
  491. slot: 'remark',
  492. align: 'center'
  493. }
  494. ]
  495. };
  496. },
  497. props: {
  498. businessId: {
  499. default: ''
  500. },
  501. taskDefinitionKey: {}
  502. },
  503. async created() {
  504. await this.getDetailData(this.businessId);
  505. console.log('this.taskDefinitionKey--------', this.taskDefinitionKey);
  506. if (this.taskDefinitionKey == 'storemanApprove') {
  507. this.tabOptions.push({ key: 'outBound', name: '出库单' });
  508. this.activeComp = 'outBound';
  509. this.$emit('activeCompChange', 'outBound');
  510. // this.$nextTick(() => {
  511. // this.$refs.add.eomSuccess(this.form);
  512. // });
  513. }
  514. },
  515. methods: {
  516. changeActive(item) {
  517. this.activeComp = item.key;
  518. this.$emit('activeCompChange', item.key);
  519. // if (
  520. // this.taskDefinitionKey == 'storemanApprove' &&
  521. // item.key == 'outBound'
  522. // ) {
  523. // this.$nextTick(() => {
  524. // this.$refs.add.eomSuccess(this.form);
  525. // });
  526. // }
  527. },
  528. save(data) {
  529. this.$refs.add.handleNewSave(data);
  530. },
  531. success() {
  532. this.$emit('handleClose');
  533. },
  534. cancel() {
  535. this.$nextTick(() => {
  536. // 关闭后,销毁所有的表单数据
  537. (this.form = copyObj(this.formDef)),
  538. (this.otherForm = copyObj(this.otherFormDef)),
  539. (this.tableBankData = []);
  540. this.tableLinkData = [];
  541. this.visible = false;
  542. });
  543. },
  544. downloadFile(file) {
  545. getFile({ objectName: file.storePath }, file.name);
  546. },
  547. async getTableValue() {
  548. return {
  549. form: this.form,
  550. returnStorageData:
  551. this.$refs.add && (await this.$refs.add.getReturnStorage())
  552. };
  553. },
  554. async getDetailData(id) {
  555. this.loading = true;
  556. const data = await getByIdOnlyReplace(id);
  557. this.loading = false;
  558. if (data) {
  559. data.categoryLevelTopId = data.topCategoryIds;
  560. this.form = data;
  561. this.detailData = data;
  562. }
  563. }
  564. }
  565. };
  566. </script>
  567. <style scoped lang="scss">
  568. .ele-dialog-form {
  569. .el-form-item {
  570. margin-bottom: 10px;
  571. }
  572. }
  573. .headbox {
  574. display: flex;
  575. justify-content: flex-start;
  576. align-items: center;
  577. .amount {
  578. font-size: 14px;
  579. font-weight: bold;
  580. margin-right: 20px;
  581. }
  582. }
  583. </style>