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.

442 lines
13 KiB

2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
  1. <script>
  2. import {queryQuoteGroupDetailByInquiry} from "../../../../api/quote/quoteGroupDetail";
  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: '26vh'
  13. },
  14. isExport:{
  15. type: Boolean,
  16. default: false
  17. }
  18. },
  19. data(){
  20. return{
  21. dataList:[],
  22. exportData: [],
  23. exportName: '项目报价'+this.dayjs().format('YYYYMMDDHHmmss'),
  24. exportHeader: ["项目报价"],
  25. exportFooter: [],
  26. queryLoading:false,
  27. columns:[
  28. {
  29. userId: this.$store.state.user.name,
  30. functionId: 101002002,
  31. serialNumber: '101002002Table2QuoteVersionNo',
  32. tableId: '101002002Table2',
  33. tableName: '报价详情信息表',
  34. columnProp: 'quoteVersionNo',
  35. headerAlign: 'center',
  36. align: 'left',
  37. columnLabel: '报价单号',
  38. columnHidden: false,
  39. columnImage: false,
  40. columnSortable: false,
  41. sortLv: 0,
  42. status: true,
  43. fixed: '',
  44. columnWidth: 120
  45. },
  46. {
  47. userId: this.$store.state.user.name,
  48. functionId: 101002002,
  49. serialNumber: '101002002Table2QuoteDate',
  50. tableId: '101002002Table2',
  51. tableName: '报价详情信息表',
  52. columnProp: 'quoteDate',
  53. headerAlign: 'center',
  54. align: 'left',
  55. columnLabel: '报价日期',
  56. columnHidden: false,
  57. columnImage: false,
  58. columnSortable: false,
  59. sortLv: 0,
  60. status: true,
  61. fixed: '',
  62. columnWidth: 120
  63. },
  64. {
  65. userId: this.$store.state.user.name,
  66. functionId: 101002002,
  67. serialNumber: '101002002Table2PartNo',
  68. tableId: '101002002Table2',
  69. tableName: '报价详情信息表',
  70. columnProp: 'plmPartNo',
  71. headerAlign: 'center',
  72. align: 'left',
  73. columnLabel: 'PLM物料编码',
  74. columnHidden: false,
  75. columnImage: false,
  76. columnSortable: false,
  77. sortLv: 0,
  78. status: true,
  79. fixed: '',
  80. columnWidth: 120
  81. },
  82. {
  83. userId: this.$store.state.user.name,
  84. functionId: 101002002,
  85. serialNumber: '101002002Table2PLMPartNo',
  86. tableId: '101002002Table2',
  87. tableName: '报价详情信息表',
  88. columnProp: 'ifsPartNo',
  89. headerAlign: 'center',
  90. align: 'left',
  91. columnLabel: 'IFS物料编码',
  92. columnHidden: false,
  93. columnImage: false,
  94. columnSortable: false,
  95. sortLv: 0,
  96. status: true,
  97. fixed: '',
  98. columnWidth: 120
  99. },
  100. {
  101. userId: this.$store.state.user.name,
  102. functionId: 101002002,
  103. serialNumber: '101002002Table2PartDesc',
  104. tableId: '101002002Table2',
  105. tableName: '报价详情信息表',
  106. columnProp: 'partDesc',
  107. headerAlign: 'center',
  108. align: 'left',
  109. columnLabel: '物料名称',
  110. columnHidden: false,
  111. columnImage: false,
  112. columnSortable: false,
  113. sortLv: 0,
  114. status: true,
  115. fixed: '',
  116. columnWidth: 240
  117. },
  118. {
  119. userId: this.$store.state.user.name,
  120. functionId: 101002002,
  121. serialNumber: '101002002Table2Qty',
  122. tableId: '101002002Table2',
  123. tableName: '报价详情信息表',
  124. columnProp: 'qty',
  125. headerAlign: 'center',
  126. align: 'right',
  127. columnLabel: 'MOQ',
  128. columnHidden: false,
  129. columnImage: false,
  130. columnSortable: false,
  131. sortLv: 0,
  132. status: true,
  133. fixed: '',
  134. columnWidth: 100
  135. },
  136. {
  137. userId: this.$store.state.user.name,
  138. functionId: 102001,
  139. serialNumber: '102001Table2Qty',
  140. tableId: '102001Table2',
  141. tableName: '报价详情信息表',
  142. columnProp: 'unitPrice',
  143. headerAlign: 'center',
  144. align: 'right',
  145. columnLabel: '未税单价',
  146. columnHidden: false,
  147. columnImage: false,
  148. columnSortable: false,
  149. sortLv: 0,
  150. status: true,
  151. fixed: '',
  152. columnWidth: 100
  153. },
  154. {
  155. userId: this.$store.state.user.name,
  156. functionId: 102001,
  157. serialNumber: '102001Table2Qty',
  158. tableId: '102001Table2',
  159. tableName: '报价详情信息表',
  160. columnProp: 'taxRate',
  161. headerAlign: 'center',
  162. align: 'right',
  163. columnLabel: '税率',
  164. columnHidden: false,
  165. columnImage: false,
  166. columnSortable: false,
  167. sortLv: 0,
  168. status: true,
  169. fixed: '',
  170. columnWidth: 100
  171. },
  172. {
  173. userId: this.$store.state.user.name,
  174. functionId: 102001,
  175. serialNumber: '102001Table2Qty',
  176. tableId: '102001Table2',
  177. tableName: '报价详情信息表',
  178. columnProp: 'exchangeRate1',
  179. headerAlign: 'center',
  180. align: 'right',
  181. columnLabel: '其他税率',
  182. columnHidden: false,
  183. columnImage: false,
  184. columnSortable: false,
  185. sortLv: 0,
  186. status: true,
  187. fixed: '',
  188. columnWidth: 100
  189. },
  190. {
  191. userId: this.$store.state.user.name,
  192. functionId: 102001,
  193. serialNumber: '102001Table2Qty',
  194. tableId: '102001Table2',
  195. tableName: '报价详情信息表',
  196. columnProp: 'taxUnitPrice',
  197. headerAlign: 'center',
  198. align: 'right',
  199. columnLabel: '含税单价(CNY)',
  200. columnHidden: false,
  201. columnImage: false,
  202. columnSortable: false,
  203. sortLv: 0,
  204. status: true,
  205. fixed: '',
  206. columnWidth: 100
  207. },
  208. {
  209. userId: this.$store.state.user.name,
  210. functionId: 102001,
  211. serialNumber: '102001Table2Qty',
  212. tableId: '102001Table2',
  213. tableName: '报价详情信息表',
  214. columnProp: 'currencyDesc2',
  215. headerAlign: 'center',
  216. align: 'right',
  217. columnLabel: '币种',
  218. columnHidden: false,
  219. columnImage: false,
  220. columnSortable: false,
  221. sortLv: 0,
  222. status: true,
  223. fixed: '',
  224. columnWidth: 100
  225. },
  226. {
  227. userId: this.$store.state.user.name,
  228. functionId: 102001,
  229. serialNumber: '102001Table2Qty',
  230. tableId: '102001Table2',
  231. tableName: '报价详情信息表',
  232. columnProp: 'exchangeRate2',
  233. headerAlign: 'center',
  234. align: 'right',
  235. columnLabel: '汇率',
  236. columnHidden: false,
  237. columnImage: false,
  238. columnSortable: false,
  239. sortLv: 0,
  240. status: true,
  241. fixed: '',
  242. columnWidth: 100
  243. },
  244. {
  245. userId: this.$store.state.user.name,
  246. functionId: 102001,
  247. serialNumber: '102001Table2Qty',
  248. tableId: '102001Table2',
  249. tableName: '报价详情信息表',
  250. columnProp: 'currencyTotalCost2',
  251. headerAlign: 'center',
  252. align: 'right',
  253. columnLabel: '含税单价',
  254. columnHidden: false,
  255. columnImage: false,
  256. columnSortable: false,
  257. sortLv: 0,
  258. status: true,
  259. fixed: '',
  260. columnWidth: 100
  261. },
  262. {
  263. userId: this.$store.state.user.name,
  264. functionId: 5011,
  265. serialNumber: '102001Table2Qty',
  266. tableId: '102001Table2',
  267. tableName: '报价详情信息表',
  268. columnProp: 'unitPrice',
  269. headerAlign: 'center',
  270. align: 'right',
  271. columnLabel: '未税单价(CNY)',
  272. columnHidden: false,
  273. columnImage: false,
  274. columnSortable: false,
  275. sortLv: 0,
  276. status: true,
  277. fixed: '',
  278. columnWidth: 100
  279. },
  280. {
  281. userId: this.$store.state.user.name,
  282. functionId: 5011,
  283. serialNumber: '102001Table2Qty',
  284. tableId: '102001Table2',
  285. tableName: '报价详情信息表',
  286. columnProp: 'unitPriceRate',
  287. headerAlign: 'center',
  288. align: 'right',
  289. columnLabel: '未税单价',
  290. columnHidden: false,
  291. columnImage: false,
  292. columnSortable: false,
  293. sortLv: 0,
  294. status: true,
  295. fixed: '',
  296. columnWidth: 100
  297. },
  298. {
  299. userId: this.$store.state.user.name,
  300. functionId: 101002002,
  301. serialNumber: '101002002Table2Remark',
  302. tableId: '101002002Table2',
  303. tableName: '报价详情信息表',
  304. columnProp: 'remark',
  305. headerAlign: 'center',
  306. align: 'left',
  307. columnLabel: '备注',
  308. columnHidden: false,
  309. columnImage: false,
  310. columnSortable: false,
  311. sortLv: 0,
  312. status: true,
  313. fixed: '',
  314. columnWidth: 120
  315. },
  316. {
  317. userId: this.$store.state.user.name,
  318. functionId: 101002002,
  319. serialNumber: '101002002Table2InsideInquiryNo',
  320. tableId: '101002002Table2',
  321. tableName: '报价详情信息表',
  322. columnProp: 'insideInquiryNo',
  323. headerAlign: 'center',
  324. align: 'left',
  325. columnLabel: '询价单号',
  326. columnHidden: false,
  327. columnImage: false,
  328. columnSortable: false,
  329. sortLv: 0,
  330. status: true,
  331. fixed: '',
  332. columnWidth: 120
  333. },
  334. ],
  335. }
  336. },
  337. methods:{
  338. handleQueryQuote(){
  339. let params = {
  340. site:this.part.site,
  341. projectNo:this.part.projectId,
  342. partNo:this.part.testPartNo,
  343. }
  344. this.queryLoading = true
  345. queryQuoteGroupDetailByInquiry(params).then(({data})=>{
  346. if (data && data.code === 0){
  347. this.dataList = data.rows
  348. }else {
  349. this.$message.warning(data.msg)
  350. }
  351. this.queryLoading = false
  352. }).catch((error)=>{
  353. this.$message.error(error)
  354. this.queryLoading = false
  355. })
  356. },
  357. handleClick(row){
  358. if (this.$router.resolve(`/quote-index`).resolved.name === '404'){
  359. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  360. }else {
  361. this.$router.push({
  362. name:`quote-index`,
  363. params:{
  364. quoteVersionNo:row.quoteVersionNo,
  365. type:'project'
  366. },
  367. })
  368. }
  369. },
  370. fields() {
  371. let json = "{"
  372. this.columns.forEach((item, index) => {
  373. if (index === this.columns.length - 1) {
  374. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  375. } else {
  376. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  377. }
  378. })
  379. json += "}"
  380. return eval("(" + json + ")")
  381. },
  382. createExportData() {
  383. return this.dataList;
  384. },
  385. },
  386. watch:{
  387. part(newVal,oldVal){
  388. if (newVal){
  389. this.handleQueryQuote()
  390. }else {
  391. this.dataList = []
  392. }
  393. }
  394. }
  395. }
  396. </script>
  397. <template>
  398. <div>
  399. <download-excel v-if="isExport"
  400. :fields="fields()"
  401. :data="exportData"
  402. type="xls"
  403. :name="exportName"
  404. :header="exportHeader"
  405. :footer="exportFooter"
  406. :fetch="createExportData"
  407. worksheet="导出信息"
  408. class="el-button el-button--primary el-button--medium">
  409. {{ '导出' }}
  410. </download-excel>
  411. <el-table :data="dataList" style="width: 100%;margin-top: 5px" :height="height" v-loading="queryLoading" border>
  412. <el-table-column
  413. v-for="(item,index) in columns" :key="index"
  414. :sortable="item.columnSortable"
  415. :prop="item.columnProp"
  416. :header-align="item.headerAlign"
  417. :show-overflow-tooltip="item.showOverflowTooltip"
  418. :align="item.align"
  419. :fixed="item.fixed===''?false:item.fixed"
  420. :min-width="item.columnWidth"
  421. :label="item.columnLabel">
  422. <template slot-scope="scope" >
  423. <div v-if="item.columnProp === 'quoteVersionNo'">
  424. <el-link v-if="!item.columnHidden" @click="handleClick(scope.row)"> {{ `${scope.row[item.columnProp]}` }}</el-link>
  425. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  426. </div>
  427. <div v-else>
  428. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp]}}</span>
  429. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  430. </div>
  431. </template>
  432. </el-table-column>
  433. </el-table>
  434. </div>
  435. </template>
  436. <style scoped>
  437. </style>