detailDialog.vue 12 KB

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