detailDialog.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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. <div v-if="detailData.sendFiles && detailData.sendFiles?.length">
  56. <el-link
  57. v-for="link in detailData.sendFiles"
  58. :key="link.id"
  59. type="primary"
  60. :underline="false"
  61. @click="downloadFile(link)"
  62. >
  63. {{ link.name }}</el-link
  64. >
  65. </div>
  66. </el-form-item>
  67. <el-form-item
  68. label="回执附件:"
  69. prop="sendFiles"
  70. style="margin-bottom: 16px"
  71. >
  72. <div
  73. v-if="
  74. detailData.repliedFiles && detailData.repliedFiles?.length
  75. "
  76. >
  77. <el-link
  78. v-for="link in detailData.repliedFiles"
  79. :key="link.id"
  80. type="primary"
  81. :underline="false"
  82. @click="downloadFile(link)"
  83. >
  84. {{ link.name }}</el-link
  85. >
  86. </div>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="12">
  90. <el-form-item
  91. label="车牌号:"
  92. prop="carNo"
  93. style="margin-bottom: 16px"
  94. >
  95. {{ form.carNo }}
  96. </el-form-item>
  97. <el-form-item
  98. label="发货单据编码:"
  99. prop="docNo"
  100. style="margin-bottom: 16px"
  101. >
  102. {{ form.docNo }}
  103. </el-form-item>
  104. <el-form-item
  105. label="制单人:"
  106. prop="makerName"
  107. style="margin-bottom: 16px"
  108. >
  109. {{ form.makerName }}
  110. </el-form-item>
  111. <el-form-item prop="orderNo" label="订单编码:">
  112. {{ form.orderNo }}
  113. </el-form-item>
  114. <el-form-item prop="replied" label="是否回执:">
  115. {{ form.replied == 1 ? '是' : '否' }}
  116. </el-form-item>
  117. <el-form-item
  118. label="审核状态:"
  119. prop="reviewStatus"
  120. style="margin-bottom: 16px"
  121. >
  122. {{ reviewStatusEnum[form.reviewStatus]?.label }}
  123. </el-form-item>
  124. </el-col>
  125. </el-row>
  126. </el-form>
  127. <headerTitle title="产品清单"></headerTitle>
  128. <ele-pro-table
  129. ref="table"
  130. :needPage="false"
  131. :columns="competAnalysisListcolumns"
  132. :toolkit="[]"
  133. :datasource="detailData.productList"
  134. row-key="id"
  135. >
  136. <!-- <template v-slot:toolbar>
  137. <div class="headbox">
  138. <span class="amount">总计:{{detailData.totalAmount}}元</span>
  139. <span class="amount">应付金额:{{detailData.payAmount}}元</span>
  140. </div>
  141. </template> -->
  142. <template v-slot:industryArtFiles="{ row, $index }">
  143. <el-form-item
  144. style="margin-bottom: 20px"
  145. :prop="'datasource.' + $index + '.industryArtFiles'"
  146. >
  147. <div v-if="row.industryArtFiles && row.industryArtFiles?.length">
  148. <el-link
  149. v-for="link in row.industryArtFiles"
  150. :key="link.id"
  151. type="primary"
  152. :underline="false"
  153. @click="downloadFile(link)"
  154. >
  155. {{ link.name }}</el-link
  156. >
  157. </div>
  158. </el-form-item>
  159. </template>
  160. <template v-slot:otherFiles="{ row, $index }">
  161. <el-form-item
  162. style="margin-bottom: 20px"
  163. :prop="'datasource.' + $index + '.otherFiles'"
  164. >
  165. <div v-if="row.otherFiles && row.otherFiles?.length">
  166. <el-link
  167. v-for="link in row.otherFiles"
  168. :key="link.id"
  169. type="primary"
  170. :underline="false"
  171. @click="downloadFile(link)"
  172. >
  173. {{ link.name }}</el-link
  174. >
  175. </div>
  176. </el-form-item>
  177. </template>
  178. <template v-slot:technicalDrawings="{ row }">
  179. <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
  180. <el-link
  181. v-for="link in row.technicalDrawings"
  182. :key="link.id"
  183. type="primary"
  184. :underline="false"
  185. @click="downloadFile(link)"
  186. >
  187. {{ link.name }}</el-link
  188. >
  189. </div>
  190. </template>
  191. </ele-pro-table>
  192. </div>
  193. <add
  194. ref="add"
  195. v-if="activeComp == 'outBound'"
  196. type="sourceBizNo"
  197. @success="success"
  198. ></add>
  199. </div>
  200. </template>
  201. <script>
  202. import { getFile } from '@/api/system/file';
  203. import dictMixins from '@/mixins/dictMixins';
  204. import { getSendSaleOrderrecordDetail } from '@/api/bpm/components/saleManage/saleorder';
  205. import { reviewStatusEnum } from '@/enum/dict';
  206. import { copyObj } from '@/utils/util';
  207. import add from '@/views/bpm/outgoingManagement/add.vue';
  208. export default {
  209. mixins: [dictMixins],
  210. components: {
  211. add
  212. },
  213. data() {
  214. return {
  215. activeComp: 'main',
  216. tabOptions: [{ key: 'main', name: '发货单详情' }],
  217. reviewStatusEnum,
  218. visible: false,
  219. detailId: '',
  220. title: '详情',
  221. row: {},
  222. activeName: 'base',
  223. form: {
  224. orderFiles: [{ name: '222' }]
  225. },
  226. rules: {},
  227. detailData: {},
  228. competAnalysisListcolumns: [
  229. {
  230. width: 45,
  231. type: 'index',
  232. columnKey: 'index',
  233. align: 'center',
  234. fixed: 'left'
  235. },
  236. {
  237. width: 200,
  238. prop: 'productName',
  239. label: '名称',
  240. slot: 'productName'
  241. },
  242. {
  243. width: 120,
  244. prop: 'productCode',
  245. label: '编码',
  246. slot: 'productCode'
  247. },
  248. {
  249. width: 200,
  250. prop: 'productCategoryName',
  251. label: '类型',
  252. slot: 'productCategoryName'
  253. },
  254. {
  255. width: 160,
  256. prop: 'productBrand',
  257. label: '牌号',
  258. slot: 'productBrand'
  259. },
  260. {
  261. width: 120,
  262. prop: 'modelType',
  263. label: '型号',
  264. slot: 'modelType'
  265. },
  266. {
  267. width: 120,
  268. prop: 'specification',
  269. label: '规格',
  270. slot: 'specification'
  271. },
  272. {
  273. width: 200,
  274. prop: 'warehouseName',
  275. label: '仓库名称',
  276. slot: 'warehouseName'
  277. },
  278. {
  279. width: 120,
  280. prop: 'totalCount',
  281. label: '数量',
  282. slot: 'totalCount'
  283. },
  284. {
  285. width: 120,
  286. prop: 'measuringUnit',
  287. label: '计量单位',
  288. slot: 'measuringUnit'
  289. },
  290. {
  291. width: 160,
  292. prop: 'singlePrice',
  293. label: '单价',
  294. slot: 'singlePrice'
  295. },
  296. {
  297. width: 120,
  298. prop: 'totalPrice',
  299. label: '销售总金额',
  300. slot: 'totalPrice',
  301. formatter: (_row, _column, cellValue) => {
  302. return _row.totalPrice + '元';
  303. }
  304. },
  305. {
  306. width: 120,
  307. prop: 'deliveryDays',
  308. label: '交期(天)',
  309. slot: 'deliveryDays'
  310. },
  311. {
  312. width: 200,
  313. prop: 'guaranteePeriod',
  314. label: '质保期',
  315. slot: 'guaranteePeriod',
  316. formatter: (_row, _column, cellValue) => {
  317. return (_row.guaranteePeriod||'') + _row.guaranteePeriodUnitName;
  318. }
  319. },
  320. // {
  321. // width: 120,
  322. // prop: 'guaranteePeriodUnitCode',
  323. // label: '',
  324. // slot: 'guaranteePeriodUnitCode'
  325. // },
  326. {
  327. width: 120,
  328. prop: 'technicalAnswerName',
  329. label: '技术答疑人',
  330. slot: 'technicalAnswerName'
  331. },
  332. {
  333. width: 220,
  334. prop: 'technicalParams',
  335. label: '技术参数',
  336. slot: 'technicalParams'
  337. },
  338. {
  339. width: 240,
  340. prop: 'technicalDrawings',
  341. label: '技术图纸',
  342. slot: 'technicalDrawings',
  343. formatter: (_row, _column, cellValue) => {
  344. return (_row.guaranteePeriod||'') + _row.guaranteePeriodUnitName;
  345. }
  346. },
  347. {
  348. width: 220,
  349. prop: 'remark',
  350. label: '备注',
  351. slot: 'remark'
  352. }
  353. ]
  354. };
  355. },
  356. props: {
  357. businessId: {
  358. default: ''
  359. },
  360. taskDefinitionKey: {}
  361. },
  362. async created() {
  363. await this.getDetailData(this.businessId);
  364. if (this.taskDefinitionKey == 'storemanApprove') {
  365. this.tabOptions.push({ key: 'outBound', name: '出库单' });
  366. this.activeComp = 'outBound';
  367. this.$emit('activeCompChange','outBound');
  368. this.$nextTick(() => {
  369. this.$refs.add.eomSuccess(this.form);
  370. });
  371. }
  372. },
  373. methods: {
  374. changeActive(item) {
  375. this.activeComp = item.key;
  376. this.$emit('activeCompChange', item.key);
  377. if (
  378. this.taskDefinitionKey == 'storemanApprove' &&
  379. item.key == 'outBound'
  380. ) {
  381. this.$nextTick(() => {
  382. this.$refs.add.eomSuccess(this.form);
  383. });
  384. }
  385. },
  386. save() {
  387. this.$refs.add.handleNewSave();
  388. },
  389. success() {
  390. this.$emit('handleClose');
  391. },
  392. cancel() {
  393. this.$nextTick(() => {
  394. // 关闭后,销毁所有的表单数据
  395. (this.form = copyObj(this.formDef)),
  396. (this.otherForm = copyObj(this.otherFormDef)),
  397. (this.tableBankData = []);
  398. this.tableLinkData = [];
  399. this.visible = false;
  400. });
  401. },
  402. downloadFile(file) {
  403. getFile({ objectName: file.storePath }, file.name);
  404. },
  405. getTableValue() {
  406. return this.form;
  407. },
  408. async getDetailData(id) {
  409. this.loading = true;
  410. const data = await getSendSaleOrderrecordDetail(id);
  411. this.loading = false;
  412. if (data) {
  413. this.form = data;
  414. this.detailData = data;
  415. }
  416. }
  417. }
  418. };
  419. </script>
  420. <style scoped lang="scss">
  421. .ele-dialog-form {
  422. .el-form-item {
  423. margin-bottom: 10px;
  424. }
  425. }
  426. .headbox {
  427. display: flex;
  428. justify-content: flex-start;
  429. align-items: center;
  430. .amount {
  431. font-size: 14px;
  432. font-weight: bold;
  433. margin-right: 20px;
  434. }
  435. }
  436. </style>