detailDialog.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. v-if="visible"
  6. :visible.sync="visible"
  7. :title="title"
  8. :close-on-click-modal="false"
  9. width="60%"
  10. @close="cancel"
  11. :fullscreen="fullscreen"
  12. :modal="isModal"
  13. >
  14. <template slot="title">
  15. <modalTitle :title="title" @setFullscreen="fullscreen=!fullscreen"></modalTitle>
  16. </template>
  17. <div class="switch">
  18. <div class="switch_left">
  19. <ul>
  20. <li
  21. v-for="item in tabOptions"
  22. :key="item.key"
  23. :class="{ active: activeComp == item.key }"
  24. @click="activeComp = item.key"
  25. >
  26. {{ item.name }}
  27. </li>
  28. </ul>
  29. </div>
  30. </div>
  31. <div v-show="activeComp == 'main'">
  32. <el-form ref="form" :model="form" class="el-form-box" label-width="120px">
  33. <headerTitle title="基本信息">
  34. <!-- <el-button
  35. size="small"
  36. type="primary"
  37. icon="el-icon-s-grid"
  38. class="ele-btn-icon"
  39. @click="exportTable"
  40. >
  41. 导出
  42. </el-button> -->
  43. </headerTitle>
  44. <el-row>
  45. <el-col :span="12">
  46. <el-form-item label="需求类型:" prop="sourceTypeName">
  47. <el-input v-model="form.sourceTypeName" disabled></el-input>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="12">
  51. <el-form-item label="需求单名称:" prop="requirementName">
  52. <el-input v-model="form.requirementName" disabled></el-input>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="12">
  56. <el-form-item label="需求部门:" prop="requireDeptName">
  57. <el-input v-model="form.requireDeptName" disabled></el-input>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :span="12">
  61. <el-form-item label="需求人:" prop="requireUserName">
  62. <el-input v-model="form.requireUserName" disabled></el-input>
  63. </el-form-item>
  64. </el-col>
  65. <el-col v-if="form.sourceType==1" :span="12">
  66. <el-form-item label="销售合同">
  67. <el-input v-model="form.saleContractName" disabled></el-input>
  68. </el-form-item>
  69. </el-col>
  70. <el-col v-if="form.sourceType==1" :span="12">
  71. <el-form-item label="销售订单">
  72. <el-input v-model="form.saleOrderNo" disabled></el-input>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="12">
  76. <el-form-item prop="remark" label="是否接受拆单">
  77. <el-select v-model="form.acceptUnpack" placeholder="请选择" disabled style="width: 100%">
  78. <el-option label="接受" :value="1"></el-option>
  79. <el-option label="不接受" :value="0"></el-option>
  80. </el-select>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="12">
  84. <el-form-item label="完成日期:" prop="finishDate">
  85. <el-input v-model="form.finishDate" disabled></el-input>
  86. </el-form-item>
  87. </el-col>
  88. <el-col :span="12">
  89. <el-form-item label="用途:" prop="useTo">
  90. <el-input type="textarea" v-model="form.useTo" disabled></el-input>
  91. </el-form-item>
  92. </el-col>
  93. <el-col :span="12">
  94. <el-form-item prop="remark" label="备注:">
  95. <el-input type="textarea" v-model="form.remark" disabled></el-input>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="12">
  99. <el-form-item prop="askFile" label="附件:">
  100. <fileMain v-model="form.fileId" type="view"></fileMain>
  101. <!-- <el-link
  102. v-if="form.files && form.files !== ''"
  103. type="primary"
  104. :underline="false"
  105. @click="downloadFile(form.files)"
  106. >
  107. {{ form.files.name }}
  108. </el-link
  109. > -->
  110. </el-form-item>
  111. </el-col>
  112. </el-row>
  113. </el-form>
  114. <headerTitle title="需求清单"></headerTitle>
  115. <ele-pro-table
  116. ref="table"
  117. :needPage="false"
  118. :columns="columns"
  119. :toolkit="[]"
  120. :max-height="500"
  121. :datasource="detailData.detailList"
  122. row-key="id"
  123. >
  124. <template v-slot:expectReceiveDate="scope">
  125. <div v-if="scope.row.arrivalWay == 1">
  126. {{ scope.row.expectReceiveDate }}
  127. </div>
  128. <div v-if="scope.row.arrivalWay == 2">
  129. <el-link
  130. type="primary"
  131. :underline="false"
  132. @click.native="handleMethod(scope.row)"
  133. >
  134. 查看分批时间
  135. </el-link>
  136. </div>
  137. </template>
  138. <template v-slot:technicalDrawings="{ row }">
  139. <fileMain v-model="row.technicalDrawings" type="view" ></fileMain>
  140. <!-- <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
  141. <!-- <el-link-->
  142. <!-- v-for="link in row.technicalDrawings"-->
  143. <!-- :key="link.id"-->
  144. <!-- type="primary"-->
  145. <!-- :underline="false"-->
  146. <!-- @click="downloadFile(link)"-->
  147. <!-- >-->
  148. <!-- {{ link.name }}-->
  149. <!-- </el-link-->
  150. <!-- >-->
  151. <!-- </div>-->
  152. </template>
  153. <template v-slot:files="{ row }">
  154. <fileMain v-model="row.files" type="view" ></fileMain>
  155. <!-- <div v-if="row.files && row.files?.length">-->
  156. <!-- <el-link-->
  157. <!-- v-for="link in row.files"-->
  158. <!-- :key="link.id"-->
  159. <!-- type="primary"-->
  160. <!-- :underline="false"-->
  161. <!-- @click="downloadFile(link)"-->
  162. <!-- >-->
  163. <!-- {{ link.name }}-->
  164. <!-- </el-link-->
  165. <!-- >-->
  166. <!-- </div>-->
  167. </template>
  168. </ele-pro-table>
  169. </div>
  170. <bpmDetail
  171. v-if="activeComp === 'bpm' && form.processInstanceId"
  172. :id="form.processInstanceId"
  173. ></bpmDetail>
  174. <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
  175. <div slot="footer" class="footer">
  176. <el-button @click="cancel">返回</el-button>
  177. </div>
  178. </ele-modal>
  179. </template>
  180. <script>
  181. import {getDetail} from '@/api/purchasingManage/purchaseNeedManage';
  182. import {getFile} from '@/api/system/file';
  183. import dictMixins from '@/mixins/dictMixins';
  184. import {copyObj} from '@/utils/util';
  185. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  186. import timeDialog from '@/components/timeDialog/index.vue';
  187. import fileMain from '@/components/addDoc/index';
  188. import modalTitle from '@/BIZComponents/modalTitle.vue';
  189. export default {
  190. mixins: [dictMixins],
  191. props: {
  192. isModal: {
  193. default: true
  194. }
  195. },
  196. components: {
  197. bpmDetail, timeDialog,fileMain,modalTitle
  198. },
  199. data() {
  200. return {
  201. fullscreen:false,
  202. activeComp: 'main',
  203. tabOptions: [
  204. {key: 'main', name: '需求详情'},
  205. {key: 'bpm', name: '流程详情'}
  206. ],
  207. visible: false,
  208. title: '详情',
  209. row: {},
  210. form: {},
  211. detailData: {},
  212. columns: [
  213. {
  214. width: 45,
  215. type: 'index',
  216. columnKey: 'index',
  217. align: 'center',
  218. fixed: 'left'
  219. },
  220. {
  221. width: 150,
  222. prop: 'productCategoryName',
  223. label: '分类',
  224. slot: 'productCategoryName',
  225. align: 'center',
  226. },
  227. {
  228. width: 140,
  229. prop: 'productCode',
  230. label: '编码',
  231. slot: 'productCode',
  232. align: 'center',
  233. },
  234. {
  235. width: 240,
  236. prop: 'productName',
  237. label: '名称',
  238. slot: 'productName',
  239. align: 'center',
  240. },
  241. {
  242. width: 150,
  243. prop: 'productBrand',
  244. label: '牌号',
  245. slot: 'productBrand',
  246. align: 'center',
  247. },
  248. {
  249. width: 80,
  250. prop: 'totalCount',
  251. label: '数量',
  252. slot: 'totalCount',
  253. align: 'center',
  254. },
  255. {
  256. width: 100,
  257. prop: 'measuringUnit',
  258. label: '单位',
  259. slot: 'measuringUnit',
  260. align: 'center',
  261. },
  262. {
  263. width: 130,
  264. prop: 'modelType',
  265. label: '型号',
  266. slot: 'modelType',
  267. align: 'center',
  268. },
  269. {
  270. width: 120,
  271. prop: 'specification',
  272. label: '规格',
  273. slot: 'specification',
  274. align: 'center',
  275. },
  276. {
  277. width: 130,
  278. prop: 'brand',
  279. label: '品牌',
  280. slot: 'brand',
  281. align: 'center',
  282. },
  283. {
  284. width: 150,
  285. prop: 'arrivalWay',
  286. label: ' 到货方式',
  287. formatter: (row, column, cellValue) => {
  288. return cellValue == 1 ? '一次性到货' : '分批到货';
  289. },
  290. align: 'center',
  291. },
  292. {
  293. width: 170,
  294. prop: 'expectReceiveDate',
  295. label: '到货日期',
  296. slot: 'expectReceiveDate',
  297. align: 'center',
  298. },
  299. {
  300. width: 160,
  301. prop: 'technicalDrawings',
  302. label: '图纸附件',
  303. slot: 'technicalDrawings',
  304. align: 'center',
  305. },
  306. {
  307. width: 140,
  308. prop: 'files',
  309. label: '附件',
  310. slot: 'files',
  311. align: 'center',
  312. },
  313. {
  314. width: 220,
  315. prop: 'remark',
  316. label: '备注',
  317. slot: 'remark',
  318. align: 'center',
  319. }
  320. ]
  321. };
  322. },
  323. methods: {
  324. async open(row) {
  325. this.visible = true;
  326. this.getDetailData(row.requirementId || row.id);
  327. },
  328. cancel() {
  329. this.$nextTick(() => {
  330. // 关闭后,销毁所有的表单数据
  331. (this.form = copyObj(this.formDef)),
  332. (this.otherForm = copyObj(this.otherFormDef)),
  333. (this.tableBankData = []);
  334. this.tableLinkData = [];
  335. this.visible = false;
  336. });
  337. },
  338. downloadFile(file) {
  339. getFile({objectName: file.storePath}, file.name);
  340. },
  341. handleMethod(row) {
  342. this.$refs.timeDialogRef.open(row);
  343. },
  344. async getDetailData(id) {
  345. this.loading = true;
  346. const data = await getDetail(id);
  347. this.loading = false;
  348. if (data) {
  349. this.form = data;
  350. if (this.form.fileId) {
  351. this.form.fileId = JSON.parse(this.form.fileId);
  352. }
  353. this.detailData = data;
  354. if (data.files && data.files.length > 0) {
  355. this.form.files = data.files[0];
  356. } else {
  357. this.form.files = null;
  358. }
  359. }
  360. }
  361. }
  362. };
  363. </script>
  364. <style scoped lang="scss">
  365. .ele-dialog-form {
  366. .el-form-item {
  367. margin-bottom: 10px;
  368. }
  369. }
  370. .headbox {
  371. display: flex;
  372. justify-content: space-between;
  373. align-items: center;
  374. .amount {
  375. font-size: 14px;
  376. font-weight: bold;
  377. }
  378. }
  379. </style>