plm前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

561 lines
17 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <script>
  2. import {queryQuoteByProjectPartNo} from "../../../../api/quotation/quote";
  3. export default {
  4. name: "projectPartQuote",
  5. props:{
  6. part:{
  7. type: Object,
  8. required: true
  9. },
  10. height:{
  11. type: [String,Number],
  12. default: '27vh'
  13. }
  14. },
  15. data(){
  16. return{
  17. dataList:[],
  18. queryLoading:false,
  19. columns:[
  20. {
  21. userId: this.$store.state.user.name,
  22. functionId: 101002002,
  23. serialNumber: '101002002Table10QuotationNo',
  24. tableId: '101002002Table10',
  25. tableName: '项目物料',
  26. columnProp: 'quotationNo',
  27. headerAlign: 'center',
  28. align: 'left',
  29. columnLabel: '报价单号',
  30. columnHidden: false,
  31. columnImage: false,
  32. columnSortable: false,
  33. sortLv: 0,
  34. status: true,
  35. fixed: '',
  36. columnWidth: 200
  37. },{
  38. userId: this.$store.state.user.name,
  39. functionId: 101002002,
  40. serialNumber: '101002002Table10QuotationDate',
  41. tableId: '101002002Table10',
  42. tableName: '项目物料',
  43. columnProp: 'quotationDate',
  44. headerAlign: 'center',
  45. align: 'center',
  46. columnLabel: '报价日期',
  47. columnHidden: false,
  48. columnImage: false,
  49. columnSortable: false,
  50. sortLv: 0,
  51. status: true,
  52. fixed: '',
  53. columnWidth: 200
  54. },
  55. {
  56. userId: this.$store.state.user.name,
  57. functionId: 101002002,
  58. serialNumber: '101002002Table10ProductNo',
  59. tableId: '101002002Table10',
  60. tableName: '项目物料',
  61. columnProp: 'productNo',
  62. headerAlign: 'center',
  63. align: 'left',
  64. columnLabel: '物料编码',
  65. columnHidden: false,
  66. columnImage: false,
  67. columnSortable: false,
  68. sortLv: 0,
  69. status: true,
  70. fixed: '',
  71. columnWidth: 200
  72. },
  73. {
  74. userId: this.$store.state.user.name,
  75. functionId: 101002002,
  76. serialNumber: '101002002Table10ProductDesc',
  77. tableId: '101002002Table10',
  78. tableName: '项目物料',
  79. columnProp: 'productDesc',
  80. headerAlign: 'center',
  81. align: 'left',
  82. columnLabel: '物料名称',
  83. columnHidden: false,
  84. columnImage: false,
  85. columnSortable: false,
  86. sortLv: 0,
  87. status: true,
  88. fixed: '',
  89. columnWidth: 200
  90. },
  91. {
  92. userId: this.$store.state.user.name,
  93. functionId: 101002002,
  94. serialNumber: '101002002Table10QuotationDetailQuantity',
  95. tableId: '101002002Table10',
  96. tableName: '项目物料',
  97. columnProp: 'quotationDetailQuantity',
  98. headerAlign: 'center',
  99. align: 'right',
  100. columnLabel: '报价数量',
  101. columnHidden: false,
  102. columnImage: false,
  103. columnSortable: false,
  104. sortLv: 0,
  105. status: true,
  106. fixed: '',
  107. columnWidth: 100
  108. },
  109. {
  110. userId: this.$store.state.user.name,
  111. functionId: 101002002,
  112. serialNumber: '101002002Table10ComputePartCost',
  113. tableId: '101002002Table10',
  114. tableName: '项目物料',
  115. columnProp: 'computePartCost',
  116. headerAlign: 'center',
  117. align: 'right',
  118. columnLabel: '计算后材料成本',
  119. columnHidden: false,
  120. columnImage: false,
  121. columnSortable: false,
  122. sortLv: 0,
  123. status: true,
  124. fixed: '',
  125. columnWidth: 120
  126. },{
  127. userId: this.$store.state.user.name,
  128. functionId: 101002002,
  129. serialNumber: '101002002Table10ComputeMachineCost',
  130. tableId: '101002002Table10',
  131. tableName: '项目物料',
  132. columnProp: 'computeMachineCost',
  133. headerAlign: 'center',
  134. align: 'right',
  135. columnLabel: '计算后机器成本',
  136. columnHidden: false,
  137. columnImage: false,
  138. columnSortable: false,
  139. sortLv: 0,
  140. status: true,
  141. fixed: '',
  142. columnWidth: 120
  143. },{
  144. userId: this.$store.state.user.name,
  145. functionId: 101002002,
  146. serialNumber: '101002002Table10ComputeLabourCost',
  147. tableId: '101002002Table10',
  148. tableName: '项目物料',
  149. columnProp: 'computeLabourCost',
  150. headerAlign: 'center',
  151. align: 'right',
  152. columnLabel: '计算后人工成本',
  153. columnHidden: false,
  154. columnImage: false,
  155. columnSortable: false,
  156. sortLv: 0,
  157. status: true,
  158. fixed: '',
  159. columnWidth: 120
  160. },
  161. {
  162. userId: this.$store.state.user.name,
  163. functionId: 101002002,
  164. serialNumber: '101002002Table10ComputeFabricateCost',
  165. tableId: '101002002Table10',
  166. tableName: '项目物料',
  167. columnProp: 'computeFabricateCost',
  168. headerAlign: 'center',
  169. align: 'right',
  170. columnLabel: '计算后制造费用',
  171. columnHidden: false,
  172. columnImage: false,
  173. columnSortable: false,
  174. sortLv: 0,
  175. status: true,
  176. fixed: '',
  177. columnWidth: 120
  178. },
  179. {
  180. userId: this.$store.state.user.name,
  181. functionId: 101002002,
  182. serialNumber: '101002002Table10ComputeToolCost',
  183. tableId: '101002002Table10',
  184. tableName: '项目物料',
  185. columnProp: 'computeToolCost',
  186. headerAlign: 'center',
  187. align: 'right',
  188. columnLabel: '计算后工具成本',
  189. columnHidden: false,
  190. columnImage: false,
  191. columnSortable: false,
  192. sortLv: 0,
  193. status: true,
  194. fixed: '',
  195. columnWidth: 120
  196. },
  197. {
  198. userId: this.$store.state.user.name,
  199. functionId: 101002002,
  200. serialNumber: '101002002Table10AdjustPartCost',
  201. tableId: '101002002Table10',
  202. tableName: '项目物料',
  203. columnProp: 'adjustPartCost',
  204. headerAlign: 'center',
  205. align: 'right',
  206. columnLabel: '调整后材料成本',
  207. columnHidden: false,
  208. columnImage: false,
  209. columnSortable: false,
  210. sortLv: 0,
  211. status: true,
  212. fixed: '',
  213. columnWidth: 120
  214. },
  215. {
  216. userId: this.$store.state.user.name,
  217. functionId: 101002002,
  218. serialNumber: '101002002Table10AdjustMachineCost',
  219. tableId: '101002002Table10',
  220. tableName: '项目物料',
  221. columnProp: 'adjustMachineCost',
  222. headerAlign: 'center',
  223. align: 'right',
  224. columnLabel: '调整后机器成本',
  225. columnHidden: false,
  226. columnImage: false,
  227. columnSortable: false,
  228. sortLv: 0,
  229. status: true,
  230. fixed: '',
  231. columnWidth: 120
  232. },
  233. {
  234. userId: this.$store.state.user.name,
  235. functionId: 101002002,
  236. serialNumber: '101002002Table10AdjustLabourCost',
  237. tableId: '101002002Table10',
  238. tableName: '项目物料',
  239. columnProp: 'adjustLabourCost',
  240. headerAlign: 'center',
  241. align: 'right',
  242. columnLabel: '调整后人工成本',
  243. columnHidden: false,
  244. columnImage: false,
  245. columnSortable: false,
  246. sortLv: 0,
  247. status: true,
  248. fixed: '',
  249. columnWidth: 120
  250. },
  251. {
  252. userId: this.$store.state.user.name,
  253. functionId: 101002002,
  254. serialNumber: '101002002Table10AdjustFabricateCost',
  255. tableId: '101002002Table10',
  256. tableName: '项目物料',
  257. columnProp: 'adjustFabricateCost',
  258. headerAlign: 'center',
  259. align: 'right',
  260. columnLabel: '调整后制造费用',
  261. columnHidden: false,
  262. columnImage: false,
  263. columnSortable: false,
  264. sortLv: 0,
  265. status: true,
  266. fixed: '',
  267. columnWidth: 120
  268. },{
  269. userId: this.$store.state.user.name,
  270. functionId: 101002002,
  271. serialNumber: '101002002Table10AdjustToolCost',
  272. tableId: '101002002Table10',
  273. tableName: '项目物料',
  274. columnProp: 'adjustToolCost',
  275. headerAlign: 'center',
  276. align: 'right',
  277. columnLabel: '调整后工具成本',
  278. columnHidden: false,
  279. columnImage: false,
  280. columnSortable: false,
  281. sortLv: 0,
  282. status: true,
  283. fixed: '',
  284. columnWidth: 120
  285. },{
  286. userId: this.$store.state.user.name,
  287. functionId: 101002002,
  288. serialNumber: '101002002Table10DetailOtherCost',
  289. tableId: '101002002Table10',
  290. tableName: '项目物料',
  291. columnProp: 'detailOtherCost',
  292. headerAlign: 'center',
  293. align: 'right',
  294. columnLabel: '其他成本',
  295. columnHidden: false,
  296. columnImage: false,
  297. columnSortable: false,
  298. sortLv: 0,
  299. status: true,
  300. fixed: '',
  301. columnWidth: 120
  302. },{
  303. userId: this.$store.state.user.name,
  304. functionId: 101002002,
  305. serialNumber: '101002002Table10DetailManageCost',
  306. tableId: '101002002Table10',
  307. tableName: '项目物料',
  308. columnProp: 'detailManageCost',
  309. headerAlign: 'center',
  310. align: 'right',
  311. columnLabel: '管理成本',
  312. columnHidden: false,
  313. columnImage: false,
  314. columnSortable: false,
  315. sortLv: 0,
  316. status: true,
  317. fixed: '',
  318. columnWidth: 120
  319. },{
  320. userId: this.$store.state.user.name,
  321. functionId: 101002002,
  322. serialNumber: '101002002Table10DetailTotalCost',
  323. tableId: '101002002Table10',
  324. tableName: '项目物料',
  325. columnProp: 'detailTotalCost',
  326. headerAlign: 'center',
  327. align: 'right',
  328. columnLabel: '总成本',
  329. columnHidden: false,
  330. columnImage: false,
  331. columnSortable: false,
  332. sortLv: 0,
  333. status: true,
  334. fixed: '',
  335. columnWidth: 120
  336. },{
  337. userId: this.$store.state.user.name,
  338. functionId: 101002002,
  339. serialNumber: '101002002Table10DetailProfitRate',
  340. tableId: '101002002Table10',
  341. tableName: '项目物料',
  342. columnProp: 'detailProfitRate',
  343. headerAlign: 'center',
  344. align: 'right',
  345. columnLabel: '利润率%',
  346. columnHidden: false,
  347. columnImage: false,
  348. columnSortable: false,
  349. sortLv: 0,
  350. status: true,
  351. fixed: '',
  352. columnWidth: 120
  353. },{
  354. userId: this.$store.state.user.name,
  355. functionId: 101002002,
  356. serialNumber: '101002002Table10DetailProfitAmount',
  357. tableId: '101002002Table10',
  358. tableName: '项目物料',
  359. columnProp: 'detailProfitAmount',
  360. headerAlign: 'center',
  361. align: 'right',
  362. columnLabel: '利润额',
  363. columnHidden: false,
  364. columnImage: false,
  365. columnSortable: false,
  366. sortLv: 0,
  367. status: true,
  368. fixed: '',
  369. columnWidth: 120
  370. },{
  371. userId: this.$store.state.user.name,
  372. functionId: 101002002,
  373. serialNumber: '101002002Table10FinalUntaxedPrice',
  374. tableId: '101002002Table10',
  375. tableName: '项目物料',
  376. columnProp: 'finalUntaxedPrice',
  377. headerAlign: 'center',
  378. align: 'right',
  379. columnLabel: '未税单价',
  380. columnHidden: false,
  381. columnImage: false,
  382. columnSortable: false,
  383. sortLv: 0,
  384. status: true,
  385. fixed: '',
  386. columnWidth: 120
  387. },{
  388. userId: this.$store.state.user.name,
  389. functionId: 101002002,
  390. serialNumber: '101002002Table10TaxRate',
  391. tableId: '101002002Table10',
  392. tableName: '项目物料',
  393. columnProp: 'taxRate',
  394. headerAlign: 'center',
  395. align: 'right',
  396. columnLabel: '税率%',
  397. columnHidden: false,
  398. columnImage: false,
  399. columnSortable: false,
  400. sortLv: 0,
  401. status: true,
  402. fixed: '',
  403. columnWidth: 120
  404. },{
  405. userId: this.$store.state.user.name,
  406. functionId: 101002002,
  407. serialNumber: '101002002Table10FinalTaxedPrice',
  408. tableId: '101002002Table10',
  409. tableName: '项目物料',
  410. columnProp: 'finalTaxedPrice',
  411. headerAlign: 'center',
  412. align: 'right',
  413. columnLabel: '含税单价',
  414. columnHidden: false,
  415. columnImage: false,
  416. columnSortable: false,
  417. sortLv: 0,
  418. status: true,
  419. fixed: '',
  420. columnWidth: 120
  421. },{
  422. userId: this.$store.state.user.name,
  423. functionId: 101002002,
  424. serialNumber: '101002002Table10SystemComputePrice',
  425. tableId: '101002002Table10',
  426. tableName: '项目物料',
  427. columnProp: 'systemComputePrice',
  428. headerAlign: 'center',
  429. align: 'right',
  430. columnLabel: '含税总价',
  431. columnHidden: false,
  432. columnImage: false,
  433. columnSortable: false,
  434. sortLv: 0,
  435. status: true,
  436. fixed: '',
  437. columnWidth: 120
  438. },{
  439. userId: this.$store.state.user.name,
  440. functionId: 101002002,
  441. serialNumber: '101002002Table10QuotationDetailStatus',
  442. tableId: '101002002Table10',
  443. tableName: '项目物料',
  444. columnProp: 'quotationDetailStatus',
  445. headerAlign: 'center',
  446. align: 'center',
  447. columnLabel: '状态',
  448. columnHidden: false,
  449. columnImage: false,
  450. columnSortable: false,
  451. sortLv: 0,
  452. status: true,
  453. fixed: '',
  454. columnWidth: 120
  455. },{
  456. userId: this.$store.state.user.name,
  457. functionId: 101002002,
  458. serialNumber: '101002002Table10Remark',
  459. tableId: '101002002Table10',
  460. tableName: '项目物料',
  461. columnProp: 'remark',
  462. headerAlign: 'center',
  463. align: 'left',
  464. columnLabel: '备注',
  465. columnHidden: false,
  466. columnImage: false,
  467. columnSortable: false,
  468. sortLv: 0,
  469. status: true,
  470. fixed: '',
  471. columnWidth: 120
  472. },{
  473. userId: this.$store.state.user.name,
  474. functionId: 101002002,
  475. serialNumber: '101002002Table10InternalInquiryNo',
  476. tableId: '101002002Table10',
  477. tableName: '项目物料',
  478. columnProp: 'internalInquiryNo',
  479. headerAlign: 'center',
  480. align: 'left',
  481. columnLabel: '询价单号',
  482. columnHidden: false,
  483. columnImage: false,
  484. columnSortable: false,
  485. sortLv: 0,
  486. status: true,
  487. fixed: '',
  488. columnWidth: 120
  489. },
  490. ],
  491. }
  492. },
  493. methods:{
  494. handleQueryQuote(){
  495. let params = {
  496. site:this.part.site,
  497. projectId:this.part.projectId,
  498. partNo:this.part.testPartNo,
  499. }
  500. this.queryLoading = true
  501. queryQuoteByProjectPartNo(params).then(({data})=>{
  502. if (data && data.code === 0){
  503. this.dataList = data.rows
  504. }else {
  505. this.$message.warning(data.msg)
  506. }
  507. this.queryLoading = false
  508. }).catch((error)=>{
  509. this.$message.error(error)
  510. this.queryLoading = false
  511. })
  512. },
  513. handleClick(row){
  514. if (this.$router.resolve(`/quotation-sellForQuotation`).resolved.name === '404'){
  515. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  516. }else {
  517. this.$router.push({name:`quotation-sellForQuotation`,params:{quotationNo:row.quotationNo},})
  518. }
  519. }
  520. },
  521. watch:{
  522. part(newVal,oldVal){
  523. if (newVal){
  524. this.handleQueryQuote()
  525. }
  526. }
  527. }
  528. }
  529. </script>
  530. <template>
  531. <el-table :data="dataList" style="width: 100%;margin-top: 5px" :height="height" v-loading="queryLoading" border>
  532. <el-table-column
  533. v-for="(item,index) in columns" :key="index"
  534. :sortable="item.columnSortable"
  535. :prop="item.columnProp"
  536. :header-align="item.headerAlign"
  537. :show-overflow-tooltip="item.showOverflowTooltip"
  538. :align="item.align"
  539. :fixed="item.fixed===''?false:item.fixed"
  540. :min-width="item.columnWidth"
  541. :label="item.columnLabel">
  542. <template slot-scope="scope" >
  543. <div v-if="item.columnProp === 'quotationNo'">
  544. <el-link v-if="!item.columnHidden" @click="handleClick(scope.row)"> {{ `${scope.row[item.columnProp]}` }}</el-link>
  545. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  546. </div>
  547. <div v-else>
  548. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp]}}</span>
  549. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  550. </div>
  551. </template>
  552. </el-table-column>
  553. </el-table>
  554. </template>
  555. <style scoped>
  556. </style>