quoted-detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <template>
  2. <div>
  3. <div class="my-title">详情</div>
  4. <div style="margin-left: 20px; margin-right: 20px">
  5. <!-- 工作流 -->
  6. <div v-show="dataForm.workFlowBusinessExt">
  7. <el-steps :active="activeNo" finish-status="success" align-center style="margin-bottom: 20px">
  8. <template v-for="(item, i) in stepList">
  9. <el-step
  10. :icon="item.icon"
  11. :title="item.title"
  12. :description="item.description"
  13. ></el-step>
  14. </template>
  15. </el-steps>
  16. <el-collapse style="margin-bottom: 20px">
  17. <el-collapse-item>
  18. <template slot="title">
  19. <span style="color: red">审批日志(展开查看更多):</span>
  20. </template>
  21. <template v-for="(item, i) in logList">
  22. <div>
  23. {{ ++i }}:{{ item.approverName }} {{ item.createTime }}
  24. {{ item.approvalValue }}
  25. </div>
  26. </template>
  27. </el-collapse-item>
  28. </el-collapse>
  29. </div>
  30. <div v-if="isFlow">
  31. <approve-component ref="approve" @approveFinished="approveFinished" />
  32. </div>
  33. <e-desc title="基本信息" column="3">
  34. <e-desc-item label="项目名称">{{ dataForm.projectName }}</e-desc-item>
  35. <e-desc-item label="项目类别">{{ dataForm.typeName }}</e-desc-item>
  36. <e-desc-item label="备注" span="3">{{ dataForm.remark }}</e-desc-item>
  37. <e-desc-item label="关联BOM物料清单" span="3">{{
  38. dataForm.productName
  39. }}</e-desc-item>
  40. <e-desc-item v-if="dataForm.attachList" label="附件" span="3">
  41. <div v-for="(item, index) in dataForm.attachList" style="display: inline">
  42. <span v-if="index > 0">,</span>
  43. <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
  44. </div>
  45. </e-desc-item>
  46. </e-desc>
  47. <div class="desc">
  48. <h1 class="desc-title">BOM物料明细报价</h1>
  49. <el-row>
  50. <el-table
  51. :data="dataForm.quotedPriceProductList"
  52. border
  53. style="width: 100%"
  54. >
  55. <el-table-column
  56. label="序号"
  57. type="index"
  58. width="50"
  59. align="center"
  60. >
  61. </el-table-column>
  62. <el-table-column
  63. prop="productName"
  64. header-align="center"
  65. align="center"
  66. :show-tooltip-when-overflow="true"
  67. min-width="160px"
  68. label="物料名称"
  69. >
  70. </el-table-column>
  71. <el-table-column
  72. prop="productSpec"
  73. header-align="center"
  74. align="center"
  75. :show-tooltip-when-overflow="true"
  76. label="物料规格"
  77. >
  78. </el-table-column>
  79. <el-table-column
  80. prop="mapNumber"
  81. header-align="center"
  82. align="center"
  83. :show-tooltip-when-overflow="true"
  84. label="主图号"
  85. >
  86. </el-table-column>
  87. <el-table-column
  88. prop="materials"
  89. header-align="center"
  90. align="center"
  91. :show-tooltip-when-overflow="true"
  92. label="材料"
  93. >
  94. </el-table-column>
  95. <el-table-column
  96. prop="cnt"
  97. header-align="center"
  98. align="center"
  99. :show-tooltip-when-overflow="true"
  100. label="单套数量"
  101. >
  102. </el-table-column>
  103. <el-table-column
  104. prop="unit"
  105. header-align="center"
  106. align="center"
  107. :show-tooltip-when-overflow="true"
  108. label="单位"
  109. >
  110. </el-table-column>
  111. <el-table-column
  112. prop="size"
  113. header-align="center"
  114. align="center"
  115. :show-tooltip-when-overflow="true"
  116. label="物料尺寸"
  117. >
  118. </el-table-column>
  119. <el-table-column
  120. prop="developedSize"
  121. header-align="center"
  122. align="center"
  123. :show-tooltip-when-overflow="true"
  124. label="展开尺寸"
  125. >
  126. </el-table-column>
  127. <el-table-column
  128. prop="surfaceTreatment"
  129. header-align="center"
  130. align="center"
  131. :show-tooltip-when-overflow="true"
  132. label="表面处理"
  133. >
  134. </el-table-column>
  135. <el-table-column
  136. prop="notes"
  137. header-align="center"
  138. align="center"
  139. :show-tooltip-when-overflow="true"
  140. min-width="200px"
  141. label="备注"
  142. >
  143. </el-table-column>
  144. <!-- 初次报价 -->
  145. <template>
  146. <el-table-column
  147. prop="materialPrice"
  148. header-align="center"
  149. align="center"
  150. min-width="120px"
  151. label="原材料费"
  152. >
  153. </el-table-column>
  154. <el-table-column
  155. prop="processPrice"
  156. header-align="center"
  157. align="center"
  158. min-width="120px"
  159. label="生产加工费"
  160. >
  161. </el-table-column>
  162. <el-table-column
  163. prop="handlePrice"
  164. header-align="center"
  165. align="center"
  166. min-width="120px"
  167. label="热表处理费"
  168. >
  169. </el-table-column>
  170. <el-table-column
  171. prop="detectionPrice"
  172. header-align="center"
  173. align="center"
  174. min-width="120px"
  175. label="检测费"
  176. >
  177. </el-table-column>
  178. <el-table-column
  179. prop="reviewPrice"
  180. header-align="center"
  181. align="center"
  182. min-width="120px"
  183. label="复验费"
  184. >
  185. </el-table-column>
  186. <el-table-column
  187. prop="unitPrice"
  188. header-align="center"
  189. align="center"
  190. min-width="120px"
  191. label="单价费"
  192. >
  193. </el-table-column>
  194. <el-table-column
  195. prop="elsePrice"
  196. header-align="center"
  197. align="center"
  198. min-width="120px"
  199. label="其他费"
  200. >
  201. </el-table-column>
  202. </template>
  203. <!-- 精准报价 -->
  204. <template>
  205. <el-table-column
  206. prop="precisionMaterialPrice"
  207. header-align="center"
  208. align="center"
  209. min-width="120px"
  210. label="精准原材料费"
  211. >
  212. </el-table-column>
  213. <el-table-column
  214. prop="precisionProcessPrice"
  215. header-align="center"
  216. align="center"
  217. min-width="120px"
  218. label="精准生产加工费"
  219. >
  220. </el-table-column>
  221. <el-table-column
  222. prop="precisionHandlePrice"
  223. header-align="center"
  224. align="center"
  225. min-width="120px"
  226. label="精准热表处理费"
  227. >
  228. </el-table-column>
  229. <el-table-column
  230. prop="precisionDetectionPrice"
  231. header-align="center"
  232. align="center"
  233. min-width="120px"
  234. label="精准检测费"
  235. >
  236. </el-table-column>
  237. <el-table-column
  238. prop="precisionReviewPrice"
  239. header-align="center"
  240. align="center"
  241. min-width="120px"
  242. label="精确复验费"
  243. >
  244. </el-table-column>
  245. <el-table-column
  246. prop="precisionUnitPrice"
  247. header-align="center"
  248. align="center"
  249. min-width="120px"
  250. label="精准单价费"
  251. >
  252. </el-table-column>
  253. <el-table-column
  254. prop="precisionElsePrice"
  255. header-align="center"
  256. align="center"
  257. min-width="120px"
  258. label="精确其他费"
  259. >
  260. </el-table-column>
  261. </template>
  262. </el-table>
  263. </el-row>
  264. </div>
  265. <div class="desc">
  266. <h1 class="desc-title">任务工单派发</h1>
  267. <el-row>
  268. <el-table :data="dataForm.workInfoList" border style="width: 100%">
  269. <el-table-column
  270. label="序号"
  271. type="index"
  272. width="50"
  273. align="center"
  274. >
  275. </el-table-column>
  276. <el-table-column
  277. prop="taskType"
  278. header-align="center"
  279. align="center"
  280. min-width="100"
  281. width="120"
  282. label="工单类型"
  283. >
  284. <template slot-scope="scope">
  285. <span>{{
  286. taskTypeOption.findIndex(
  287. (t) => t.value == scope.row.taskType
  288. ) > -1
  289. ? taskTypeOption.find((t) => t.value == scope.row.taskType)
  290. .label
  291. : ""
  292. }}</span>
  293. </template>
  294. </el-table-column>
  295. <el-table-column
  296. prop="taskName"
  297. header-align="center"
  298. align="center"
  299. :show-tooltip-when-overflow="true"
  300. label="工单名称"
  301. >
  302. </el-table-column>
  303. <el-table-column
  304. prop="ranks"
  305. header-align="center"
  306. align="center"
  307. width="120"
  308. label="级别"
  309. >
  310. <template slot-scope="scope">
  311. <span>{{
  312. rankTypeOption.findIndex((t) => t.value == scope.row.ranks) >
  313. -1
  314. ? rankTypeOption.find((t) => t.value == scope.row.ranks)
  315. .label
  316. : ""
  317. }}</span>
  318. </template>
  319. </el-table-column>
  320. <el-table-column
  321. prop="content"
  322. header-align="center"
  323. align="center"
  324. min-width="100"
  325. label="工单内容"
  326. :show-tooltip-when-overflow="true"
  327. >
  328. </el-table-column>
  329. <el-table-column
  330. prop="receiver"
  331. header-align="center"
  332. align="center"
  333. width="150"
  334. label="任务接收人"
  335. >
  336. <template slot-scope="scope">
  337. <span>{{ scope.row.receiverName }}</span>
  338. </template>
  339. </el-table-column>
  340. <el-table-column
  341. prop="attachListVo"
  342. header-align="center"
  343. align="center"
  344. width="150"
  345. label="任务附件"
  346. >
  347. <template slot-scope="scope">
  348. <el-button
  349. :disabled="
  350. !scope.row.attachListVo || scope.row.attachListVo.length === 0
  351. "
  352. type="text"
  353. size="small"
  354. @click="attachDetails(scope.row.attachListVo)"
  355. >查看</el-button
  356. >
  357. </template>
  358. </el-table-column>
  359. <el-table-column
  360. prop="notes"
  361. header-align="center"
  362. align="center"
  363. :show-tooltip-when-overflow="true"
  364. label="备注"
  365. >
  366. </el-table-column>
  367. </el-table>
  368. </el-row>
  369. </div>
  370. </div>
  371. <span slot="footer" class="dialog-footer">
  372. <el-button @click="onChose">返回</el-button>
  373. </span>
  374. <attach-detail-dialog ref="attachDetail" @onChose="onChose" />
  375. <!-- 文件预览 -->
  376. <preview-component v-if="previewVisible" ref="preview"/>
  377. </div>
  378. </template>
  379. <script>
  380. import EDesc from '../common/e-desc'
  381. import EDescItem from '../common/e-desc-item'
  382. import UploadComponent from '../common/upload-component-v2'
  383. import AttachDetailDialog from '../common/attach-detail-dialog'
  384. import ApproveComponent from '../common/approve-component'
  385. import { dealStepData, dealStepLogs } from '@/api/util'
  386. import { getDetail } from '@/api/quoted'
  387. import { getCoCode } from '@/api/cus'
  388. import { getProductList, getProductAllDetail } from '@/api/product'
  389. import {
  390. productTypeOption,
  391. taskTypeOption,
  392. rankTypeOption
  393. } from '@/utils/enums'
  394. import PreviewComponent from '@/views/modules/common/preview-component'
  395. export default {
  396. name: 'cus-quoted-detail',
  397. components: { PreviewComponent, EDesc, EDescItem, UploadComponent, AttachDetailDialog, ApproveComponent },
  398. props: {},
  399. data () {
  400. return {
  401. isFlow: false,
  402. previewVisible: false,
  403. id: 0,
  404. productTypeOption: productTypeOption,
  405. taskTypeOption: taskTypeOption,
  406. rankTypeOption: rankTypeOption,
  407. coOption: [],
  408. productIdOption: [],
  409. dataForm: {
  410. materialCost: 0,
  411. materialCostSecond: 0,
  412. totalPrice: 0,
  413. totalPriceSecond: 0,
  414. quotedPriceProductList: [], // 报价物料清单
  415. workInfoList: []
  416. },
  417. productList: [],
  418. activeNo: 0,
  419. stepList: [],
  420. logList: []
  421. }
  422. },
  423. watch: {},
  424. computed: {},
  425. created () {},
  426. mounted () {},
  427. activated () {},
  428. methods: {
  429. onChose () {
  430. this.$emit('onChose')
  431. },
  432. async init (id, businessType) {
  433. this.id = id || 0
  434. this.isFlow = !!(businessType && businessType !== '')
  435. this.dataForm = {
  436. workFlowBusinessExt: null
  437. }
  438. this.stepList = []
  439. this.logList = []
  440. await this.getCoCode()
  441. await this.getProductList()
  442. this.getDetail(id, businessType)
  443. },
  444. async getCoCode () {
  445. await getCoCode().then(({ data }) => {
  446. if (data && data.code === '200') {
  447. this.coOption = data.data
  448. }
  449. })
  450. },
  451. async getProductList (productName) {
  452. let params = {
  453. current: 1,
  454. size: 20,
  455. productName: productName
  456. }
  457. await getProductList(params).then(({ data }) => {
  458. if (data && data.code === '200') {
  459. this.productIdOption = []
  460. data.data.records.forEach((item) => {
  461. this.productIdOption.push({
  462. label: item.productName,
  463. value: item.productId
  464. })
  465. })
  466. }
  467. })
  468. },
  469. getDetail (id, businessType) {
  470. getDetail(id).then(({ data }) => {
  471. if (data && data.code === '200') {
  472. this.dataForm = data.data
  473. let find1 = this.coOption.find(
  474. (t) => t.coId === this.dataForm.coId
  475. )
  476. if (find1) {
  477. this.dataForm.coCode = find1.coCode
  478. }
  479. let find2 = this.productTypeOption.find(
  480. (t) => t.value === this.dataForm.type
  481. )
  482. if (find2) {
  483. this.dataForm.typeName = find2.label
  484. }
  485. let find3 = this.productIdOption.find(
  486. (t) => t.value === this.dataForm.productId
  487. )
  488. if (find3) {
  489. this.dataForm.productName = find3.label
  490. }
  491. this.productIdChangeHandle(this.dataForm.productId)
  492. // 流程图展示
  493. if (data.data.workFlowBusinessExt) {
  494. dealStepData(data.data.workFlowBusinessExt.workFlowProcessStepList, this.stepList)
  495. dealStepLogs(data.data.workFlowBusinessExt.processLogList, this.logList)
  496. }
  497. if (data.data.workFlowProcessStepList) {
  498. this.activeNo = Number(data.data.workFlowProcessStepList.activeNo)
  499. }
  500. // 初始化审批Form
  501. this.showApproveForm(businessType, id)
  502. }
  503. })
  504. },
  505. attachDetails (attachList) {
  506. this.$refs.attachDetail.init(attachList)
  507. },
  508. productIdChangeHandle (val) {
  509. if (val) {
  510. getProductAllDetail(val).then(({ data }) => {
  511. if (data && data.code === '200') {
  512. this.productList = data.data
  513. if (
  514. this.dataForm.quotedPriceProductList == null ||
  515. this.dataForm.quotedPriceProductList.length === 0
  516. ) {
  517. this.productList.forEach((item) => {
  518. this.dataForm.quotedPriceProductList.push({
  519. productId: item.productId
  520. })
  521. item.id = this.dataForm.quotedPriceProductList.find(
  522. (t) => t.productId === item.productId
  523. ).id
  524. })
  525. } else {
  526. this.dataForm.quotedPriceProductList.forEach((item) => {
  527. let tempItem = this.productList.find(
  528. (t) => t.productId === item.productId
  529. )
  530. if (tempItem) {
  531. item.productName = tempItem.productName
  532. item.productSpec = tempItem.productSpec
  533. item.mapNumber = tempItem.mapNumber
  534. item.materials = tempItem.materials
  535. item.cnt = tempItem.cnt
  536. item.unit = tempItem.unit
  537. item.size = tempItem.size
  538. item.developedSize = tempItem.developedSize
  539. item.surfaceTreatment = tempItem.surfaceTreatment
  540. item.notes = tempItem.notes
  541. }
  542. })
  543. }
  544. }
  545. })
  546. } else {
  547. this.productList = []
  548. }
  549. },
  550. // 初始化审批Form
  551. showApproveForm (businessType, businessId) {
  552. if (this.isFlow) {
  553. this.$nextTick(() => {
  554. this.$refs.approve.init(businessType, businessId)
  555. })
  556. }
  557. },
  558. // 审批完成
  559. approveFinished () {
  560. this.onChose()
  561. this.$emit('approveFinished')
  562. },
  563. // 预览
  564. previewFile (fileName, url) {
  565. this.previewVisible = true
  566. this.$nextTick(() => {
  567. this.$refs.preview.init(fileName, url)
  568. })
  569. }
  570. }
  571. }
  572. </script>
  573. <style scoped>
  574. .desc .desc-title {
  575. margin-bottom: 10px;
  576. color: #333;
  577. font-weight: 700;
  578. font-size: 16px;
  579. line-height: 1.5715;
  580. }
  581. </style>