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.

397 lines
12 KiB

3 years ago
2 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
2 years ago
3 years ago
1 year ago
1 year ago
3 years ago
2 years ago
1 year ago
3 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
3 years ago
1 year ago
1 year ago
3 years ago
1 year ago
1 year ago
3 years ago
2 years ago
3 years ago
1 year ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
1 year ago
3 years ago
2 years ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  4. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  5. <!-- <el-button type="primary" @click="addModal()">新增</el-button>-->
  6. <download-excel
  7. :fields="fields()"
  8. :data="exportData"
  9. type="xls"
  10. :name="exportName"
  11. :header="exportHeader"
  12. :footer="exportFooter"
  13. :fetch="createExportData"
  14. :before-generate="startDownload"
  15. :before-finish="finishDownload"
  16. worksheet="导出信息"
  17. class="el-button el-button--primary el-button--medium">
  18. {{ '导出' }}
  19. </download-excel>
  20. </el-form>
  21. </el-form>
  22. <el-table
  23. :data="dataList"
  24. height="240"
  25. border
  26. v-loading="dataListLoading"
  27. style="width: 100%; ">
  28. <el-table-column
  29. v-for="(item,index) in columnList" :key="index"
  30. :sortable="item.columnSortable"
  31. :prop="item.columnProp"
  32. :header-align="item.headerAlign"
  33. :show-overflow-tooltip="item.showOverflowTooltip"
  34. :align="item.align"
  35. :fixed="item.fixed==''?false:item.fixed"
  36. :min-width="item.columnWidth"
  37. :label="item.columnLabel">
  38. <template slot-scope="scope">
  39. <div v-if="item.columnProp === 'quotationNo'">
  40. <el-link v-if="!item.columnHidden" @click="handleClick(scope.row)">{{ scope.row[item.columnProp] }}</el-link>
  41. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  42. </div>
  43. <div v-else>
  44. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  45. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  46. </div>
  47. </template>
  48. </el-table-column>
  49. <!-- <el-table-column-->
  50. <!-- header-align="center"-->
  51. <!-- align="center"-->
  52. <!-- width="150"-->
  53. <!-- fixed="right"-->
  54. <!-- label="操作">-->
  55. <!-- <template slot-scope="scope">-->
  56. <!-- <a type="text" size="small" @click="updateModel(scope.row)">修改</a>-->
  57. <!-- <a type="text" size="small" @click="deleteData(scope.row)">删除</a>-->
  58. <!-- </template>-->
  59. <!-- </el-table-column>-->
  60. </el-table>
  61. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  62. </div>
  63. </template>
  64. <script>
  65. import {
  66. quotationInformationSearch, // 询价信息列表查询
  67. quotationInformationSave, // 询价信息新增
  68. quotationInformationEdit, // 询价信息编辑
  69. quotationInformationDelete // 询价信息删除
  70. } from '@/api/quotation/quotationInformation.js'
  71. import Chooselist from '@/views/modules/common/Chooselist'
  72. export default {
  73. name:'projectQuotation',
  74. components: {
  75. Chooselist
  76. },
  77. data() {
  78. return {
  79. dataList: [],
  80. searchData: {
  81. site: '',
  82. username: this.$store.state.user.name,
  83. projectId: '',
  84. page: 1,
  85. limit: 1000
  86. },
  87. visible:false,
  88. dataListLoading: false,
  89. currentRow:'',
  90. columnList: [
  91. {
  92. userId: this.$store.state.user.name,
  93. functionId: 102001,
  94. serialNumber: '102001Table1QuotationNo',
  95. tableId: '102001Table1',
  96. tableName: '询价信息表',
  97. columnProp: 'quotationNo',
  98. headerAlign: 'center',
  99. align: 'center',
  100. columnLabel: '申请单号',
  101. columnHidden: false,
  102. columnImage: false,
  103. columnSortable: false,
  104. sortLv: 0,
  105. status: true,
  106. fixed: '',
  107. columnWidth: 120
  108. },
  109. {
  110. userId: this.$store.state.user.name,
  111. functionId: 102001,
  112. serialNumber: '102001Table1TestPartNo',
  113. tableId: '102001Table1',
  114. tableName: '询价信息表',
  115. columnProp: 'plmPartNo',
  116. headerAlign: 'center',
  117. align: 'left',
  118. columnLabel: 'PLM物料编码',
  119. columnHidden: false,
  120. columnImage: false,
  121. columnSortable: false,
  122. sortLv: 0,
  123. status: true,
  124. fixed: '',
  125. columnWidth: 160
  126. },
  127. {
  128. userId: this.$store.state.user.name,
  129. functionId: 102001,
  130. serialNumber: '102001Table1FinalPartNo',
  131. tableId: '102001Table1',
  132. tableName: '询价信息表',
  133. columnProp: 'finalPartNo',
  134. headerAlign: 'center',
  135. align: 'left',
  136. columnLabel: 'IFS物料编码',
  137. columnHidden: false,
  138. columnImage: false,
  139. columnSortable: false,
  140. sortLv: 0,
  141. status: true,
  142. fixed: '',
  143. columnWidth: 80
  144. },
  145. {
  146. userId: this.$store.state.user.name,
  147. functionId: 102001,
  148. serialNumber: '102001Table1PartName',
  149. tableId: '102001Table1',
  150. tableName: '询价信息表',
  151. columnProp: 'partName',
  152. headerAlign: 'center',
  153. align: 'left',
  154. columnLabel: '物料名称',
  155. columnHidden: false,
  156. columnImage: false,
  157. columnSortable: false,
  158. sortLv: 0,
  159. status: true,
  160. fixed: '',
  161. columnWidth: 160
  162. },
  163. {
  164. userId: this.$store.state.user.name,
  165. functionId: 102001,
  166. serialNumber: '102001Table1CustomerPartNo',
  167. tableId: '102001Table1',
  168. tableName: '询价信息表',
  169. columnProp: 'customerPartNo',
  170. headerAlign: 'center',
  171. align: 'left',
  172. columnLabel: '客户料号',
  173. columnHidden: false,
  174. columnImage: false,
  175. columnSortable: false,
  176. sortLv: 0,
  177. status: true,
  178. fixed: '',
  179. columnWidth: 80
  180. },
  181. {
  182. userId: this.$store.state.user.name,
  183. functionId: 102001,
  184. serialNumber: '102001Table1PriorityLevel',
  185. tableId: '102001Table1',
  186. tableName: '询价信息表',
  187. columnProp: 'priorityLevel',
  188. headerAlign: 'center',
  189. align: 'left',
  190. columnLabel: '优先等级',
  191. columnHidden: false,
  192. columnImage: false,
  193. columnSortable: false,
  194. sortLv: 0,
  195. status: true,
  196. fixed: '',
  197. columnWidth: 80
  198. },
  199. {
  200. userId: this.$store.state.user.name,
  201. functionId: 102001,
  202. serialNumber: '102001Table1RequiredCompletionDate',
  203. tableId: '102001Table1',
  204. tableName: '询价信息表',
  205. columnProp: 'requiredCompletionDate',
  206. headerAlign: 'center',
  207. align: 'center',
  208. columnLabel: '要求完成日期',
  209. columnHidden: false,
  210. columnImage: false,
  211. columnSortable: false,
  212. sortLv: 0,
  213. status: true,
  214. fixed: '',
  215. columnWidth: 160
  216. },
  217. {
  218. userId: this.$store.state.user.name,
  219. functionId: 102001,
  220. serialNumber: '102001Table1TrackerName',
  221. tableId: '102001Table1',
  222. tableName: '询价信息表',
  223. columnProp: 'trackerName',
  224. headerAlign: 'center',
  225. align: 'left',
  226. columnLabel: '采购专员',
  227. columnHidden: false,
  228. columnImage: false,
  229. columnSortable: false,
  230. sortLv: 0,
  231. status: true,
  232. fixed: '',
  233. columnWidth: 80
  234. },
  235. {
  236. userId: this.$store.state.user.name,
  237. functionId: 102001,
  238. serialNumber: '102001Table1QuoterName',
  239. tableId: '102001Table1',
  240. tableName: '询价信息表',
  241. columnProp: 'quoterName',
  242. headerAlign: 'center',
  243. align: 'left',
  244. columnLabel: '报价专员',
  245. columnHidden: false,
  246. columnImage: false,
  247. columnSortable: false,
  248. sortLv: 0,
  249. status: true,
  250. fixed: '',
  251. columnWidth: 80
  252. },
  253. {
  254. userId: this.$store.state.user.name,
  255. functionId: 102001,
  256. serialNumber: '102001Table1quotationStatus',
  257. tableId: '102001Table1',
  258. tableName: '询价信息表',
  259. columnProp: 'quotationStatus',
  260. headerAlign: 'center',
  261. align: 'center',
  262. columnLabel: '状态',
  263. columnHidden: false,
  264. columnImage: false,
  265. columnSortable: false,
  266. sortLv: 0,
  267. status: true,
  268. fixed: '',
  269. columnWidth: 100
  270. },
  271. {
  272. userId: this.$store.state.user.name,
  273. functionId: 102001,
  274. serialNumber: '102001Table1NodeName',
  275. tableId: '102001Table1',
  276. tableName: '询价信息表',
  277. columnProp: 'nodeName',
  278. headerAlign: 'center',
  279. align: 'center',
  280. columnLabel: '节点名称',
  281. columnHidden: false,
  282. columnImage: false,
  283. columnSortable: false,
  284. sortLv: 0,
  285. status: true,
  286. fixed: '',
  287. columnWidth: 100
  288. },
  289. {
  290. userId: this.$store.state.user.name,
  291. functionId: 102001,
  292. serialNumber: '102001Table1NodeCreateBy',
  293. tableId: '102001Table1',
  294. tableName: '询价信息表',
  295. columnProp: 'nodeCreateBy',
  296. headerAlign: 'center',
  297. align: 'center',
  298. columnLabel: '节点审批人',
  299. columnHidden: false,
  300. columnImage: false,
  301. columnSortable: false,
  302. sortLv: 0,
  303. status: true,
  304. fixed: '',
  305. columnWidth: 100
  306. },
  307. ],
  308. // 导出 start
  309. exportData: [],
  310. exportName: '项目询价'+this.dayjs().format('YYYYMMDDHHmmss'),
  311. exportHeader: ["项目询价"],
  312. exportFooter: [],
  313. // 导出 end
  314. }
  315. },
  316. methods: {
  317. // 获取基础数据列表S
  318. getBaseList (val, type) {
  319. this.tagNo = val
  320. this.tagNo1 = type
  321. this.$nextTick(() => {
  322. let strVal = ''
  323. if (val === 1013) {
  324. if(type==1) {
  325. strVal = this.dataForm.partType
  326. }
  327. }
  328. this.$refs.baseList.init(val, strVal)
  329. })
  330. },
  331. /* 列表方法的回调 */
  332. getBaseData (val) {
  333. if (this.tagNo === 1013) {
  334. if(this.tagNo1==1) {
  335. this.dataForm.partType = val.Base_id
  336. this.dataForm.partTypeDesc = val.Base_desc
  337. }
  338. }
  339. },
  340. //初始化组件的参数
  341. init(inData) {
  342. //初始化参数
  343. this.searchData = JSON.parse(JSON.stringify(inData));
  344. //刷新表格
  345. this.searchTable();
  346. },
  347. searchTable(){
  348. quotationInformationSearch(this.searchData).then(({data}) => {
  349. //区分请求成功和失败的状况
  350. if (data && data.code == 0) {
  351. this.dataList = data.page.list
  352. } else {
  353. this.dataList = [];
  354. }
  355. });
  356. },
  357. createExportData() {
  358. return this.dataList;
  359. },
  360. startDownload() {
  361. // this.exportData = this.dataList
  362. },
  363. finishDownload() {
  364. },
  365. fields() {
  366. let json = "{"
  367. this.columnList.forEach((item, index) => {
  368. if (index == this.columnList.length - 1) {
  369. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  370. } else {
  371. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  372. }
  373. })
  374. json += "}"
  375. let s = eval("(" + json + ")")
  376. return s
  377. },
  378. handleClick(row){
  379. if (this.$router.resolve(`/quotation-requestForQuote`).resolved.name === '404'){
  380. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  381. }else {
  382. this.$router.push({name:`quotation-requestForQuote`,params:{quotationNo:row.quotationNo},})
  383. }
  384. }
  385. },
  386. }
  387. </script>
  388. <style scoped>
  389. </style>