detailDialog.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. :visible.sync="detailDialogFlag"
  6. :title="title"
  7. :append-to-body="true"
  8. :close-on-click-modal="false"
  9. width="70%"
  10. @close="cancel"
  11. :maxable="true"
  12. :resizable="true"
  13. >
  14. <div class="switch">
  15. <div class="switch_left">
  16. <ul>
  17. <li
  18. v-for="item in tabOptions"
  19. :key="item.key"
  20. :class="{ active: activeComp == item.key }"
  21. @click="handleTag(item.key)"
  22. >
  23. {{ item.name }}
  24. </li>
  25. </ul>
  26. </div>
  27. </div>
  28. <div v-if="activeComp === 'main'">
  29. <el-form
  30. ref="form"
  31. :model="form"
  32. class="el-form-box"
  33. :rules="rules"
  34. label-width="120px"
  35. >
  36. <headerTitle title="收货信息"></headerTitle>
  37. <el-row :gutter="12">
  38. <el-col :span="12">
  39. <el-form-item label="选择订单:" prop="orderNo">
  40. <el-input v-model="form.orderNo" disabled></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="12">
  44. <el-form-item label="客户名称:" prop="contactName">
  45. <el-input v-model="form.contactName" disabled></el-input>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="12">
  49. <el-form-item label="客户联系人:" prop="linkName">
  50. <el-input v-model="form.linkName" disabled></el-input>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="12">
  54. <el-form-item label="车辆号:" prop="carNo">
  55. <el-input v-model="form.carNo" disabled></el-input>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="12">
  59. <el-form-item label="客户电话:" prop="linkPhone">
  60. <el-input v-model="form.linkPhone" disabled></el-input>
  61. </el-form-item>
  62. </el-col>
  63. </el-row>
  64. <el-row :gutter="12">
  65. <el-col :span="12">
  66. <el-form-item label="收货日期:" prop="receiveDate">
  67. <el-input v-model="form.receiveDate" disabled></el-input>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="12">
  71. <el-form-item label="收货单号:" prop="sendNoteNo">
  72. <el-input v-model="form.sendNoteNo" disabled></el-input>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="12">
  76. <el-form-item prop="files" label="附件:">
  77. <fileMain v-model="row.files" type="view"></fileMain>
  78. </el-form-item>
  79. </el-col>
  80. </el-row>
  81. </el-form>
  82. <headerTitle title="物品清单"></headerTitle>
  83. <ele-pro-table
  84. ref="table"
  85. :needPage="false"
  86. :columns="columns"
  87. @columns-change="handleColumnChange"
  88. :cache-key="cacheKeyUrl"
  89. :datasource="detailData.productList"
  90. row-key="id"
  91. :maxHeight="350"
  92. >
  93. <template v-slot:technicalDrawings="{ row }">
  94. <fileMain v-model="row.files" type="view"></fileMain>
  95. </template>
  96. </ele-pro-table>
  97. </div>
  98. <bpmDetail
  99. v-if="activeComp === 'bpm' && form.processInstanceId"
  100. :id="form.processInstanceId"
  101. ></bpmDetail>
  102. <inner-bound-details
  103. v-if="activeComp === 'store'"
  104. ref="outBoundDetailsRef"
  105. ></inner-bound-details>
  106. <div slot="footer" class="footer">
  107. <el-button @click="cancel">返回</el-button>
  108. </div>
  109. </ele-modal>
  110. </template>
  111. <script>
  112. import { getFile } from '@/api/system/file';
  113. import dictMixins from '@/mixins/dictMixins';
  114. import { reviewStatusEnum } from '@/enum/dict';
  115. import { copyObj } from '@/utils/util';
  116. import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
  117. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  118. import fileUpload from '@/components/upload/fileUpload.vue';
  119. import innerBoundDetails from '@/BIZComponents/innerdetails.vue';
  120. // import fileMain from '@/components/addDoc/index.vue';
  121. import tabMixins from '@/mixins/tableColumnsMixin';
  122. export default {
  123. mixins: [dictMixins, tabMixins],
  124. components: {
  125. // fileMain,
  126. fileUpload,
  127. bpmDetail,
  128. innerBoundDetails
  129. },
  130. props: {
  131. detailDialogFlag: Boolean
  132. },
  133. data() {
  134. return {
  135. cacheKeyUrl: 'eos-saleManage-entrustedReceive-inventoryTableDetail',
  136. activeComp: 'main',
  137. tabOptions: [
  138. { key: 'main', name: '收货单详情' },
  139. { key: 'bpm', name: '流程详情' },
  140. { key: 'store', name: '入库单详情' }
  141. ],
  142. reviewStatusEnum,
  143. detailId: '',
  144. title: '详情',
  145. row: {},
  146. activeName: 'base',
  147. form: {
  148. orderFiles: [{ name: '222' }]
  149. },
  150. rules: {},
  151. detailData: {},
  152. columns: [
  153. {
  154. width: 45,
  155. type: 'index',
  156. columnKey: 'index',
  157. align: 'center',
  158. fixed: 'left'
  159. },
  160. {
  161. minWidth: 140,
  162. prop: 'productName',
  163. label: '名称',
  164. slot: 'productName',
  165. align: 'center'
  166. },
  167. {
  168. minWidth: 120,
  169. prop: 'productCode',
  170. label: '编码',
  171. slot: 'productCode',
  172. align: 'center'
  173. },
  174. // {
  175. // minWidth: 100,
  176. // prop: 'productCategoryName',
  177. // label: '类型',
  178. // slot: 'productCategoryName',
  179. // align: 'center'
  180. // },
  181. {
  182. width: 160,
  183. prop: 'productBrand',
  184. label: '牌号',
  185. slot: 'productBrand',
  186. align: 'center'
  187. },
  188. {
  189. width: 120,
  190. prop: 'modelType',
  191. label: '型号',
  192. slot: 'modelType',
  193. align: 'center'
  194. },
  195. {
  196. width: 120,
  197. prop: 'specification',
  198. label: '规格',
  199. slot: 'specification',
  200. align: 'center'
  201. },
  202. {
  203. minWidth: 120,
  204. prop: 'modelKey',
  205. label: '机型',
  206. showOverflowTooltip: true,
  207. align: 'center',
  208. },
  209. {
  210. minWidth: 120,
  211. prop: 'colorKey',
  212. showOverflowTooltip: true,
  213. label: '颜色',
  214. align: 'center',
  215. },
  216. {
  217. width: 200,
  218. prop: 'customerMark',
  219. label: '客户代号',
  220. slot: 'customerMark',
  221. align: 'center'
  222. },
  223. {
  224. width: 200,
  225. prop: 'warehouseName',
  226. label: '仓库名称',
  227. slot: 'warehouseName',
  228. align: 'center'
  229. },
  230. // {
  231. // width: 110,
  232. // prop: 'orderTotalCount',
  233. // label: '订单总数量',
  234. // slot: 'orderTotalCount',
  235. // align: 'center'
  236. // },
  237. // {
  238. // width: 120,
  239. // prop: 'totalCount',
  240. // label: '本次收货数量',
  241. // slot: 'totalCount',
  242. // headerSlot: 'headerTotalCount',
  243. // align: 'center'
  244. // },
  245. // {
  246. // width: 100,
  247. // prop: 'receiveTotalCount',
  248. // label: '已收货总数',
  249. // slot: 'receiveTotalCount',
  250. // align: 'center'
  251. // },
  252. {
  253. width: 120,
  254. prop: 'measuringUnit',
  255. label: '计量单位',
  256. slot: 'measuringUnit',
  257. align: 'center'
  258. },
  259. {
  260. width: 120,
  261. prop: 'singleWeight',
  262. label: '单重',
  263. slot: 'singleWeight',
  264. align: 'center'
  265. },
  266. {
  267. width: 100,
  268. prop: 'receiveTotalWeight',
  269. label: '收货总重',
  270. slot: 'receiveTotalWeight',
  271. align: 'center'
  272. },
  273. {
  274. width: 100,
  275. prop: 'weightUnit',
  276. label: '重量单位',
  277. slot: 'weightUnit',
  278. align: 'center'
  279. },
  280. // {
  281. // width: 160,
  282. // prop: 'pricingWay',
  283. // label: '计价方式',
  284. // slot: 'pricingWay',
  285. // align: 'center',
  286. // formatter: (row, column) => {
  287. // return row.pricingWay == 1
  288. // ? '按数量计费'
  289. // : row.pricingWay == 2
  290. // ? '按重量计费'
  291. // : '';
  292. // }
  293. // },
  294. {
  295. width: 160,
  296. prop: 'singlePrice',
  297. label: '单价',
  298. slot: 'singlePrice',
  299. align: 'center'
  300. },
  301. {
  302. width: 100,
  303. prop: 'taxRate',
  304. label: '税率',
  305. formatter: (_row, _column, cellValue) => {
  306. return _row.taxRate ? _row.taxRate + '%' : '';
  307. },
  308. align: 'center'
  309. },
  310. {
  311. width: 100,
  312. prop: 'discountSinglePrice',
  313. label: '折让单价',
  314. slot: 'discountSinglePrice',
  315. align: 'center',
  316. formatter: (_row, _column, cellValue) => {
  317. return _row.discountSinglePrice
  318. ? Number(_row.discountSinglePrice).toFixed(2)
  319. : '';
  320. }
  321. },
  322. {
  323. width: 120,
  324. prop: 'totalPrice',
  325. label: '合计',
  326. slot: 'totalPrice',
  327. formatter: (_row, _column, cellValue) => {
  328. return _row.totalPrice + '元';
  329. },
  330. align: 'center'
  331. },
  332. {
  333. width: 100,
  334. prop: 'discountTotalPrice',
  335. label: '折让合计',
  336. slot: 'discountTotalPrice',
  337. align: 'center',
  338. formatter: (_row, _column, cellValue) => {
  339. return _row.discountTotalPrice
  340. ? Number(_row.discountTotalPrice).toFixed(2)
  341. : '';
  342. }
  343. },
  344. // {
  345. // width: 120,
  346. // prop: 'deliveryDays',
  347. // label: '交期(天)',
  348. // slot: 'deliveryDays',
  349. // align: 'center'
  350. // },
  351. {
  352. width: 200,
  353. prop: 'guaranteePeriod',
  354. label: '有效期',
  355. slot: 'guaranteePeriod',
  356. formatter: (_row, _column, cellValue) => {
  357. return (
  358. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  359. );
  360. },
  361. align: 'center'
  362. },
  363. // {
  364. // width: 120,
  365. // prop: 'guaranteePeriodUnitCode',
  366. // label: '',
  367. // slot: 'guaranteePeriodUnitCode'
  368. // },
  369. {
  370. width: 120,
  371. prop: 'technicalAnswerName',
  372. label: '技术答疑人',
  373. slot: 'technicalAnswerName',
  374. align: 'center'
  375. },
  376. {
  377. width: 220,
  378. prop: 'technicalParams',
  379. label: '技术参数',
  380. slot: 'technicalParams',
  381. align: 'center'
  382. },
  383. {
  384. width: 240,
  385. prop: 'technicalDrawings',
  386. label: '技术图纸',
  387. slot: 'technicalDrawings',
  388. formatter: (_row, _column, cellValue) => {
  389. return (
  390. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  391. );
  392. },
  393. align: 'center'
  394. },
  395. {
  396. width: 220,
  397. prop: 'remark',
  398. label: '备注',
  399. slot: 'remark',
  400. align: 'center'
  401. }
  402. ]
  403. };
  404. },
  405. created() {
  406. },
  407. methods: {
  408. async open(row) {
  409. this.form = row;
  410. this.getDetailData(row.id);
  411. this.detailId = row.id;
  412. },
  413. handleTag(val) {
  414. this.activeComp = val;
  415. if (val == 'store') {
  416. this.$nextTick(() => {
  417. this.$refs.outBoundDetailsRef._getInfo(this.form.code);
  418. });
  419. }
  420. },
  421. //关闭弹窗
  422. cancel() {
  423. this.$emit('update:detailDialogFlag', false);
  424. },
  425. downloadFile(file) {
  426. getFile({ objectName: file.storePath }, file.name);
  427. },
  428. async getDetailData(id) {
  429. this.loading = true;
  430. const data = await getPSaleEntrustedReceiveDetailAPI(id);
  431. this.loading = false;
  432. if (data) {
  433. data.productList.forEach((item) => {
  434. data.pricingWay = data.pricingWay || data?.saleOrder?.pricingWay;
  435. });
  436. this.form = data;
  437. this.detailData = data;
  438. this.form.pricingWay = data?.saleOrder?.pricingWay;
  439. }
  440. }
  441. }
  442. };
  443. </script>
  444. <style scoped lang="scss">
  445. .ele-dialog-form {
  446. .el-form-item {
  447. margin-bottom: 10px;
  448. }
  449. }
  450. .headbox {
  451. display: flex;
  452. justify-content: flex-start;
  453. align-items: center;
  454. .amount {
  455. font-size: 14px;
  456. font-weight: bold;
  457. margin-right: 20px;
  458. }
  459. }
  460. </style>