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.

396 lines
12 KiB

3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years 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. components: {
  74. Chooselist
  75. },
  76. data() {
  77. return {
  78. dataList: [],
  79. searchData: {
  80. site: '',
  81. username: this.$store.state.user.name,
  82. projectId: '',
  83. page: 1,
  84. limit: 1000
  85. },
  86. visible:false,
  87. dataListLoading: false,
  88. currentRow:'',
  89. columnList: [
  90. {
  91. userId: this.$store.state.user.name,
  92. functionId: 102001,
  93. serialNumber: '102001Table1QuotationNo',
  94. tableId: '102001Table1',
  95. tableName: '询价信息表',
  96. columnProp: 'quotationNo',
  97. headerAlign: 'center',
  98. align: 'center',
  99. columnLabel: '申请单号',
  100. columnHidden: false,
  101. columnImage: false,
  102. columnSortable: false,
  103. sortLv: 0,
  104. status: true,
  105. fixed: '',
  106. columnWidth: 120
  107. },
  108. {
  109. userId: this.$store.state.user.name,
  110. functionId: 102001,
  111. serialNumber: '102001Table1TrackerName',
  112. tableId: '102001Table1',
  113. tableName: '询价信息表',
  114. columnProp: 'trackerName',
  115. headerAlign: 'center',
  116. align: 'left',
  117. columnLabel: '采购专员',
  118. columnHidden: false,
  119. columnImage: false,
  120. columnSortable: false,
  121. sortLv: 0,
  122. status: true,
  123. fixed: '',
  124. columnWidth: 80
  125. },
  126. {
  127. userId: this.$store.state.user.name,
  128. functionId: 102001,
  129. serialNumber: '102001Table1QuoterName',
  130. tableId: '102001Table1',
  131. tableName: '询价信息表',
  132. columnProp: 'quoterName',
  133. headerAlign: 'center',
  134. align: 'left',
  135. columnLabel: '报价专员',
  136. columnHidden: false,
  137. columnImage: false,
  138. columnSortable: false,
  139. sortLv: 0,
  140. status: true,
  141. fixed: '',
  142. columnWidth: 80
  143. },
  144. {
  145. userId: this.$store.state.user.name,
  146. functionId: 102001,
  147. serialNumber: '102001Table1TestPartNo',
  148. tableId: '102001Table1',
  149. tableName: '询价信息表',
  150. columnProp: 'testPartNo',
  151. headerAlign: 'center',
  152. align: 'center',
  153. columnLabel: '物料编码',
  154. columnHidden: false,
  155. columnImage: false,
  156. columnSortable: false,
  157. sortLv: 0,
  158. status: true,
  159. fixed: '',
  160. columnWidth: 160
  161. },
  162. {
  163. userId: this.$store.state.user.name,
  164. functionId: 102001,
  165. serialNumber: '102001Table1PartName',
  166. tableId: '102001Table1',
  167. tableName: '询价信息表',
  168. columnProp: 'partName',
  169. headerAlign: 'center',
  170. align: 'left',
  171. columnLabel: '物料描述',
  172. columnHidden: false,
  173. columnImage: false,
  174. columnSortable: false,
  175. sortLv: 0,
  176. status: true,
  177. fixed: '',
  178. columnWidth: 100
  179. },
  180. {
  181. userId: this.$store.state.user.name,
  182. functionId: 102001,
  183. serialNumber: '102001Table1FinalPartNo',
  184. tableId: '102001Table1',
  185. tableName: '询价信息表',
  186. columnProp: 'finalPartNo',
  187. headerAlign: 'center',
  188. align: 'left',
  189. columnLabel: 'IFS料号',
  190. columnHidden: false,
  191. columnImage: false,
  192. columnSortable: false,
  193. sortLv: 0,
  194. status: true,
  195. fixed: '',
  196. columnWidth: 80
  197. },
  198. {
  199. userId: this.$store.state.user.name,
  200. functionId: 102001,
  201. serialNumber: '102001Table1CustomerPartNo',
  202. tableId: '102001Table1',
  203. tableName: '询价信息表',
  204. columnProp: 'customerPartNo',
  205. headerAlign: 'center',
  206. align: 'left',
  207. columnLabel: '客户料号',
  208. columnHidden: false,
  209. columnImage: false,
  210. columnSortable: false,
  211. sortLv: 0,
  212. status: true,
  213. fixed: '',
  214. columnWidth: 80
  215. },
  216. {
  217. userId: this.$store.state.user.name,
  218. functionId: 102001,
  219. serialNumber: '102001Table1PriorityLevel',
  220. tableId: '102001Table1',
  221. tableName: '询价信息表',
  222. columnProp: 'priorityLevel',
  223. headerAlign: 'center',
  224. align: 'left',
  225. columnLabel: '优先等级',
  226. columnHidden: false,
  227. columnImage: false,
  228. columnSortable: false,
  229. sortLv: 0,
  230. status: true,
  231. fixed: '',
  232. columnWidth: 80
  233. },
  234. {
  235. userId: this.$store.state.user.name,
  236. functionId: 102001,
  237. serialNumber: '102001Table1RequiredCompletionDate',
  238. tableId: '102001Table1',
  239. tableName: '询价信息表',
  240. columnProp: 'requiredCompletionDate',
  241. headerAlign: 'center',
  242. align: 'center',
  243. columnLabel: '要求完成日期',
  244. columnHidden: false,
  245. columnImage: false,
  246. columnSortable: false,
  247. sortLv: 0,
  248. status: true,
  249. fixed: '',
  250. columnWidth: 160
  251. },
  252. {
  253. userId: this.$store.state.user.name,
  254. functionId: 102001,
  255. serialNumber: '102001Table1quotationStatus',
  256. tableId: '102001Table1',
  257. tableName: '询价信息表',
  258. columnProp: 'quotationStatus',
  259. headerAlign: 'center',
  260. align: 'center',
  261. columnLabel: '状态',
  262. columnHidden: false,
  263. columnImage: false,
  264. columnSortable: false,
  265. sortLv: 0,
  266. status: true,
  267. fixed: '',
  268. columnWidth: 100
  269. },
  270. {
  271. userId: this.$store.state.user.name,
  272. functionId: 102001,
  273. serialNumber: '102001Table1NodeName',
  274. tableId: '102001Table1',
  275. tableName: '询价信息表',
  276. columnProp: 'nodeName',
  277. headerAlign: 'center',
  278. align: 'center',
  279. columnLabel: '节点名称',
  280. columnHidden: false,
  281. columnImage: false,
  282. columnSortable: false,
  283. sortLv: 0,
  284. status: true,
  285. fixed: '',
  286. columnWidth: 100
  287. },
  288. {
  289. userId: this.$store.state.user.name,
  290. functionId: 102001,
  291. serialNumber: '102001Table1NodeCreateBy',
  292. tableId: '102001Table1',
  293. tableName: '询价信息表',
  294. columnProp: 'nodeCreateBy',
  295. headerAlign: 'center',
  296. align: 'center',
  297. columnLabel: '节点审批人',
  298. columnHidden: false,
  299. columnImage: false,
  300. columnSortable: false,
  301. sortLv: 0,
  302. status: true,
  303. fixed: '',
  304. columnWidth: 100
  305. },
  306. ],
  307. // 导出 start
  308. exportData: [],
  309. exportName: '项目询价'+this.dayjs().format('YYYYMMDDHHmmss'),
  310. exportHeader: ["项目询价"],
  311. exportFooter: [],
  312. // 导出 end
  313. }
  314. },
  315. methods: {
  316. // 获取基础数据列表S
  317. getBaseList (val, type) {
  318. this.tagNo = val
  319. this.tagNo1 = type
  320. this.$nextTick(() => {
  321. let strVal = ''
  322. if (val === 1013) {
  323. if(type==1) {
  324. strVal = this.dataForm.partType
  325. }
  326. }
  327. this.$refs.baseList.init(val, strVal)
  328. })
  329. },
  330. /* 列表方法的回调 */
  331. getBaseData (val) {
  332. if (this.tagNo === 1013) {
  333. if(this.tagNo1==1) {
  334. this.dataForm.partType = val.Base_id
  335. this.dataForm.partTypeDesc = val.Base_desc
  336. }
  337. }
  338. },
  339. //初始化组件的参数
  340. init(inData) {
  341. //初始化参数
  342. this.searchData = JSON.parse(JSON.stringify(inData));
  343. //刷新表格
  344. this.searchTable();
  345. },
  346. searchTable(){
  347. quotationInformationSearch(this.searchData).then(({data}) => {
  348. //区分请求成功和失败的状况
  349. if (data && data.code == 0) {
  350. this.dataList = data.page.list
  351. } else {
  352. this.dataList = [];
  353. }
  354. });
  355. },
  356. createExportData() {
  357. return this.dataList;
  358. },
  359. startDownload() {
  360. // this.exportData = this.dataList
  361. },
  362. finishDownload() {
  363. },
  364. fields() {
  365. let json = "{"
  366. this.columnList.forEach((item, index) => {
  367. if (index == this.columnList.length - 1) {
  368. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  369. } else {
  370. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  371. }
  372. })
  373. json += "}"
  374. let s = eval("(" + json + ")")
  375. return s
  376. },
  377. handleClick(row){
  378. if (this.$router.resolve(`/quotation-requestForQuote`).resolved.name === '404'){
  379. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  380. }else {
  381. this.$router.push({name:`quotation-requestForQuote`,params:{quotationNo:row.quotationNo},})
  382. }
  383. }
  384. },
  385. }
  386. </script>
  387. <style scoped>
  388. </style>