detailDialog.vue 13 KB

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