明晋仓库前台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

storequery.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. <template>
  2. <div style="height:100%;">
  3. <!-- <el-form :model="query" label-width="60px" inline="">
  4. <el-row >
  5. <el-form-item label="仓库" style="margin-left: -1px">
  6. <el-select v-model="query.wareName" size="small" style="width:120px;margin-left: -8px">
  7. <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
  8. </el-select>
  9. </el-form-item>
  10. <el-form-item label="垛位" style="margin-left: -25px">
  11. <el-input v-model="query.stackName" size="small" style="width:120px;margin-left: -8px"></el-input>
  12. </el-form-item>
  13. <el-form-item label="物料" style="margin-left: -25px">
  14. <el-input v-model="query.materialName" size="small" style="width:120px;margin-left: -8px">
  15. <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
  16. </el-input>
  17. </el-form-item>
  18. <el-form-item label="钢种" style="margin-left: -25px">
  19. <el-input v-model="query.standard" size="small" style="width:120px;margin-left: -8px">
  20. <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
  21. </el-input>
  22. </el-form-item>
  23. <el-form-item label="规格" style="margin-left: -15px;">
  24. <el-input v-model="query.model" size="small" style="width:150px;margin-left: -8px"></el-input>
  25. </el-form-item>
  26. <el-form-item label="钢板号" style="margin-left: -15px;">
  27. <el-input v-model="query.plateNo" size="small" style="width:150px;margin-left: -8px"></el-input>
  28. </el-form-item>
  29. <el-form-item label="客户" style="margin-left: -15px;margin-top: 4px;">
  30. <el-input v-model="query.customerName" clearable size = "small" :readonly="true"><el-button @click="clearCustomer" slot="append" icon="el-icon-delete"></el-button><el-button size="small" @click="popCust" slot="append" icon="el-icon-search"></el-button></el-input>
  31. </el-form-item>
  32. <el-form-item label="订单号" style="margin-left:13px;margin-top: -18px">
  33. <el-input v-model="query.ordNo" size="small" style="width:150px;margin-left: -8px"></el-input>
  34. </el-form-item>
  35. <el-form-item label="" style="margin-top: -20px">
  36. <el-button @click="handleSearch" size="small" type="primary">查询</el-button>
  37. </el-form-item>
  38. </el-row>
  39. </el-form> -->
  40. <div class="searchForm-header">
  41. <el-form :model="query" label-width="60px" inline="">
  42. <el-row >
  43. <el-form-item label="仓库" style="margin-left: -1px">
  44. <el-select v-model="query.wareName" size="small" clearable style="width:120px;margin-left: -8px">
  45. <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.name"></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="垛位" style="margin-left: -25px">
  49. <el-input v-model="query.stackName" size="small" style="width:120px;margin-left: -8px"></el-input>
  50. </el-form-item>
  51. <el-form-item label="物料" style="margin-left: -25px">
  52. <el-input v-model="query.materialName" size="small" style="width:120px;margin-left: -8px">
  53. <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
  54. </el-input>
  55. </el-form-item>
  56. <el-form-item label="钢种" style="margin-left: -25px">
  57. <el-input v-model="query.standard" size="small" style="width:120px;margin-left: -8px">
  58. <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
  59. </el-input>
  60. </el-form-item>
  61. <el-form-item label="规格" style="margin-left: -15px;">
  62. <el-input v-model="query.model" size="small" style="width:150px;margin-left: -8px"></el-input>
  63. </el-form-item>
  64. <el-form-item label="钢板号" style="margin-left: -15px;">
  65. <el-input v-model="query.plateNo" size="small" style="width:150px;margin-left: -8px"></el-input>
  66. </el-form-item>
  67. <el-form-item label="客户" style="margin-left: -15px;margin-top: 4px;">
  68. <el-input v-model="query.customerName" clearable size = "small" :readonly="true"><el-button @click="clearCustomer" slot="append" icon="el-icon-delete"></el-button><el-button size="small" @click="popCust" slot="append" icon="el-icon-search"></el-button></el-input>
  69. </el-form-item>
  70. <el-form-item label="订单号" style="margin-left:13px;margin-top: 0px">
  71. <el-input v-model="query.ordNo" size="small" style="width:150px;margin-left: -8px"></el-input>
  72. </el-form-item>
  73. <el-form-item label="" style="margin-top: 0px">
  74. <el-button @click="handleSearch" size="small" type="primary">查询</el-button>
  75. </el-form-item>
  76. <el-form-item label="" style="margin-top: 0px">
  77. <el-upload class="upload-demo" action=""
  78. ref="upload" :limit="1" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
  79. :auto-upload="false" >
  80. <el-button plain slot="trigger" type="success" v-show="false" style= "margin-left: 5px" size="small">询单导入</el-button>
  81. <el-button type="success" @click="handleExport" style="margin-left: 2px" size="small">库存导出</el-button>
  82. </el-upload>
  83. </el-form-item>
  84. <el-button type="primary" style= "margin-left: 5px;margin-top: 5px" size="small" @click="resetButton" :disabled="backAble">重置</el-button>
  85. </el-row>
  86. </el-form>
  87. <total-block ref="totalBlock" style="margin-left: -35px;font-size: 13px;margin-left: 5px;margin-top: -23px;" v-bind:childParam="childParam" v-bind:childUrl = 'childUrl'></total-block>
  88. </div>
  89. <div class="tabledata-grid">
  90. <el-table v-loading="loading" :data="tableData" height="100%" stripe border style="width: 95%;margin-left: 20px;margin-top: -19px" :header-cell-style="{'text-align':'center'}">
  91. <el-table-column prop="id" size="small" label="编号" min-width="10%" v-if="false">
  92. </el-table-column>
  93. <el-table-column prop="ware.name" size="small" label="仓库名称" width="150px">
  94. </el-table-column>
  95. <el-table-column prop="stack.name" size="small" label="垛位" width="100px">
  96. </el-table-column>
  97. <el-table-column prop="layer" size="small" label="层号" show-overflow-tooltip width="100px" header-align="center" align="center">
  98. </el-table-column>
  99. <el-table-column prop="ordNo" size="small" label="订单号" width="200px">
  100. </el-table-column>
  101. <el-table-column prop="material.name" size="small" label="品名" width="100px">
  102. </el-table-column>
  103. <el-table-column prop="model" size="small" label="规格型号" width="180px">
  104. </el-table-column>
  105. <el-table-column prop="material.standard" size="small" label="钢种" width="130px">
  106. </el-table-column>
  107. <!-- <el-table-column prop="material. size="small" standard" label="钢种" show-overflow-tooltip width="180px" align="center">
  108. </el-table-column> -->
  109. <el-table-column prop="count" size="small" label="数量" width="80px" show-overflow-tooltip align="right">
  110. </el-table-column>
  111. <el-table-column prop="weight" size="small" label="重量" width="80px" show-overflow-tooltip align="right">
  112. </el-table-column>
  113. <el-table-column prop="plateNo" size="small" label="钢板号" width="180px">
  114. </el-table-column>
  115. <!-- <el-table-column prop="recordType" size="small" label="类型" width="180px" show-overflow-tooltip align="center" >
  116. </el-table-column> -->
  117. <el-table-column prop="customer.name" size="small" label="客户名称" width="400px" >
  118. </el-table-column>
  119. <el-table-column prop="receiveAddress" size="small" label="收货地址" width="250" show-overflow-tooltip align="left">
  120. </el-table-column>
  121. <el-table-column prop="fkComponyId" label="付款单位" width="300" show-overflow-tooltip header-align="center">
  122. </el-table-column>
  123. <el-table-column prop="carNo" size="small" label="车号" width="110" show-overflow-tooltip header-align="center">
  124. </el-table-column>
  125. <el-table-column prop="wgtDcnMtcCd" size="small" label="计量方式" width="100" show-overflow-tooltip header-align="center">
  126. </el-table-column>
  127. <el-table-column prop="edgeTy" size="small" label="切边类型" width="100" show-overflow-tooltip header-align="center">
  128. </el-table-column>
  129. <el-table-column prop="productionPlace" size="small" label="产地" width="250" show-overflow-tooltip header-align="center">
  130. </el-table-column>
  131. <el-table-column prop="remark" size="small" label="备注" width="180px" show-overflow-tooltip align="left">
  132. </el-table-column>
  133. <el-table-column prop="addUser.userDesc" size="small" label="操作人" width="180px" show-overflow-tooltip align="left">
  134. </el-table-column>
  135. <el-table-column prop="addTime" size="small" label="操作时间" width="180px" show-overflow-tooltip align="left">
  136. </el-table-column>
  137. </el-table>
  138. <el-pagination @size-change="handleSizeChange" style="margin-left:15px" @current-change="handleCurrentChange" :current-page="currentPage"
  139. :page-sizes="pageSizes" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalRows">
  140. </el-pagination>
  141. </div>
  142. <popup-material ref="PopupMaterial" @receviceFromChild="receviceFromMaterial"></popup-material>
  143. <!-- <popup-customer ref="PopupCustomer" @receviceFromChild="receviceFromCustomer"></popup-customer> -->
  144. <popup-customer ref="popupCustomer" @receviceFromChild="receviceFromCustomer"></popup-customer>
  145. </div>
  146. </template>
  147. <script>
  148. import axios from '@/axios'
  149. import PopupStack from '@/components/PopupStack.vue'
  150. import PopupMaterial from '@/components/PopupMaterial.vue'
  151. import PopupCustomer from '@/components/PopupCustomer.vue'
  152. import TotalBlock from '@/components/TotalBlock.vue'
  153. import Export2Excel from '../../excel/Export2Excel.js'
  154. export default {
  155. components: {
  156. PopupStack,
  157. PopupMaterial,
  158. PopupCustomer,
  159. TotalBlock
  160. },
  161. data() {
  162. return {
  163. //分页参数
  164. currentPage: 1,
  165. totalRows: 0,
  166. pageSizes: [50,100,200,500],
  167. pageSize: 50,
  168. pickerOptions: {
  169. shortcuts: [{
  170. text: '最近一周',
  171. onClick(picker) {
  172. const end = new Date();
  173. const start = new Date();
  174. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  175. picker.$emit('pick', [start, end]);
  176. }
  177. }, {
  178. text: '最近一个月',
  179. onClick(picker) {
  180. const end = new Date();
  181. const start = new Date();
  182. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  183. picker.$emit('pick', [start, end]);
  184. }
  185. }, {
  186. text: '最近三个月',
  187. onClick(picker) {
  188. const end = new Date();
  189. const start = new Date();
  190. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  191. picker.$emit('pick', [start, end]);
  192. }
  193. }]
  194. },
  195. //
  196. options: [],
  197. query: {
  198. wareName: '',
  199. stackName: '',
  200. model: '',
  201. materialName: '',
  202. standard: '',
  203. customerName: '',
  204. plateNo: '',
  205. date:'',
  206. customerId: '',
  207. ordNo:''
  208. // customer: {
  209. // name: ''
  210. // },
  211. // material: {
  212. // name: '',
  213. // standard: ''
  214. // },
  215. // model: '',
  216. // plateNo: '',
  217. // stack: {
  218. // name: ''
  219. // },
  220. // ware: {
  221. // name: ''
  222. // }
  223. },
  224. tableData: [],
  225. childParam:{
  226. wareName: '',
  227. stackName: '',
  228. model: '',
  229. materialName: '',
  230. standard: '',
  231. customerName: '',
  232. plateNo: '',
  233. date:'',
  234. customerId: ''
  235. },
  236. childUrl:'CustomerStoreQuery/queryTotal.do',
  237. loading: false,
  238. }
  239. },
  240. mounted() {
  241. this.getTableData()
  242. this.getWare();
  243. },
  244. methods: {
  245. handleExceed(){},
  246. handleSizeChange(val) {
  247. console.log(`每页 ${val} 条`);
  248. this.pageSize = val
  249. this.getTableData()
  250. },
  251. // 修改当前页事件
  252. handleCurrentChange(val) {
  253. console.log(`当前页: ${val}`);
  254. this.currentPage = val
  255. this.getTableData()
  256. },
  257. handleSearch() {
  258. this.currentPage = 1
  259. this.getTableData()
  260. },
  261. getTableData() {
  262. // console.log(this.query.date)
  263. var url = 'CustomerStoreQuery/queryStore.do'
  264. var param = {
  265. page: this.currentPage,
  266. rows: this.pageSize,
  267. wareName: this.query.wareName,
  268. stackName: this.query.stackName,
  269. model: this.query.model,
  270. materialName: this.query.materialName,
  271. standard: this.query.standard,
  272. customerName: this.query.customerName,
  273. plateNo: this.query.plateNo,
  274. beginDate:this.query.date[0],
  275. endDate:this.query.date[1],
  276. customerId:this.query.customerId,
  277. ordNo:this.query.ordNo
  278. }
  279. this.loading = true;
  280. this.childParam = param;
  281. axios.get(url, param).then(response => {
  282. if (response.data.code == 0) {
  283. this.tableData = response.data.data.list
  284. this.totalRows = response.data.data.total
  285. this.$refs.totalBlock.getTotalData();
  286. } else {
  287. this.$message({
  288. type: 'error',
  289. message: '操作失败;' + response.data.msg,
  290. });
  291. }
  292. this.loading = false;
  293. });
  294. },
  295. showMaterial() {
  296. this.$refs.PopupMaterial.show()
  297. },
  298. receviceFromMaterial(material) {
  299. this.query.materialName = material.name
  300. this.query.standard = material.standard
  301. },
  302. popCust(){
  303. // this.dialogVisible2 = true;
  304. this.$refs.popupCustomer.show();
  305. },
  306. receviceFromCustomer(customer) {
  307. this.query.customerName = customer.name;
  308. this.query.customerId = customer.id;
  309. },
  310. clearCustomer(){
  311. this.query.customerName = '';
  312. this.query.customerId = '';
  313. },
  314. resetButton(){ //查询条件重置
  315. this.query.wareName = '',
  316. this.query.stackName = '',
  317. this.query.model = '',
  318. this.query.materialName = '',
  319. this.query.standard = '',
  320. this.query.customerName = '',
  321. this.query.plateNo = '',
  322. this.query.wareId = '',
  323. this.query.ordNo = '',
  324. this.query.fkcustmerName = '',
  325. this.query.carNo = '',
  326. this.query.tallyPeople = '',
  327. this.query.fkComponyName = ''
  328. },
  329. handleExport() {
  330. var url = 'CustomerStoreQuery/queryStore.do'
  331. var imptData = [];
  332. var param = {
  333. page: -1,
  334. rows: -1,
  335. wareName: this.query.wareName,
  336. stackName: this.query.stackName,
  337. model: this.query.model,
  338. materialName: this.query.materialName,
  339. standard: this.query.standard,
  340. customerName: this.query.customerName,
  341. plateNo: this.query.plateNo,
  342. beginDate:this.query.date[0],
  343. endDate:this.query.date[1],
  344. customerId:this.query.customerId,
  345. ordNo:this.query.ordNo
  346. }
  347. axios.get(url, param).then(response => {
  348. if (response.data.code == 0) {
  349. var imptData = response.data.data;
  350. if (imptData.length == 0) {
  351. this.$alert('无法导出,选择时间段无记录', '提示', {
  352. confirmButtonText: '确定',
  353. callback: action => {}
  354. });
  355. } else {
  356. this.exportExcel(imptData)
  357. }
  358. } else {
  359. this.$message({
  360. type: 'error',
  361. message: '操作失败;' + response.data.msg,
  362. });
  363. }
  364. });
  365. },
  366. exportExcel(imptData) {
  367. // alert(JSON.stringify(imptData))
  368. const header = ["仓库名称"
  369. ,"垛位"
  370. ,"层号"
  371. ,"订单号"
  372. ,"品名"
  373. ,"规格型号"
  374. ,"钢种"
  375. ,"数量"
  376. ,"重量"
  377. ,"钢板号"
  378. ,"客户名称"
  379. ,"收货地址"
  380. ,"车号"
  381. ,"计量方式"
  382. ,"切边类型"
  383. ,"产地"
  384. ,"备注"
  385. ,"操作人"
  386. ,"操作时间"
  387. ] // 导出的表头名
  388. const filterVal = [
  389. "wareName"
  390. ,"stackName"
  391. ,"layer"
  392. ,"ordNo"
  393. ,"materialName"
  394. ,"model"
  395. ,"materialStandard"
  396. ,"count"
  397. ,"weight"
  398. ,"plateNo"
  399. ,"customerName"
  400. ,"receiveAddress"
  401. ,"carNo"
  402. ,"wgtDcnMtcCd"
  403. ,"edgeTy"
  404. ,"productionPlace"
  405. ,"remark"
  406. ,"addUserUserDesc"
  407. ,"addTime"
  408. ]
  409. var handleImptData = [];
  410. var item = {};
  411. console.log(JSON.stringify(imptData[0]))
  412. for(var i = 0 ;i <imptData.length;i++){
  413. item = {}
  414. item["wareName"] = imptData[i].ware.name;
  415. item["stackName"] = imptData[i].stack.name;
  416. item["layer"] = imptData[i].layer;
  417. item["ordNo"] = imptData[i].ordNo;
  418. item["materialName"] = imptData[i].material.name;
  419. item["model"] = imptData[i].model;
  420. item["materialStandard"] = imptData[i].material.standard;
  421. item["count"] = imptData[i].count;
  422. item["weight"] = imptData[i].weight;
  423. item["plateNo"] = imptData[i].plateNo;
  424. item["customerName"] = imptData[i].customer.name;
  425. item["receiveAddress"] = imptData[i].receiveAddress;
  426. item["carNo"] = imptData[i].carNo;
  427. item["wgtDcnMtcCd"] = imptData[i].wgtDcnMtcCd;
  428. item["edgeTy"] = imptData[i].edgeTy;
  429. item["productionPlace"] = imptData[i].productionPlace;
  430. item["remark"] = imptData[i].remark;
  431. item["addUserUserDesc"] = imptData[i].addUser.userDesc;
  432. item["addTime"] = imptData[i].addTime;
  433. handleImptData.push(item);
  434. }
  435. const list = handleImptData
  436. const data = this.formatJson(filterVal, list)
  437. const filename = '库存导出' + (new Date()).toLocaleDateString();
  438. Export2Excel.export_json_to_excel({
  439. header,
  440. data,
  441. filename
  442. })
  443. },
  444. formatJson(filterVal, jsonData) {
  445. return jsonData.map(v => filterVal.map(j => {
  446. return v[j]
  447. }))
  448. },
  449. getWare() {
  450. var url = 'MaintWare/queryByUserId.do'
  451. var param = {}
  452. axios.get(url, param).then(response => {
  453. console.log(response)
  454. this.options = response.data.data
  455. // if (response.data.data.length == 1) {
  456. // this.wareName = response.data.data[0].name
  457. // // this.getStack()
  458. // }
  459. });
  460. },
  461. }
  462. }
  463. </script>
  464. <style>
  465. .searchForm-header{
  466. /*background-color: red;*/
  467. height: auto;
  468. /*;*/
  469. margin-left: 10px;
  470. }
  471. .tabledata-grid{
  472. /*margin-left: 100px;*/
  473. font-size: 20px;
  474. height: calc(100% - 200px);
  475. /*background-color: #000;*/
  476. }
  477. </style>