赫艾前端
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.

433 lines
14 KiB

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
1 year 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
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" style="margin-top: 1px; margin-left: 0px;">
  4. <el-form-item :label="'派工单号'">
  5. <el-input v-model="searchData.seqNo" type="number" style="width: 120px"></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'物料编码'">
  8. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  9. </el-form-item>
  10. <el-form-item :label="'派工日期'">
  11. <el-date-picker
  12. style="width: 120px"
  13. v-model="searchData.startDate"
  14. type="date"
  15. value-format="yyyy-MM-dd"
  16. placeholder="选择日期">
  17. </el-date-picker>
  18. </el-form-item>
  19. <el-form-item :label="'至'">
  20. <el-date-picker
  21. style="width: 120px"
  22. v-model="searchData.endDate"
  23. type="date"
  24. value-format="yyyy-MM-dd"
  25. placeholder="选择日期">
  26. </el-date-picker>
  27. </el-form-item>
  28. <!-- <el-form-item label="差异超过1KG">-->
  29. <!-- <el-select v-model="searchData.sql" style="width: 120px">-->
  30. <!-- <el-option label="全部" value=""></el-option>-->
  31. <!-- <el-option label="是" value="( Round(dbo.Get_scheduleIssure(a.Site,a.SeqNo) -QtyReported*dbo.Get_PartWeightFactorForReport(a.Site,a.partNo,null),2) >1 or -1>Round(dbo.Get_scheduleIssure(a.Site,a.SeqNo) -QtyReported*dbo.Get_PartWeightFactorForReport(a.Site,a.partNo,null),2))"></el-option>-->
  32. <!-- </el-select>-->
  33. <!-- </el-form-item>-->
  34. <el-form-item :label="' '">
  35. <el-button type="primary" @click="searchTable()">查询</el-button>
  36. <download-excel
  37. :fields="fields()"
  38. :data="exportData"
  39. type="xls"
  40. :name="exportName"
  41. :header="exportHeader"
  42. :footer="exportFooter"
  43. :fetch="createExportData"
  44. :before-generate="startDownload"
  45. :before-finish="finishDownload"
  46. worksheet="导出信息"
  47. class="el-button el-button--primary el-button--medium">
  48. {{ '导出' }}
  49. </download-excel>
  50. </el-form-item>
  51. </el-form>
  52. <el-table
  53. :data="dataList"
  54. :height="height"
  55. border
  56. v-loading="dataListLoading"
  57. style="width: 100%; ">
  58. <el-table-column
  59. v-for="(item,index) in columnList1" :key="index"
  60. :sortable="item.columnSortable"
  61. :prop="item.columnProp"
  62. :header-align="item.headerAlign"
  63. :show-overflow-tooltip="item.showOverflowTooltip"
  64. :align="item.align"
  65. :fixed="item.fixed==''?false:item.fixed"
  66. :min-width="item.columnWidth"
  67. :label="item.columnLabel">
  68. <template slot-scope="scope">
  69. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  70. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  71. style="width: 100px; height: 80px"/></span>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <el-pagination
  76. @size-change="sizeChangeHandle"
  77. @current-change="currentChangeHandle"
  78. :current-page="pageIndex"
  79. :page-sizes="[20, 50, 100, 1000]"
  80. :page-size="pageSize"
  81. :total="totalPage"
  82. layout="total, sizes, prev, pager, next, jumper">
  83. </el-pagination>
  84. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  85. </div>
  86. </template>
  87. <script>
  88. import {
  89. liuhuaIssureAndReport,
  90. } from "@/api/production/query.js"
  91. import Chooselist from '@/views/modules/common/Chooselist'
  92. export default {
  93. components: {
  94. Chooselist
  95. },
  96. data() {
  97. return {
  98. dataList: [],
  99. searchData: {
  100. page: 1,
  101. limit: 20,
  102. site:this.$store.state.user.site,
  103. username: this.$store.state.user.name,
  104. seqNo: '',
  105. partNo :'',
  106. sql:'',
  107. startDate:'',
  108. endDate:'',
  109. },
  110. exportList:[],
  111. pageIndex: 1,
  112. pageSize: 20,
  113. totalPage: 0,
  114. visible:false,
  115. dataListLoading: false,
  116. columnList1:[
  117. {
  118. userId: this.$store.state.user.name,
  119. functionId: 400003,
  120. serialNumber: '400003Table1SeqNo',
  121. tableId: "400003Table1",
  122. tableName: "硫化发料产出",
  123. columnProp: "seqNo",
  124. headerAlign: "center",
  125. align: "left",
  126. columnLabel: "派工单",
  127. columnHidden: false,
  128. columnImage: false,
  129. columnSortable: false,
  130. sortLv: 0,
  131. status: true,
  132. fixed: '',
  133. columnWidth: 60
  134. },{
  135. userId: this.$store.state.user.name,
  136. functionId: 400003,
  137. serialNumber: '400003Table1PartNo',
  138. tableId: "400003Table1",
  139. tableName: "硫化发料产出",
  140. columnProp: "partNo",
  141. headerAlign: "center",
  142. align: "left",
  143. columnLabel: "物料编码",
  144. columnHidden: false,
  145. columnImage: false,
  146. columnSortable: false,
  147. sortLv: 0,
  148. status: true,
  149. fixed: '',
  150. columnWidth: 80
  151. },{
  152. userId: this.$store.state.user.name,
  153. functionId: 400003,
  154. serialNumber: '400003Table1PartDesc',
  155. tableId: "400003Table1",
  156. tableName: "硫化发料产出",
  157. columnProp: "partDesc",
  158. headerAlign: "center",
  159. align: "left",
  160. columnLabel: "物料名称",
  161. columnHidden: false,
  162. columnImage: false,
  163. columnSortable: false,
  164. sortLv: 0,
  165. status: true,
  166. fixed: '',
  167. columnWidth: 150
  168. },{
  169. userId: this.$store.state.user.name,
  170. functionId: 400003,
  171. serialNumber: '400003Table1OperatorId',
  172. tableId: "400003Table1",
  173. tableName: "硫化发料产出",
  174. columnProp: "operatorName",
  175. headerAlign: "center",
  176. align: "left",
  177. columnLabel: "操作员",
  178. columnHidden: false,
  179. columnImage: false,
  180. columnSortable: false,
  181. sortLv: 0,
  182. status: true,
  183. fixed: '',
  184. columnWidth: 80
  185. },{
  186. userId: this.$store.state.user.name,
  187. functionId: 400003,
  188. serialNumber: '400003Table1ScheduledDate',
  189. tableId: "400003Table1",
  190. tableName: "硫化发料产出",
  191. columnProp: "sScheduledDate",
  192. headerAlign: "center",
  193. align: "center",
  194. columnLabel: "派工日期",
  195. columnHidden: false,
  196. columnImage: false,
  197. columnSortable: false,
  198. sortLv: 0,
  199. status: true,
  200. fixed: '',
  201. columnWidth: 120
  202. },{
  203. userId: this.$store.state.user.name,
  204. functionId: 400003,
  205. serialNumber: '400003Table1QtyIssure',
  206. tableId: "400003Table1",
  207. tableName: "硫化发料产出",
  208. columnProp: "qtyIssure",
  209. headerAlign: "center",
  210. align: "right",
  211. columnLabel: "实际领料重量kg",
  212. columnHidden: false,
  213. columnImage: false,
  214. columnSortable: false,
  215. sortLv: 0,
  216. status: true,
  217. fixed: '',
  218. columnWidth: 80
  219. },{
  220. userId: this.$store.state.user.name,
  221. functionId: 400003,
  222. serialNumber: '400003Table1ReportWeight',
  223. tableId: "400003Table1",
  224. tableName: "硫化发料产出",
  225. columnProp: "reportWeight",
  226. headerAlign: "center",
  227. align: "right",
  228. columnLabel: "报工重量kg",
  229. columnHidden: false,
  230. columnImage: false,
  231. columnSortable: false,
  232. sortLv: 0,
  233. status: true,
  234. fixed: '',
  235. columnWidth: 80
  236. },{
  237. userId: this.$store.state.user.name,
  238. functionId: 400003,
  239. serialNumber: '400003Table1Qty',
  240. tableId: "400003Table1",
  241. tableName: "硫化发料产出",
  242. columnProp: "qty",
  243. headerAlign: "center",
  244. align: "right",
  245. columnLabel: "差异数kg",
  246. columnHidden: false,
  247. columnImage: false,
  248. columnSortable: false,
  249. sortLv: 0,
  250. status: true,
  251. fixed: '',
  252. columnWidth: 80
  253. },{
  254. userId: this.$store.state.user.name,
  255. functionId: 400003,
  256. serialNumber: '400003Table1Qty',
  257. tableId: "400003Table1",
  258. tableName: "硫化发料产出",
  259. columnProp: "realQty",
  260. headerAlign: "center",
  261. align: "right",
  262. columnLabel: "单体废边重量g",
  263. columnHidden: false,
  264. columnImage: false,
  265. columnSortable: false,
  266. sortLv: 0,
  267. status: true,
  268. fixed: '',
  269. columnWidth: 90
  270. },{
  271. userId: this.$store.state.user.name,
  272. functionId: 400003,
  273. serialNumber: '400003Table1IssurePartNo',
  274. tableId: "400003Table1",
  275. tableName: "硫化发料产出",
  276. columnProp: "issurePartNo",
  277. headerAlign: "center",
  278. align: "left",
  279. columnLabel: "发料物料",
  280. columnHidden: false,
  281. columnImage: false,
  282. columnSortable: false,
  283. sortLv: 0,
  284. status: true,
  285. fixed: '',
  286. columnWidth: 100
  287. },{
  288. userId: this.$store.state.user.name,
  289. functionId: 400003,
  290. serialNumber: '400003Table1TaskNo',
  291. tableId: "400003Table1",
  292. tableName: "硫化发料产出",
  293. columnProp: "taskNo",
  294. headerAlign: "center",
  295. align: "left",
  296. columnLabel: "混炼合并单",
  297. columnHidden: false,
  298. columnImage: false,
  299. columnSortable: false,
  300. sortLv: 0,
  301. status: true,
  302. fixed: '',
  303. columnWidth: 100
  304. },{
  305. userId: this.$store.state.user.name,
  306. functionId: 400003,
  307. serialNumber: '400003Table1IssurePartDesc',
  308. tableId: "400003Table1",
  309. tableName: "硫化发料产出",
  310. columnProp: "issurePartDesc",
  311. headerAlign: "center",
  312. align: "center",
  313. columnLabel: "发料物料名称型号",
  314. columnHidden: false,
  315. columnImage: false,
  316. columnSortable: false,
  317. sortLv: 0,
  318. status: true,
  319. fixed: '',
  320. columnWidth: 150
  321. },
  322. ],
  323. // 导出 start
  324. exportData: [],
  325. exportName: '硫化派工单收发记录'+this.dayjs().format('YYYYMMDDHHmmss'),
  326. exportHeader: ["硫化派工单收发记录"],
  327. exportFooter: [],
  328. // 导出 end
  329. height:200,
  330. }
  331. },
  332. mounted () {
  333. this.$nextTick(() => {
  334. this.height = window.innerHeight- 200
  335. })
  336. },
  337. methods: {
  338. // 获取基础数据列表S
  339. getBaseList (val, type) {
  340. this.tagNo = val
  341. this.tagNo1 = type
  342. this.$nextTick(() => {
  343. let strVal = ''
  344. if (val === 1013) {
  345. if(type==1) {
  346. strVal = this.dataForm.partType
  347. }
  348. }
  349. this.$refs.baseList.init(val, strVal)
  350. })
  351. },
  352. /* 列表方法的回调 */
  353. getBaseData (val) {
  354. if (this.tagNo === 1013) {
  355. if(this.tagNo1==1) {
  356. this.dataForm.partType = val.Base_id
  357. this.dataForm.partTypeDesc = val.Base_desc
  358. }
  359. }
  360. },
  361. //初始化组件的参数
  362. init(inData) {
  363. //初始化参数
  364. this.searchData = JSON.parse(JSON.stringify(inData));
  365. //刷新表格
  366. this.searchTable();
  367. },
  368. // 每页数
  369. sizeChangeHandle (val) {
  370. this.pageSize = val
  371. this.pageIndex = 1
  372. this.searchTable()
  373. },
  374. // 当前页
  375. currentChangeHandle (val) {
  376. this.pageIndex = val
  377. this.searchTable()
  378. },
  379. searchTable(){
  380. this.searchData.limit = this.pageSize
  381. this.searchData.page = this.pageIndex
  382. liuhuaIssureAndReport(this.searchData).then(({data}) => {
  383. if (data.code == 0) {
  384. this.dataList = data.page.list
  385. this.pageIndex = data.page.currPage
  386. this.pageSize = data.page.pageSize
  387. this.totalPage = data.page.totalCount
  388. }
  389. this.dataListLoading = false
  390. })
  391. },
  392. //导出excel
  393. //导出excel
  394. async createExportData() {
  395. this.searchData.limit = -1
  396. this.searchData.page = 1
  397. await liuhuaIssureAndReport(this.searchData).then(({data}) => {
  398. this.exportList= data.page.list;
  399. })
  400. return this.exportList;
  401. },
  402. startDownload() {
  403. // this.exportData = this.dataList
  404. },
  405. finishDownload() {
  406. },
  407. fields() {
  408. let json = "{"
  409. this.columnList1.forEach((item, index) => {
  410. if (index == this.columnList1.length - 1) {
  411. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  412. } else {
  413. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  414. }
  415. })
  416. json += "}"
  417. let s = eval("(" + json + ")")
  418. return s
  419. },
  420. },
  421. }
  422. </script>
  423. <style scoped>
  424. </style>