detailDialog.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <template>
  2. <div>
  3. <el-form ref="form" :model="form" label-width="120px">
  4. <div class="title" style="margin-bottom: 10px;"> 采购来源清单</div>
  5. <ele-pro-table
  6. ref="preTable"
  7. :needPage="false"
  8. :columns="preColumns"
  9. :toolkit="[]"
  10. :datasource="form.outputDetailList"
  11. row-key="id"
  12. maxHeight="500px"
  13. style="margin-bottom: 20px"
  14. >
  15. <template v-slot:technicalDrawings="{ row }">
  16. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  17. </template>
  18. <template v-slot:files="{ row }">
  19. <fileMain v-model="row.files" type="view"></fileMain>
  20. </template>
  21. </ele-pro-table>
  22. <div class="title"> 采购计划信息</div>
  23. <el-row>
  24. <el-col :span="8">
  25. <el-form-item label="需求单名称:" prop="requirementName">
  26. <el-link
  27. type="primary"
  28. :underline="false"
  29. @click="openDetail(form)"
  30. >
  31. {{ form.requirementName }}
  32. </el-link>
  33. <!-- {{ form.requirementCode }} -->
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="8">
  37. <el-form-item label="计划单名称:" prop="planName">
  38. {{ form.planName }}
  39. <!-- {{ form.requirementCode }} -->
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="8">
  43. <el-form-item label="负责人:" prop="responsibleName">
  44. {{ form.responsibleName }}
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="8">
  48. <el-form-item label="需求类型:" prop="sourceTypeName">
  49. {{ form.sourceTypeName }}
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="8">
  53. <el-form-item label="需求部门:" prop="requireDeptName">
  54. {{ form.requireDeptName }}
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="8">
  58. <el-form-item label="需求人:" prop="requireUserName">
  59. {{ form.requireUserName }}
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="8">
  63. <el-form-item prop="remark" label="是否接受拆单:">
  64. {{ form.acceptUnpack === 1 ? '接受' : '不接受' }}
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="8">
  68. <el-form-item prop="remark" label="是否需要核价:">
  69. {{ form.acceptUnpack === 1 ? '是' : '否' }}
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="8">
  73. <el-form-item label-width="144px" prop="isGenerateOrder" label="是否自动生成订单:">
  74. {{ form.isGenerateOrder == 1 ? '是' : '否' }}
  75. </el-form-item>
  76. </el-col>
  77. <el-col :span="8">
  78. <el-form-item label-width="144px" prop="isGenerateContract" label="是否自动生成合同:">
  79. {{ form.isGenerateContract == 1 ? '是' : '否' }}
  80. </el-form-item>
  81. </el-col>
  82. <!-- <el-col :span="12">
  83. <el-form-item
  84. label="用途"
  85. prop="requireUserName"
  86. style="margin-bottom: 22px"
  87. >
  88. {{ form.requireUserName }}
  89. </el-form-item>
  90. </el-col> -->
  91. <el-col :span="8">
  92. <el-form-item label="完结日期:" prop="receiveDate">
  93. {{ form.receiveDate }}
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="8">
  97. <el-form-item prop="remark" label="备注:">
  98. {{ form.remark }}
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="8">
  102. <el-form-item prop="files" label="附件:">
  103. <fileMain v-model="form.files" type="view"></fileMain>
  104. </el-form-item>
  105. </el-col>
  106. </el-row>
  107. <headerTitle title="计划清单" style="margin-top: 15px"></headerTitle>
  108. <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
  109. <el-tab-pane label="物品清单" name="1">
  110. <ele-pro-table
  111. ref="table"
  112. :needPage="false"
  113. :columns="columns"
  114. :toolkit="[]"
  115. :datasource="form.detailList"
  116. row-key="id"
  117. maxHeight="500px"
  118. >
  119. <template v-slot:totalCount="scope">
  120. <el-input-number
  121. :controls="false"
  122. :min="1"
  123. style="width: 100%"
  124. v-model="scope.row.totalCount"
  125. ></el-input-number>
  126. </template>
  127. <template v-slot:expectReceiveDate="scope">
  128. <div v-if="scope.row.arrivalWay == 1">
  129. {{ scope.row.expectReceiveDate }}
  130. </div>
  131. <div v-if="scope.row.arrivalWay == 2">
  132. <el-link
  133. type="primary"
  134. :underline="false"
  135. @click.native="handleMethod(scope.row)"
  136. >
  137. 查看分批时间
  138. </el-link>
  139. </div>
  140. </template>
  141. <template v-slot:technicalDrawings="{ row }">
  142. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  143. </template>
  144. <template v-slot:files="{ row }">
  145. <fileMain v-model="row.files" type="view"></fileMain>
  146. </template>
  147. </ele-pro-table>
  148. </el-tab-pane>
  149. <el-tab-pane
  150. label="带料清单"
  151. name="2"
  152. v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
  153. >
  154. <ele-pro-table
  155. ref="table"
  156. :needPage="false"
  157. :columns="columns"
  158. :toolkit="[]"
  159. :datasource="form.rawDetailList"
  160. row-key="id"
  161. >
  162. <template v-slot:totalCount="scope">
  163. <el-input-number
  164. :controls="false"
  165. :min="1"
  166. style="width: 100%"
  167. v-model="scope.row.totalCount"
  168. ></el-input-number>
  169. </template>
  170. </ele-pro-table>
  171. </el-tab-pane>
  172. <el-tab-pane
  173. label="产出品清单"
  174. name="3"
  175. v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
  176. >
  177. <ele-pro-table
  178. ref="table"
  179. :needPage="false"
  180. :columns="columns"
  181. :toolkit="[]"
  182. :datasource="form.outputDetailList"
  183. row-key="id"
  184. >
  185. <template v-slot:totalCount="scope">
  186. <el-input-number
  187. :controls="false"
  188. :min="1"
  189. style="width: 100%"
  190. v-model="scope.row.totalCount"
  191. ></el-input-number>
  192. </template>
  193. </ele-pro-table>
  194. </el-tab-pane>
  195. </el-tabs>
  196. </el-form>
  197. <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
  198. <div class="title" v-if="['3', '4', '5'].includes(form.sourceType)">
  199. 入库单信息</div
  200. >
  201. <div v-if="taskDefinitionKey == 'storeManagerApprove'">
  202. <add
  203. ref="inoutBoundRef"
  204. v-if="form.detailList"
  205. :form="form"
  206. :sourceBizNo="form.planCode"
  207. :saleProductList="form.detailList"
  208. :bizType="10"
  209. ></add>
  210. </div>
  211. <div v-if="isView && ['3', '4', '5'].includes(form.sourceType)">
  212. <detailDialog
  213. ref="inoutBoundViewRef"
  214. :bizType="10"
  215. :businessId="form.planCode"
  216. >
  217. </detailDialog>
  218. </div>
  219. </div>
  220. </template>
  221. <script>
  222. import { getplanDetail } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
  223. import { getFile } from '@/api/system/file';
  224. import dictMixins from '@/mixins/dictMixins';
  225. import { getInventoryTotalAPI } from '@/api/bpm/components/wms';
  226. import timeDialog from '@/components/timeDialog/index.vue';
  227. import add from '@/views/bpm/stockManagement/storage.vue';
  228. import detailDialog from '@/views/bpm/stockManagement/details.vue';
  229. import { levelList } from '@/enum/dict.js';
  230. export default {
  231. mixins: [dictMixins],
  232. components: {
  233. // fileMain,
  234. timeDialog,
  235. add,
  236. detailDialog
  237. },
  238. props: {
  239. taskDefinitionKey: {
  240. type: String,
  241. default: 'starter'
  242. },
  243. businessId: {
  244. default: ''
  245. },
  246. isView: {
  247. default: ''
  248. }
  249. },
  250. data() {
  251. return {
  252. activeName: '1',
  253. visible: false,
  254. detailId: '',
  255. title: '详情',
  256. row: {},
  257. form: {
  258. files: []
  259. },
  260. columns: [
  261. {
  262. width: 45,
  263. type: 'index',
  264. columnKey: 'index',
  265. align: 'center',
  266. fixed: 'left'
  267. },
  268. {
  269. width: 150,
  270. prop: 'productCategoryName',
  271. label: '分类',
  272. align: 'center'
  273. },
  274. {
  275. width: 140,
  276. prop: 'productCode',
  277. label: '编码',
  278. align: 'center'
  279. },
  280. {
  281. width: 240,
  282. prop: 'productName',
  283. label: '名称',
  284. align: 'center'
  285. },
  286. {
  287. width: 110,
  288. prop: 'batchNo',
  289. label: '批次号',
  290. align: 'center'
  291. },
  292. {
  293. prop: 'provenance',
  294. label: '产地',
  295. slot: 'provenance',
  296. align: 'center',
  297. minWidth: 200,
  298. showOverflowTooltip: true,
  299. formatter: (row, column) => {
  300. return row.provenance && row.provenance.length
  301. ? row.provenance
  302. .map((item) => this.getDictValue('产地', item))
  303. .join(',')
  304. : '';
  305. }
  306. },
  307. {
  308. width: 150,
  309. prop: 'taskName',
  310. label: '工序',
  311. align: 'center'
  312. },
  313. {
  314. width: 150,
  315. prop: 'productBrand',
  316. label: '牌号',
  317. align: 'center'
  318. },
  319. {
  320. width: 150,
  321. prop: 'purchaseCount',
  322. label: '数量',
  323. align: 'center',
  324. formatter: (row, column) => {
  325. if (row.purchaseCount) {
  326. return row.purchaseCount + ' ' + (row.purchaseUnit || '');
  327. }
  328. }
  329. },
  330. // {
  331. // width: 150,
  332. // prop: 'purchaseUnit',
  333. // label: '单位',
  334. // align: 'center'
  335. // },
  336. {
  337. minWidth: 180,
  338. prop: 'packingSpecification',
  339. align: 'center',
  340. label: '包装规格',
  341. showOverflowTooltip: true
  342. },
  343. {
  344. width: 100,
  345. prop: 'totalCount',
  346. label: '计量数量',
  347. align: 'center',
  348. formatter: (row, column) => {
  349. if (row.totalCount) {
  350. return row.totalCount + ' ' + (row.measuringUnit || '');
  351. }
  352. }
  353. // slot: 'totalCount'
  354. },
  355. // {
  356. // width: 100,
  357. // prop: 'measuringUnit',
  358. // label: '计量单位',
  359. // align: 'center',
  360. // slot: 'measuringUnit'
  361. // },
  362. {
  363. minWidth: 120,
  364. prop: 'goodsLevel',
  365. label: '物品级别',
  366. formatter: (_row, _column, cellValue) => {
  367. return levelList.find((item) => item.value == _row.goodsLevel)
  368. ?.label;
  369. },
  370. align: 'center'
  371. },
  372. {
  373. width: 200,
  374. prop: 'warehouseName',
  375. label: '入库仓库',
  376. align: 'center'
  377. },
  378. {
  379. width: 120,
  380. prop: 'totalWeight',
  381. label: '重量',
  382. formatter: (row, column) => {
  383. if (row.totalWeight) {
  384. return row.totalWeight + ' ' + (row.weightUnit || '');
  385. }
  386. },
  387. align: 'center'
  388. },
  389. {
  390. width: 130,
  391. prop: 'modelType',
  392. label: '型号',
  393. align: 'center',
  394. slot: 'modelType'
  395. },
  396. {
  397. width: 120,
  398. prop: 'specification',
  399. label: '规格',
  400. align: 'center',
  401. slot: 'specification'
  402. },
  403. {
  404. minWidth: 120,
  405. prop: 'modelKey',
  406. label: '机型',
  407. showOverflowTooltip: true,
  408. align: 'center'
  409. },
  410. {
  411. minWidth: 120,
  412. prop: 'colorKey',
  413. showOverflowTooltip: true,
  414. label: '颜色',
  415. align: 'center'
  416. },
  417. {
  418. width: 150,
  419. prop: 'arrivalWay',
  420. label: '到货方式',
  421. formatter: (row, column, cellValue) => {
  422. return cellValue == 1 ? '一次性到货' : '分批到货';
  423. },
  424. align: 'center'
  425. },
  426. {
  427. width: 170,
  428. prop: 'receiveDate',
  429. label: '到货日期',
  430. slot: 'expectReceiveDate',
  431. align: 'center'
  432. },
  433. {
  434. width: 130,
  435. prop: 'supplierName',
  436. label: '供应商',
  437. slot: 'supplierName',
  438. headerSlot: 'headerSupplierName',
  439. align: 'center'
  440. },
  441. {
  442. width: 120,
  443. prop: 'packingSpecification',
  444. align: 'center',
  445. label: '包装规格',
  446. showOverflowTooltip: true
  447. },
  448. {
  449. width: 160,
  450. prop: 'technicalDrawings',
  451. label: '图纸附件',
  452. slot: 'technicalDrawings',
  453. align: 'center'
  454. },
  455. {
  456. width: 140,
  457. prop: 'files',
  458. label: '附件',
  459. slot: 'files',
  460. align: 'center'
  461. },
  462. {
  463. minWidth: 220,
  464. prop: 'remark',
  465. label: '备注',
  466. align: 'center',
  467. slot: 'remark'
  468. }
  469. ],
  470. preColumns: [
  471. {
  472. width: 45,
  473. type: 'index',
  474. columnKey: 'index',
  475. align: 'center',
  476. fixed: 'left'
  477. },
  478. {
  479. width: 150,
  480. prop: 'productCategoryName',
  481. label: '分类',
  482. align: 'center'
  483. },
  484. {
  485. width: 140,
  486. prop: 'productCode',
  487. label: '编码',
  488. align: 'center'
  489. },
  490. {
  491. width: 240,
  492. prop: 'orderNo',
  493. label: '来源单号',
  494. align: 'center'
  495. },
  496. {
  497. width: 240,
  498. prop: 'productName',
  499. label: '名称',
  500. align: 'center'
  501. },
  502. {
  503. width: 100,
  504. prop: 'totalCount',
  505. label: '数量',
  506. align: 'center',
  507. formatter: (row, column) => {
  508. if (row.totalCount) {
  509. return row.totalCount + ' ' + (row.measuringUnit || '');
  510. }
  511. }
  512. // slot: 'totalCount'
  513. },
  514. ],
  515. };
  516. },
  517. created() {
  518. this.requestDict('产地');
  519. this.getPlanData(this.businessId);
  520. },
  521. methods: {
  522. downloadFile(file) {
  523. getFile({ objectName: file.storePath }, file.name);
  524. },
  525. async getPlanData(id) {
  526. this.loading = true;
  527. const data = await getplanDetail(id);
  528. this.loading = false;
  529. if (data) {
  530. data.purchaseDate = data.createTime;
  531. let codeList = data.detailList?.map((item) => item.productCode) || [];
  532. let inventoryTotalList = await getInventoryTotalAPI(codeList);
  533. data.detailList?.forEach((item) => {
  534. let find =
  535. inventoryTotalList.find((key) => key.code == item.productCode) ||
  536. {};
  537. item.availableCountBase = find.availableCountBase;
  538. });
  539. this.form = data;
  540. // if (data.files && data.files.length > 0) {
  541. // this.form.files = data.files[0];
  542. // } else {
  543. // this.form.files = null;
  544. // }
  545. }
  546. },
  547. handleMethod(row) {
  548. this.$refs.timeDialogRef.open(row);
  549. },
  550. //查看详情
  551. openDetail(row) {
  552. this.$refs.contactDetailDialogRef.open(row);
  553. },
  554. async getTableValue() {
  555. return {
  556. returnStorageData:
  557. this.$refs.inoutBoundRef &&
  558. (await this.$refs.inoutBoundRef.getReturnStorage())
  559. };
  560. }
  561. }
  562. };
  563. </script>
  564. <style scoped lang="scss">
  565. .ele-dialog-form {
  566. .el-form-item {
  567. margin-bottom: 10px;
  568. }
  569. }
  570. .title {
  571. font-size: 22px;
  572. font-weight: 800;
  573. margin-top: 15px;
  574. }
  575. .headbox {
  576. display: flex;
  577. justify-content: space-between;
  578. align-items: center;
  579. .amount {
  580. font-size: 14px;
  581. font-weight: bold;
  582. }
  583. }
  584. </style>