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.

446 lines
14 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year 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 {searchProjectToolApplyDetail
  66. } from "@/api/tool/toolApply.js"
  67. import Chooselist from '@/views/modules/common/Chooselist'
  68. export default {
  69. components: {
  70. Chooselist
  71. },
  72. data() {
  73. return {
  74. dataList: [],
  75. searchData: {
  76. site: '',
  77. username: this.$store.state.user.name,
  78. orderRef1: '',
  79. page: 1,
  80. limit: 1000
  81. },
  82. visible:false,
  83. dataListLoading: false,
  84. currentRow:'',
  85. columnList: [
  86. {
  87. userId: this.$store.state.user.name,
  88. functionId: 101002001,
  89. serialNumber: '101002001Table10ApplyNo',
  90. tableId: '101002001Table10',
  91. tableName: '工具申请明细',
  92. columnProp: 'applyNo',
  93. headerAlign: 'center',
  94. align: 'center',
  95. columnLabel: '申请单号',
  96. columnHidden: false,
  97. columnImage: false,
  98. columnSortable: false,
  99. sortLv: 0,
  100. status: true,
  101. fixed: '',
  102. columnWidth: 70
  103. },
  104. {
  105. userId: this.$store.state.user.name,
  106. functionId: 101002001,
  107. serialNumber: '101002001Table10SeqNo',
  108. tableId: '101002001Table10',
  109. tableName: '工具申请明细',
  110. columnProp: 'seqNo',
  111. headerAlign: 'center',
  112. align: 'center',
  113. columnLabel: '序号',
  114. columnHidden: false,
  115. columnImage: false,
  116. columnSortable: false,
  117. sortLv: 0,
  118. status: true,
  119. fixed: '',
  120. columnWidth: 40
  121. },
  122. {
  123. userId: this.$store.state.user.name,
  124. functionId: 101002001,
  125. serialNumber: '101002001Table10ToolNo',
  126. tableId: '101002001Table10',
  127. tableName: '工具申请明细',
  128. columnProp: 'toolId',
  129. headerAlign: 'center',
  130. align: 'center',
  131. columnLabel: '工具编码',
  132. columnHidden: false,
  133. columnImage: false,
  134. columnSortable: false,
  135. sortLv: 0,
  136. status: true,
  137. fixed: '',
  138. columnWidth: 70
  139. },
  140. {
  141. userId: this.$store.state.user.name,
  142. functionId: 101002001,
  143. serialNumber: '101002001Table10ToolDescription',
  144. tableId: '101002001Table10',
  145. tableName: '工具申请明细',
  146. columnProp: 'toolDesc',
  147. headerAlign: 'center',
  148. align: 'center',
  149. columnLabel: '工具描述',
  150. columnHidden: false,
  151. columnImage: false,
  152. columnSortable: false,
  153. sortLv: 0,
  154. status: true,
  155. fixed: '',
  156. columnWidth: 120
  157. },
  158. {
  159. userId: this.$store.state.user.name,
  160. functionId: 101002001,
  161. serialNumber: '101002001Table10ApplyQty',
  162. tableId: '101002001Table10',
  163. tableName: '工具申请明细',
  164. columnProp: 'applyQty',
  165. headerAlign: 'center',
  166. align: 'center',
  167. columnLabel: '申请数量',
  168. columnHidden: false,
  169. columnImage: false,
  170. columnSortable: false,
  171. sortLv: 0,
  172. status: true,
  173. fixed: '',
  174. columnWidth: 60
  175. },
  176. {
  177. userId: this.$store.state.user.name,
  178. functionId: 101002001,
  179. serialNumber: '101002001Table10UnitCost',
  180. tableId: '101002001Table10',
  181. tableName: '工具申请明细',
  182. columnProp: 'standardCost',
  183. headerAlign: 'center',
  184. align: 'center',
  185. columnLabel: '工具成本',
  186. columnHidden: false,
  187. columnImage: false,
  188. columnSortable: false,
  189. sortLv: 0,
  190. status: true,
  191. fixed: '',
  192. columnWidth: 60
  193. },
  194. {
  195. userId: this.$store.state.user.name,
  196. functionId: 101002001,
  197. serialNumber: '101002001Table10Remark',
  198. tableId: '101002001Table10',
  199. tableName: '工具申请明细',
  200. columnProp: 'remark',
  201. headerAlign: 'center',
  202. align: 'center',
  203. columnLabel: '备注',
  204. columnHidden: false,
  205. columnImage: false,
  206. columnSortable: false,
  207. sortLv: 0,
  208. status: true,
  209. fixed: '',
  210. columnWidth: 200
  211. },
  212. {
  213. userId: this.$store.state.user.name,
  214. functionId: 101002001,
  215. serialNumber: '101002001Table10NodeId',
  216. tableId: "101002001Table10",
  217. tableName: "技术参数卡列表",
  218. columnProp: "nodeId",
  219. headerAlign: "center",
  220. align: "left",
  221. columnLabel: "当前节点",
  222. columnHidden: false,
  223. columnImage: false,
  224. columnSortable: false,
  225. sortLv: 0,
  226. status: true,
  227. fixed: '',
  228. columnWidth: 70
  229. },
  230. {
  231. userId: this.$store.state.user.name,
  232. functionId: 101002001,
  233. serialNumber: '101002001Table10NodeName',
  234. tableId: "101002001Table10",
  235. tableName: "技术参数卡列表",
  236. columnProp: "nodeName",
  237. headerAlign: "center",
  238. align: "left",
  239. columnLabel: "节点名称",
  240. columnHidden: false,
  241. columnImage: false,
  242. columnSortable: false,
  243. sortLv: 0,
  244. status: true,
  245. fixed: '',
  246. columnWidth: 150
  247. },{
  248. userId: this.$store.state.user.name,
  249. functionId: 101002001,
  250. serialNumber: '101002001Table10SP',
  251. tableId: "101002001Table10",
  252. tableName: "技术参数卡列表",
  253. columnProp: "sp",
  254. headerAlign: "center",
  255. align: "left",
  256. columnLabel: "当前审批人",
  257. columnHidden: false,
  258. columnImage: false,
  259. columnSortable: false,
  260. sortLv: 0,
  261. status: true,
  262. fixed: '',
  263. columnWidth: 80
  264. },
  265. {
  266. userId: this.$store.state.user.name,
  267. functionId: 101002001,
  268. serialNumber: '101002001Table10QuotationNo',
  269. tableId: '101002001Table10',
  270. tableName: '工具申请明细',
  271. columnProp: 'orderRef2',
  272. headerAlign: 'center',
  273. align: 'center',
  274. columnLabel: '物料编码',
  275. columnHidden: false,
  276. columnImage: false,
  277. columnSortable: false,
  278. sortLv: 0,
  279. status: true,
  280. fixed: '',
  281. columnWidth: 70
  282. }, {
  283. userId: this.$store.state.user.name,
  284. functionId: 101002001,
  285. serialNumber: '101002001Table10QuotationNo',
  286. tableId: '101002001Table10',
  287. tableName: '工具申请明细',
  288. columnProp: 'orderRef3',
  289. headerAlign: 'center',
  290. align: 'center',
  291. columnLabel: '工艺路线版本',
  292. columnHidden: false,
  293. columnImage: false,
  294. columnSortable: false,
  295. sortLv: 0,
  296. status: true,
  297. fixed: '',
  298. columnWidth: 70
  299. },
  300. {
  301. userId: this.$store.state.user.name,
  302. functionId: 101002001,
  303. serialNumber: '101002001Table10QuotationNo',
  304. tableId: '101002001Table10',
  305. tableName: '工具申请明细',
  306. columnProp: 'orderRef5',
  307. headerAlign: 'center',
  308. align: 'center',
  309. columnLabel: '替代编码',
  310. columnHidden: false,
  311. columnImage: false,
  312. columnSortable: false,
  313. sortLv: 0,
  314. status: true,
  315. fixed: '',
  316. columnWidth: 70
  317. },{
  318. userId: this.$store.state.user.name,
  319. functionId: 101002001,
  320. serialNumber: '101002001Table10QuotationNo',
  321. tableId: '101002001Table10',
  322. tableName: '工具申请明细',
  323. columnProp: 'operationNo',
  324. headerAlign: 'center',
  325. align: 'center',
  326. columnLabel: '工序号',
  327. columnHidden: false,
  328. columnImage: false,
  329. columnSortable: false,
  330. sortLv: 0,
  331. status: true,
  332. fixed: '',
  333. columnWidth: 70
  334. },{
  335. userId: this.$store.state.user.name,
  336. functionId: 101002001,
  337. serialNumber: '101002001Table10QuotationNo',
  338. tableId: '101002001Table10',
  339. tableName: '工具申请明细',
  340. columnProp: 'operationName',
  341. headerAlign: 'center',
  342. align: 'center',
  343. columnLabel: '工序',
  344. columnHidden: false,
  345. columnImage: false,
  346. columnSortable: false,
  347. sortLv: 0,
  348. status: true,
  349. fixed: '',
  350. columnWidth: 70
  351. },
  352. ],
  353. // 导出 start
  354. exportData: [],
  355. exportName: '项目询价'+this.dayjs().format('YYYYMMDDHHmmss'),
  356. exportHeader: ["项目询价"],
  357. exportFooter: [],
  358. // 导出 end
  359. }
  360. },
  361. methods: {
  362. // 获取基础数据列表S
  363. getBaseList (val, type) {
  364. this.tagNo = val
  365. this.tagNo1 = type
  366. this.$nextTick(() => {
  367. let strVal = ''
  368. if (val === 1013) {
  369. if(type==1) {
  370. strVal = this.dataForm.partType
  371. }
  372. }
  373. this.$refs.baseList.init(val, strVal)
  374. })
  375. },
  376. /* 列表方法的回调 */
  377. getBaseData (val) {
  378. if (this.tagNo === 1013) {
  379. if(this.tagNo1==1) {
  380. this.dataForm.partType = val.Base_id
  381. this.dataForm.partTypeDesc = val.Base_desc
  382. }
  383. }
  384. },
  385. //初始化组件的参数
  386. init(inData) {
  387. //初始化参数
  388. this.searchData = JSON.parse(JSON.stringify(inData));
  389. //刷新表格
  390. this.searchTable();
  391. },
  392. searchTable(){
  393. if(this.searchData.orderRef1==null||this.searchData.orderRef1===''){
  394. this.dataList = [];
  395. }else {
  396. searchProjectToolApplyDetail(this.searchData).then(({data}) => {
  397. //区分请求成功和失败的状况
  398. if (data && data.code == 0) {
  399. this.dataList = data.rows
  400. } else {
  401. this.dataList = [];
  402. }
  403. });
  404. }
  405. },
  406. createExportData() {
  407. return this.dataList;
  408. },
  409. startDownload() {
  410. // this.exportData = this.dataList
  411. },
  412. finishDownload() {
  413. },
  414. fields() {
  415. let json = "{"
  416. this.columnList.forEach((item, index) => {
  417. if (index == this.columnList.length - 1) {
  418. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  419. } else {
  420. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  421. }
  422. })
  423. json += "}"
  424. let s = eval("(" + json + ")")
  425. return s
  426. },
  427. handleClick(row){
  428. if (this.$router.resolve(`/quotation-requestForQuote`).resolved.name === '404'){
  429. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  430. }else {
  431. this.$router.push({name:`quotation-requestForQuote`,params:{quotationNo:row.quotationNo},})
  432. }
  433. }
  434. },
  435. }
  436. </script>
  437. <style scoped>
  438. </style>