detailDialog.vue 12 KB

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