detailDialog.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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="130px">
  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 v-model="detailData.repliedFiles" type="view"></fileMain>
  74. <!-- <div-->
  75. <!-- v-if="-->
  76. <!-- detailData.repliedFiles && detailData.repliedFiles?.length-->
  77. <!-- "-->
  78. <!-- >-->
  79. <!-- <el-link-->
  80. <!-- v-for="link in detailData.repliedFiles"-->
  81. <!-- :key="link.id"-->
  82. <!-- type="primary"-->
  83. <!-- :underline="false"-->
  84. <!-- @click="downloadFile(link)"-->
  85. <!-- >-->
  86. <!-- {{ link.name }}</el-link-->
  87. <!-- >-->
  88. <!-- </div>-->
  89. </el-form-item>
  90. <el-form-item label="计价方式:" style="margin-bottom: 22px">
  91. {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="12">
  95. <el-form-item
  96. label="车牌号:"
  97. prop="carNo"
  98. style="margin-bottom: 16px"
  99. >
  100. {{ form.carNo }}
  101. </el-form-item>
  102. <el-form-item
  103. label="发货确认单编码:"
  104. prop="docNo"
  105. style="margin-bottom: 16px"
  106. >
  107. {{ form.docNo }}
  108. </el-form-item>
  109. <el-form-item
  110. label="制单人:"
  111. prop="makerName"
  112. style="margin-bottom: 16px"
  113. >
  114. {{ form.makerName }}
  115. </el-form-item>
  116. <el-form-item prop="orderNo" label="订单编码:">
  117. {{ form.orderNo }}
  118. </el-form-item>
  119. <el-form-item prop="orderNo" label="发货单编码:">
  120. {{ form.sendNo }}
  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 { getSendSaleOrderrecordDetail } from '@/api/bpm/components/saleManage/saleorder';
  238. import { reviewStatusEnum } from '@/enum/dict';
  239. import { copyObj } from '@/utils/util';
  240. import add from '@/views/bpm/outgoingManagement/outbound.vue';
  241. import fileMain from "@/components/addDoc/index.vue";
  242. import {getSendSaleOrderConfirmDetail} from "@/api/bpm/components/saleManage/invoiceConfirm";
  243. export default {
  244. mixins: [dictMixins],
  245. components: {
  246. fileMain,
  247. add
  248. },
  249. data() {
  250. return {
  251. activeComp: 'main',
  252. tabOptions: [{ key: 'main', name: '发货单详情' }],
  253. reviewStatusEnum,
  254. visible: false,
  255. detailId: '',
  256. title: '详情',
  257. row: {},
  258. activeName: 'base',
  259. form: {
  260. orderFiles: []
  261. },
  262. rules: {},
  263. detailData: {},
  264. childrenColumns: [
  265. {
  266. width: 45,
  267. type: 'index',
  268. columnKey: 'index',
  269. align: 'center',
  270. fixed: 'left'
  271. },
  272. {
  273. minWidth: 100,
  274. prop: 'code',
  275. label: '编码',
  276. align: 'center'
  277. },
  278. {
  279. minWidth: 140,
  280. prop: 'barcodes',
  281. label: '发货条码',
  282. align: 'center'
  283. },
  284. {
  285. minWidth: 100,
  286. prop: 'engrave',
  287. label: '刻码',
  288. align: 'center'
  289. }
  290. ],
  291. competAnalysisListcolumns: [
  292. {
  293. width: 45,
  294. type: 'index',
  295. columnKey: 'index',
  296. align: 'center',
  297. fixed: 'left'
  298. },
  299. {
  300. minWidth: 160,
  301. prop: 'productCode',
  302. label: '编码',
  303. showOverflowTooltip: true,
  304. align: 'center'
  305. },
  306. {
  307. minWidth: 120,
  308. prop: 'productName',
  309. label: '名称',
  310. showOverflowTooltip: true,
  311. align: 'center'
  312. },
  313. {
  314. minWidth: 160,
  315. prop: 'batchNo',
  316. label: '批次号',
  317. showOverflowTooltip: true,
  318. slot: 'batchNo',
  319. align: 'center'
  320. },
  321. {
  322. minWidth: 160,
  323. prop: 'barcodes',
  324. label: '发货条码',
  325. showOverflowTooltip: true,
  326. slot: 'barcodes',
  327. align: 'center'
  328. },
  329. {
  330. minWidth: 120,
  331. prop: 'materielDesignation',
  332. label: '物料代号',
  333. showOverflowTooltip: true,
  334. align: 'center'
  335. },
  336. {
  337. minWidth: 120,
  338. prop: 'clientCode',
  339. label: '客户代号',
  340. showOverflowTooltip: true,
  341. align: 'center'
  342. },
  343. {
  344. minWidth: 120,
  345. prop: 'engrave',
  346. label: '刻码',
  347. showOverflowTooltip: true,
  348. align: 'center'
  349. },
  350. {
  351. minWidth: 160,
  352. prop: 'packageNo',
  353. align: 'center',
  354. label: '包装编码',
  355. showOverflowTooltip: true
  356. },
  357. {
  358. minWidth: 100,
  359. prop: 'packingQuantity',
  360. align: 'center',
  361. label: '包装数量',
  362. showOverflowTooltip: true
  363. },
  364. {
  365. minWidth: 120,
  366. prop: 'packingUnit',
  367. align: 'center',
  368. label: '包装单位',
  369. showOverflowTooltip: true
  370. },
  371. {
  372. minWidth: 100,
  373. prop: 'totalCount',
  374. label: '计量数量',
  375. showOverflowTooltip: true,
  376. align: 'center'
  377. },
  378. {
  379. minWidth: 150,
  380. prop: 'measuringUnit',
  381. label: '计量单位',
  382. showOverflowTooltip: true,
  383. align: 'center'
  384. },
  385. {
  386. width: 160,
  387. prop: 'pricingWay',
  388. label: '计价方式',
  389. slot: 'pricingWay',
  390. align: 'center',
  391. formatter: (row, column) => {
  392. return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
  393. }
  394. },
  395. {
  396. width: 100,
  397. prop: 'singlePrice',
  398. label: '单价',
  399. slot: 'singlePrice',
  400. align: 'center'
  401. },
  402. {
  403. width: 100,
  404. prop: 'totalPrice',
  405. label: '合计',
  406. align: 'center'
  407. },
  408. {
  409. minWidth: 80,
  410. prop: 'receiveTotalWeight',
  411. label: '重量',
  412. showOverflowTooltip: true,
  413. align: 'center'
  414. },
  415. {
  416. minWidth: 100,
  417. prop: 'weightUnit',
  418. label: '重量单位',
  419. showOverflowTooltip: true,
  420. align: 'center'
  421. },
  422. {
  423. width: 220,
  424. prop: 'remark',
  425. label: '备注',
  426. slot: 'remark',
  427. align: 'center'
  428. },
  429. ]
  430. };
  431. },
  432. props: {
  433. businessId: {
  434. default: ''
  435. },
  436. taskDefinitionKey: {}
  437. },
  438. async created() {
  439. await this.getDetailData(this.businessId);
  440. console.log('this.taskDefinitionKey--------', this.taskDefinitionKey);
  441. if (this.taskDefinitionKey == 'storemanApprove') {
  442. this.tabOptions.push({ key: 'outBound', name: '出库单' });
  443. this.activeComp = 'outBound';
  444. this.$emit('activeCompChange', 'outBound');
  445. // this.$nextTick(() => {
  446. // this.$refs.add.eomSuccess(this.form);
  447. // });
  448. }
  449. },
  450. methods: {
  451. changeActive(item) {
  452. this.activeComp = item.key;
  453. this.$emit('activeCompChange', item.key);
  454. // if (
  455. // this.taskDefinitionKey == 'storemanApprove' &&
  456. // item.key == 'outBound'
  457. // ) {
  458. // this.$nextTick(() => {
  459. // this.$refs.add.eomSuccess(this.form);
  460. // });
  461. // }
  462. },
  463. save(data) {
  464. this.$refs.add.handleNewSave(data);
  465. },
  466. success() {
  467. this.$emit('handleClose');
  468. },
  469. cancel() {
  470. this.$nextTick(() => {
  471. // 关闭后,销毁所有的表单数据
  472. (this.form = copyObj(this.formDef)),
  473. (this.otherForm = copyObj(this.otherFormDef)),
  474. (this.tableBankData = []);
  475. this.tableLinkData = [];
  476. this.visible = false;
  477. });
  478. },
  479. downloadFile(file) {
  480. getFile({ objectName: file.storePath }, file.name);
  481. },
  482. async getTableValue() {
  483. return {
  484. form: this.form,
  485. returnStorageData:
  486. this.$refs.add && (await this.$refs.add.getReturnStorage())
  487. };
  488. },
  489. async getDetailData(id) {
  490. this.loading = true;
  491. const data = await getSendSaleOrderConfirmDetail(id);
  492. this.loading = false;
  493. if (data) {
  494. data.categoryLevelTopId = data.topCategoryIds;
  495. this.form = data;
  496. this.detailData = data;
  497. }
  498. }
  499. }
  500. };
  501. </script>
  502. <style scoped lang="scss">
  503. .ele-dialog-form {
  504. .el-form-item {
  505. margin-bottom: 10px;
  506. }
  507. }
  508. .headbox {
  509. display: flex;
  510. justify-content: flex-start;
  511. align-items: center;
  512. .amount {
  513. font-size: 14px;
  514. font-weight: bold;
  515. margin-right: 20px;
  516. }
  517. }
  518. </style>