detailDialog.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. <template>
  2. <div>
  3. <el-form ref="form" :model="form" label-width="130px">
  4. <headerTitle title="收货信息"></headerTitle>
  5. <el-row :gutter="20">
  6. <el-col :span="12">
  7. <el-form-item
  8. label="选择订单:"
  9. prop="orderNo"
  10. style="margin-bottom: 22px"
  11. >
  12. {{ form.orderNo }}
  13. </el-form-item>
  14. </el-col>
  15. <el-col :span="12">
  16. <el-form-item
  17. label="客户名称:"
  18. prop="contactName"
  19. style="margin-bottom: 22px"
  20. >
  21. {{ form.contactName }}
  22. </el-form-item>
  23. </el-col>
  24. </el-row>
  25. <el-row :gutter="20">
  26. <!-- <el-col :span="12">
  27. <el-form-item label="计价方式:" style="margin-bottom: 22px">
  28. {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
  29. </el-form-item>
  30. </el-col> -->
  31. <el-col :span="12">
  32. <el-form-item
  33. label="客户联系人:"
  34. prop="linkName"
  35. style="margin-bottom: 22px"
  36. >
  37. {{ form.linkName }}
  38. </el-form-item>
  39. </el-col>
  40. </el-row>
  41. <el-row :gutter="20">
  42. <el-col :span="12">
  43. <el-form-item
  44. label="车辆号:"
  45. prop="carNo"
  46. style="margin-bottom: 22px"
  47. >
  48. {{ form.carNo }}
  49. </el-form-item>
  50. </el-col>
  51. <el-col :span="12">
  52. <el-form-item
  53. label="客户电话:"
  54. prop="linkPhone"
  55. style="margin-bottom: 22px"
  56. >
  57. {{ form.linkPhone }}
  58. </el-form-item>
  59. </el-col>
  60. </el-row>
  61. <el-row :gutter="20">
  62. <el-col :span="12">
  63. <el-form-item
  64. label="收货日期:"
  65. prop="receiveDate"
  66. style="margin-bottom: 22px"
  67. >
  68. {{ form.receiveDate }}
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="12">
  72. <el-form-item
  73. label="收货单号:"
  74. prop="sendNoteNo"
  75. style="margin-bottom: 22px"
  76. >
  77. {{ form.sendNoteNo }}
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="12">
  81. <el-form-item prop="files" label="附件:">
  82. <fileMain v-model="form.files" type="view"></fileMain>
  83. <!-- <div v-if="form.files && form.files?.length">-->
  84. <!-- <el-link-->
  85. <!-- v-for="link in form.files"-->
  86. <!-- :key="link.id"-->
  87. <!-- type="primary"-->
  88. <!-- :underline="false"-->
  89. <!-- @click="downloadFile(link)"-->
  90. <!-- >-->
  91. <!-- {{ link.name }}-->
  92. <!-- </el-link>-->
  93. <!-- </div>-->
  94. </el-form-item>
  95. </el-col>
  96. </el-row>
  97. </el-form>
  98. <headerTitle title="物品清单"></headerTitle>
  99. <ele-pro-table
  100. ref="table"
  101. :needPage="false"
  102. :columns="competAnalysisListcolumns"
  103. :toolkit="[]"
  104. :datasource="detailData.productList"
  105. row-key="id"
  106. >
  107. <!-- <template v-slot:toolbar>
  108. <div class="headbox">
  109. <span class="amount">总计:{{detailData.totalAmount}}元</span>
  110. <span class="amount">应付金额:{{detailData.payAmount}}元</span>
  111. </div>
  112. </template> -->
  113. <template v-slot:technicalDrawings="{ row }">
  114. <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
  115. <el-link
  116. v-for="link in row.technicalDrawings"
  117. :key="link.id"
  118. type="primary"
  119. :underline="false"
  120. @click="downloadFile(link)"
  121. >
  122. {{ link.name }}
  123. </el-link>
  124. </div>
  125. </template>
  126. </ele-pro-table>
  127. </div>
  128. </template>
  129. <script>
  130. import { getFile } from '@/api/system/file';
  131. import { getPSaleEntrustedReceiveDetailAPI } from '@/api/bpm/components/saleManage/entrustedReceive';
  132. import { deepClone } from '@/components/FormGenerator/utils/index';
  133. import fileMain from '@/components/addDoc/index.vue';
  134. export default {
  135. components: { fileMain },
  136. props: {
  137. businessId: {
  138. default: ''
  139. }
  140. },
  141. data() {
  142. return {
  143. detailId: '',
  144. form: {},
  145. detailData: {},
  146. competAnalysisListcolumns: [
  147. {
  148. width: 45,
  149. type: 'index',
  150. columnKey: 'index',
  151. align: 'center',
  152. fixed: 'left'
  153. },
  154. {
  155. minWidth: 140,
  156. prop: 'productName',
  157. label: '名称',
  158. slot: 'productName',
  159. align: 'center'
  160. },
  161. {
  162. minWidth: 120,
  163. prop: 'productCode',
  164. label: '编码',
  165. slot: 'productCode',
  166. align: 'center'
  167. },
  168. {
  169. minWidth: 100,
  170. prop: 'productCategoryName',
  171. label: '类型',
  172. slot: 'productCategoryName',
  173. align: 'center'
  174. },
  175. {
  176. width: 160,
  177. prop: 'productBrand',
  178. label: '牌号',
  179. slot: 'productBrand',
  180. align: 'center'
  181. },
  182. {
  183. width: 120,
  184. prop: 'modelType',
  185. label: '型号',
  186. slot: 'modelType',
  187. align: 'center'
  188. },
  189. {
  190. width: 120,
  191. prop: 'specification',
  192. label: '规格',
  193. slot: 'specification',
  194. align: 'center'
  195. },
  196. {
  197. width: 200,
  198. prop: 'customerMark',
  199. label: '客户代号',
  200. slot: 'customerMark',
  201. align: 'center'
  202. },
  203. {
  204. width: 200,
  205. prop: 'warehouseName',
  206. label: '仓库名称',
  207. slot: 'warehouseName',
  208. align: 'center'
  209. },
  210. {
  211. width: 110,
  212. prop: 'orderTotalCount',
  213. label: '订单总数量',
  214. slot: 'orderTotalCount',
  215. align: 'center'
  216. },
  217. {
  218. width: 120,
  219. prop: 'totalCount',
  220. label: '本次收货数量',
  221. slot: 'totalCount',
  222. headerSlot: 'headerTotalCount',
  223. align: 'center'
  224. },
  225. {
  226. width: 100,
  227. prop: 'receiveTotalCount',
  228. label: '已收货总数',
  229. slot: 'receiveTotalCount',
  230. align: 'center'
  231. },
  232. {
  233. width: 120,
  234. prop: 'measuringUnit',
  235. label: '计量单位',
  236. slot: 'measuringUnit',
  237. align: 'center'
  238. },
  239. {
  240. width: 120,
  241. prop: 'singleWeight',
  242. label: '单重',
  243. slot: 'singleWeight',
  244. align: 'center'
  245. },
  246. {
  247. width: 100,
  248. prop: 'receiveTotalWeight',
  249. label: '收货总重',
  250. slot: 'receiveTotalWeight',
  251. align: 'center'
  252. },
  253. {
  254. width: 100,
  255. prop: 'weightUnit',
  256. label: '重量单位',
  257. slot: 'weightUnit',
  258. align: 'center'
  259. },
  260. {
  261. width: 160,
  262. prop: 'pricingWay',
  263. label: '计价方式',
  264. slot: 'pricingWay',
  265. align: 'center',
  266. formatter: (row, column) => {
  267. return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
  268. }
  269. },
  270. {
  271. width: 160,
  272. prop: 'singlePrice',
  273. label: '单价',
  274. slot: 'singlePrice',
  275. align: 'center'
  276. },
  277. {
  278. width: 100,
  279. prop: 'taxRate',
  280. label: '税率',
  281. align: 'center'
  282. },
  283. {
  284. width: 100,
  285. prop: 'discountSinglePrice',
  286. label: '折让单价',
  287. slot: 'discountSinglePrice',
  288. align: 'center'
  289. },
  290. {
  291. width: 120,
  292. prop: 'totalPrice',
  293. label: '合计',
  294. slot: 'totalPrice',
  295. formatter: (_row, _column, cellValue) => {
  296. return _row.totalPrice + '元';
  297. },
  298. align: 'center'
  299. },
  300. {
  301. width: 100,
  302. prop: 'discountTotalPrice',
  303. label: '折让合计',
  304. slot: 'discountTotalPrice',
  305. align: 'center'
  306. },
  307. {
  308. width: 120,
  309. prop: 'deliveryDays',
  310. label: '交期(天)',
  311. slot: 'deliveryDays',
  312. align: 'center'
  313. },
  314. {
  315. width: 200,
  316. prop: 'guaranteePeriod',
  317. label: '质保期',
  318. slot: 'guaranteePeriod',
  319. formatter: (_row, _column, cellValue) => {
  320. return (
  321. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  322. );
  323. },
  324. align: 'center'
  325. },
  326. // {
  327. // width: 120,
  328. // prop: 'guaranteePeriodUnitCode',
  329. // label: '',
  330. // slot: 'guaranteePeriodUnitCode'
  331. // },
  332. {
  333. width: 120,
  334. prop: 'technicalAnswerName',
  335. label: '技术答疑人',
  336. slot: 'technicalAnswerName',
  337. align: 'center'
  338. },
  339. {
  340. width: 220,
  341. prop: 'technicalParams',
  342. label: '技术参数',
  343. slot: 'technicalParams',
  344. align: 'center'
  345. },
  346. {
  347. width: 240,
  348. prop: 'technicalDrawings',
  349. label: '技术图纸',
  350. slot: 'technicalDrawings',
  351. formatter: (_row, _column, cellValue) => {
  352. return (
  353. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  354. );
  355. },
  356. align: 'center'
  357. },
  358. {
  359. width: 220,
  360. prop: 'remark',
  361. label: '备注',
  362. slot: 'remark',
  363. align: 'center'
  364. }
  365. ]
  366. };
  367. },
  368. created() {
  369. this.getDetailData(this.businessId);
  370. },
  371. methods: {
  372. downloadFile(file) {
  373. getFile({ objectName: file.storePath }, file.name);
  374. },
  375. async getDetailData(id) {
  376. this.loading = true;
  377. const data = await getPSaleEntrustedReceiveDetailAPI(id);
  378. this.loading = false;
  379. if (data) {
  380. data.productList.forEach((item) => {
  381. data.pricingWay = data.pricingWay || data?.saleOrder?.pricingWay;
  382. });
  383. this.form = deepClone(data);
  384. this.form.pricingWay = data?.saleOrder?.pricingWay;
  385. this.detailData = data;
  386. }
  387. },
  388. getTableValue() {
  389. return Promise.resolve(this.form);
  390. }
  391. }
  392. };
  393. </script>
  394. <style scoped lang="scss">
  395. .ele-dialog-form {
  396. .el-form-item {
  397. margin-bottom: 10px;
  398. }
  399. }
  400. .headbox {
  401. display: flex;
  402. justify-content: flex-start;
  403. align-items: center;
  404. .amount {
  405. font-size: 14px;
  406. font-weight: bold;
  407. margin-right: 20px;
  408. }
  409. }
  410. </style>