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

522 lines
16 KiB

3 years ago
​
​
​
​
​
2 years ago
​
​
​
3 years ago
3 years ago
​
​
​
​
​
3 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
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
3 years ago
​
​
2 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" >
  4. <el-form-item :label="'工厂编码'">
  5. <el-input v-model="searchData.site" style="width: 130px"></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'客户编码'">
  8. <span slot="label" @click="getBaseList(12)"><a >客户编码</a></span>
  9. <el-input v-model="searchData.customerId" style="width: 130px" clearable></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'生产订单号'">
  12. <el-input v-model="searchData.orderNo" style="width: 200px"></el-input>
  13. </el-form-item>
  14. <el-form-item >
  15. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">产品编码</a></span>
  16. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'规格型号'">
  19. <el-input v-model="searchData.partSpec" style="width: 200px"></el-input>
  20. </el-form-item>
  21. <el-form-item label="只查询未关闭订单">
  22. <el-select v-model="searchData.closedFlag" style="width: 120px">
  23. <el-option label="是" value="Y"></el-option>
  24. <el-option label="否" value=""></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item :label="'录入日期:'">
  28. <el-date-picker
  29. style="width: 130px"
  30. v-model="searchData.startDate"
  31. value-format="yyyy-MM-dd"
  32. placeholder="选择日期">
  33. </el-date-picker>
  34. </el-form-item>
  35. <el-form-item :label="'到:'">
  36. <el-date-picker
  37. style="width: 130px"
  38. v-model="searchData.endDate"
  39. value-format="yyyy-MM-dd"
  40. placeholder="选择日期">
  41. </el-date-picker>
  42. </el-form-item>
  43. <el-form-item :label="'完成日期:'">
  44. <el-date-picker
  45. style="width: 130px"
  46. v-model="searchData.startDate2"
  47. value-format="yyyy-MM-dd"
  48. placeholder="选择日期">
  49. </el-date-picker>
  50. </el-form-item>
  51. <el-form-item :label="'到:'">
  52. <el-date-picker
  53. style="width: 130px"
  54. v-model="searchData.endDate2"
  55. value-format="yyyy-MM-dd"
  56. placeholder="选择日期">
  57. </el-date-picker>
  58. <el-button @click="search()" type="primary">查询</el-button>
  59. <download-excel
  60. :fields="fields()"
  61. type="xls"
  62. :name="exportName"
  63. :fetch="createExportData"
  64. worksheet="导出信息"
  65. class="el-button el-button--primary el-button--medium">
  66. {{ '导出' }}
  67. </download-excel>
  68. </el-form-item>
  69. </el-form>
  70. <el-table
  71. :height="height"
  72. :data="tableData"
  73. border
  74. style="width: 100%">
  75. <el-table-column
  76. v-for="(item,index) in columnList" :key="index"
  77. :sortable="item.columnSortable"
  78. :prop="item.columnProp"
  79. header-align="center"
  80. :show-overflow-tooltip="item.showOverflowTooltip"
  81. :align="item.align"
  82. :fixed="item.fixed==''?false:item.fixed"
  83. :min-width="item.columnWidth"
  84. :label="item.columnLabel">
  85. <template slot-scope="scope">
  86. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  87. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  88. style="width: 100px; height: 80px"/></span>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  93. </div>
  94. </template>
  95. <script>
  96. import {
  97. getOrderView,
  98. } from '@/api/production/generateReport.js'
  99. import Chooselist from '@/views/modules/common/Chooselist'
  100. export default {
  101. name: 'searchSfdc',
  102. components: {
  103. Chooselist
  104. },
  105. data () {
  106. return {
  107. site: this.$store.state.user.site,
  108. // 导出+动态列 start
  109. exportData: [],
  110. userDev:this.$store.state.user.userDev,
  111. exportName: "产品订单流转情况追踪表"+this.getStrDate(),
  112. columnList: [
  113. {
  114. tableId: "orderView",
  115. tableName: this.$route.meta.title,
  116. columnProp: "site",
  117. columnLabel: "工厂",
  118. columnHidden: false,
  119. columnImage: false,
  120. columnSortable: false,
  121. columnWidth: 20,
  122. format: null,
  123. functionId: this.$route.meta.menuId,
  124. sortLv: 0,
  125. status: true,
  126. fixed: '',
  127. serialNumber: null,
  128. columnType: null,
  129. align: 'left'
  130. },
  131. {
  132. tableId: "orderView",
  133. tableName: this.$route.meta.title,
  134. columnProp: "customerDesc",
  135. columnLabel: "客户",
  136. columnHidden: false,
  137. columnImage: false,
  138. columnSortable: false,
  139. columnWidth: 80,
  140. format: null,
  141. functionId: this.$route.meta.menuId,
  142. sortLv: 0,
  143. status: true,
  144. fixed: '',
  145. serialNumber: null,
  146. columnType: null,
  147. align: 'left'
  148. },
  149. {
  150. tableId: "orderView",
  151. tableName: this.$route.meta.title,
  152. columnProp: "orderNo",
  153. columnLabel: "生产订单",
  154. columnHidden: false,
  155. columnImage: false,
  156. columnSortable: false,
  157. columnWidth: 80,
  158. format: null,
  159. functionId: this.$route.meta.menuId,
  160. sortLv: 0,
  161. status: true,
  162. fixed: '',
  163. serialNumber: null,
  164. columnType: null,
  165. align: 'left'
  166. }, {
  167. tableId: "orderView",
  168. tableName: this.$route.meta.title,
  169. columnProp: "partSpec",
  170. columnLabel: "规格型号",
  171. columnHidden: false,
  172. columnImage: false,
  173. columnSortable: false,
  174. columnWidth: 120,
  175. format: null,
  176. functionId: this.$route.meta.menuId,
  177. sortLv: 0,
  178. status: true,
  179. fixed: '',
  180. serialNumber: null,
  181. columnType: null,
  182. align: 'left'
  183. }, {
  184. tableId: "orderView",
  185. tableName: this.$route.meta.title,
  186. columnProp: "lotSize",
  187. columnLabel: "要求完成数量",
  188. columnHidden: false,
  189. columnImage: false,
  190. columnSortable: false,
  191. columnWidth: 60,
  192. format: null,
  193. functionId: this.$route.meta.menuId,
  194. sortLv: 0,
  195. status: true,
  196. fixed: '',
  197. serialNumber: null,
  198. columnType: null,
  199. align: 'right'
  200. }, {
  201. tableId: "orderView",
  202. tableName: this.$route.meta.title,
  203. columnProp: "needDate",
  204. columnLabel: "要求完成日期",
  205. columnHidden: false,
  206. columnImage: false,
  207. columnSortable: false,
  208. columnWidth: 60,
  209. format: null,
  210. functionId: this.$route.meta.menuId,
  211. sortLv: 0,
  212. status: true,
  213. fixed: '',
  214. serialNumber: null,
  215. columnType: null,
  216. align: 'center'
  217. }, {
  218. tableId: "orderView",
  219. tableName: this.$route.meta.title,
  220. columnProp: "firstReportDate",
  221. columnLabel: "首次报工日期",
  222. columnHidden: false,
  223. columnImage: false,
  224. columnSortable: false,
  225. columnWidth: 60,
  226. format: null,
  227. functionId: this.$route.meta.menuId,
  228. sortLv: 0,
  229. status: true,
  230. fixed: '',
  231. serialNumber: null,
  232. columnType: null,
  233. align: 'center'
  234. },
  235. {
  236. tableId: "orderView",
  237. tableName: this.$route.meta.title,
  238. columnProp: "liuhuaReport",
  239. columnLabel: "硫化组",
  240. columnHidden: false,
  241. columnImage: false,
  242. columnSortable: false,
  243. columnWidth: 60,
  244. format: null,
  245. functionId: this.$route.meta.menuId,
  246. sortLv: 0,
  247. status: true,
  248. fixed: '',
  249. serialNumber: null,
  250. columnType: null,
  251. align: 'right'
  252. }, {
  253. tableId: "orderView",
  254. tableName: this.$route.meta.title,
  255. columnProp: "liuhuaFinish",
  256. columnLabel: "半成品入库",
  257. columnHidden: false,
  258. columnImage: false,
  259. columnSortable: false,
  260. columnWidth: 60,
  261. format: null,
  262. functionId: this.$route.meta.menuId,
  263. sortLv: 0,
  264. status: true,
  265. fixed: '',
  266. serialNumber: null,
  267. columnType: null,
  268. align: 'right'
  269. }, {
  270. tableId: "orderView",
  271. tableName: this.$route.meta.title,
  272. columnProp: "xiubianReport",
  273. columnLabel: "修边组",
  274. columnHidden: false,
  275. columnImage: false,
  276. columnSortable: false,
  277. columnWidth: 60,
  278. format: null,
  279. functionId: this.$route.meta.menuId,
  280. sortLv: 0,
  281. status: true,
  282. fixed: '',
  283. serialNumber: null,
  284. columnType: null,
  285. align: 'right'
  286. }, {
  287. tableId: "orderView",
  288. tableName: this.$route.meta.title,
  289. columnProp: "hongkaoReport",
  290. columnLabel: "烘烤组",
  291. columnHidden: false,
  292. columnImage: false,
  293. columnSortable: false,
  294. columnWidth: 60,
  295. format: null,
  296. functionId: this.$route.meta.menuId,
  297. sortLv: 0,
  298. status: true,
  299. fixed: '',
  300. serialNumber: null,
  301. columnType: null,
  302. align: 'right'
  303. }, {
  304. tableId: "orderView",
  305. tableName: this.$route.meta.title,
  306. columnProp: "jiagongReport",
  307. columnLabel: "加工组",
  308. columnHidden: false,
  309. columnImage: false,
  310. columnSortable: false,
  311. columnWidth: 60,
  312. format: null,
  313. functionId: this.$route.meta.menuId,
  314. sortLv: 0,
  315. status: true,
  316. fixed: '',
  317. serialNumber: null,
  318. columnType: null,
  319. align: 'right'
  320. }, {
  321. tableId: "orderView",
  322. tableName: this.$route.meta.title,
  323. columnProp: "jianyanReport",
  324. columnLabel: "检验组",
  325. columnHidden: false,
  326. columnImage: false,
  327. columnSortable: false,
  328. columnWidth: 60,
  329. format: null,
  330. functionId: this.$route.meta.menuId,
  331. sortLv: 0,
  332. status: true,
  333. fixed: '',
  334. serialNumber: null,
  335. columnType: null,
  336. align: 'right'
  337. }, {
  338. tableId: "orderView",
  339. tableName: this.$route.meta.title,
  340. columnProp: "baozhuangReport",
  341. columnLabel: "包装组",
  342. columnHidden: false,
  343. columnImage: false,
  344. columnSortable: false,
  345. columnWidth: 60,
  346. format: null,
  347. functionId: this.$route.meta.menuId,
  348. sortLv: 0,
  349. status: true,
  350. fixed: '',
  351. serialNumber: null,
  352. columnType: null,
  353. align: 'right'
  354. }, {
  355. tableId: "orderView",
  356. tableName: this.$route.meta.title,
  357. columnProp: "finishedQty",
  358. columnLabel: "产成品入库",
  359. columnHidden: false,
  360. columnImage: false,
  361. columnSortable: false,
  362. columnWidth: 60,
  363. format: null,
  364. functionId: this.$route.meta.menuId,
  365. sortLv: 0,
  366. status: true,
  367. fixed: '',
  368. serialNumber: null,
  369. columnType: null,
  370. align: 'right'
  371. }
  372. ,{
  373. tableId: "orderView",
  374. tableName: this.$route.meta.title,
  375. columnProp: "defectQty",
  376. columnLabel: "不良品累计数",
  377. columnHidden: false,
  378. columnImage: false,
  379. columnSortable: false,
  380. columnWidth: 60,
  381. format: null,
  382. functionId: this.$route.meta.menuId,
  383. sortLv: 0,
  384. status: true,
  385. fixed: '',
  386. serialNumber: null,
  387. columnType: null,
  388. align: 'right'
  389. }
  390. ],
  391. visible:false,
  392. // 导出 end
  393. height: 200,
  394. tableData: [],
  395. searchData: {
  396. site:'',
  397. orderNo: '',
  398. partNo: '',
  399. partSpec:'',
  400. startDate:'',
  401. endDate:'',
  402. closedFlag:'Y',
  403. customerId:'',
  404. },
  405. }
  406. },
  407. mounted () {
  408. this.$nextTick(() => {
  409. this.height = window.innerHeight - 210
  410. })
  411. },
  412. methods: {
  413. // 获取基础数据列表S
  414. getBaseList (val, type) {
  415. this.tagNo = val
  416. this.$nextTick(() => {
  417. let strVal = ''
  418. if (val === 24) {
  419. strVal = this.searchData.workCenterNo
  420. }
  421. if (val === 5) {
  422. strVal = this.searchData.partNo
  423. }
  424. if (val === 26) {
  425. strVal = this.searchData.operatorName
  426. }
  427. if (val === 88) {
  428. strVal = this.searchData.resourceId
  429. }
  430. if (val === 12) {
  431. strVal = this.searchData.customerId
  432. }
  433. this.$refs.baseList.init(val, strVal)
  434. })
  435. },
  436. /* 列表方法的回调 */
  437. getBaseData (val) {
  438. if (this.tagNo === 24) {
  439. this.searchData.workCenterNo = val.WorkCenterNo
  440. } else if (this.tagNo === 5) {
  441. this.searchData.partNo = val.PartNo
  442. }
  443. if (this.tagNo === 26) {
  444. this.searchData.operatorName = val.OperatorName
  445. }
  446. if (this.tagNo === 88) {
  447. this.searchData.resourceId = val.ResourceID
  448. }
  449. if (this.tagNo === 12) {
  450. this.searchData.customerId = val.CustomerID
  451. }
  452. },
  453. search () {
  454. if (this.searchData.site === ''&&this.searchData.orderNo === ''&&this.searchData.partNo === ''&&this.searchData.partSpec === ''&&this.searchData.startDate === ''&&this.searchData.endDate === ''&&this.searchData.closedFlag === ''&&this.searchData.customerId === ''){
  455. this.$alert('计算量过大,请至少填写一个筛选条件!', '错误', {
  456. confirmButtonText: '确定'
  457. })
  458. return false;
  459. }
  460. getOrderView(this.searchData).then(({data}) => {
  461. this.tableData = data.rows
  462. })
  463. },
  464. // 导出+动态列
  465. fields() {
  466. let json = "{"
  467. this.columnList.forEach((item, index) => {
  468. if (index == this.columnList.length - 1) {
  469. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  470. } else {
  471. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  472. }
  473. })
  474. json += "}"
  475. let s = eval("(" + json + ")")
  476. return s
  477. },
  478. createExportData() {
  479. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  480. return this.tableData;
  481. },
  482. getStrDate() {
  483. let dd = new Date();
  484. let Y = dd.getFullYear();
  485. let M = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);//获取当前月份的日期,不足10补0
  486. let D = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//获取当前几号,不足10补0
  487. let H = dd.getHours() < 10 ? "0" + dd.getHours() : dd.getHours();
  488. let MM = dd.getMinutes() < 10 ? "0" + dd.getMinutes() : dd.getMinutes();
  489. let S = dd.getSeconds() < 10 ? "0" + dd.getSeconds() : dd.getSeconds();
  490. return Y + M + D + H + MM + S;
  491. },
  492. },
  493. created () {
  494. // this.getTableUserColumn()
  495. }
  496. }
  497. </script>
  498. <style scoped>
  499. .input_left{
  500. text-align: left;
  501. }
  502. .input_reight{
  503. text-align: right;
  504. }
  505. /deep/ input::-webkit-inner-spin-button {
  506. -webkit-appearance: none !important;
  507. }
  508. input[type='number'] {
  509. -moz-appearance: textfield !important;
  510. }
  511. </style>