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

InStore.vue 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. <template>
  2. <div style="height:100%;">
  3. <div class="searchForm-header">
  4. <el-form :model="query" label-width="100px" inline="">
  5. <el-row>
  6. <el-form-item label="库房名称" style="margin-left: -15px">
  7. <el-select v-model="query.wareName" clearable size="small" style="width:120px;margin-left: -8px">
  8. <el-option v-for="item in optionsWare" :key="item.id" :label="item.name" :value="item.name">
  9. </el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="垛位名称" style="margin-left: -35px">
  13. <el-input v-model="query.stackName" size="small" style="width:120px;margin-left: -8px"></el-input>
  14. </el-form-item>
  15. <el-form-item label="品名" style="margin-left: -35px">
  16. <el-input v-model="query.materialName" size="small" style="width:120px;margin-left: -8px">
  17. <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
  18. </el-input>
  19. </el-form-item>
  20. <el-form-item label="钢种" style="margin-left: -35px">
  21. <el-input v-model="query.standard" size="small" style="width:150px;margin-left: -8px">
  22. <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
  23. </el-input>
  24. </el-form-item>
  25. <el-form-item label="货权单位" style="margin-left: -35px">
  26. <el-input v-model="query.fkcustomer" size="small" style="width:170px;margin-left: -8px">
  27. <el-button slot="append" icon="el-icon-search" @click="showfkCustomer"></el-button>
  28. </el-input>
  29. </el-form-item>
  30. <el-form-item label="客户名称" style="margin-left: -35px">
  31. <el-input v-model="query.customerName" size="small" style="width:170px;margin-left: -8px">
  32. <el-button slot="append" icon="el-icon-search" @click="showCustomer"></el-button>
  33. </el-input>
  34. </el-form-item>
  35. <el-form-item label="规格型号" style="margin-left: -15px;margin-top: -3px">
  36. <el-input v-model="query.model" size="small" style="width:120px;margin-left: -8px">
  37. </el-input>
  38. </el-form-item>
  39. <el-form-item label="钢板号" style="margin-left: -15px;margin-top: -3px">
  40. <el-input v-model="query.plateNo" size="small" style="width:120px;margin-left: -8px">
  41. </el-input>
  42. </el-form-item>
  43. <el-form-item label="订单号" style="margin-left: -15px;margin-top: -3px">
  44. <el-input v-model="query.ordNo" size="small" style="width:120px;margin-left: -8px">
  45. </el-input>
  46. </el-form-item>
  47. <el-form-item label="" style="margin-top: 0px;margin-left: 10px">
  48. <el-button size="small" type="primary" @click="handleSearch">查询</el-button>
  49. <el-button size="small" type="info" @click="handleClear">重置</el-button>
  50. <el-button size="small" type="info" @click="handleImport" plain>导入</el-button>
  51. <el-button @click="showChangeCustomer" size="small" type="primary">货权转移</el-button>
  52. <el-button type="primary" size="small" @click="showDistribution">配货</el-button>
  53. <el-button type="success" @click="handleExport" style="margin-left: 2px" size="small">导出记录</el-button>
  54. <el-button type="primary" size="small" @click="showOut">出库</el-button>
  55. <el-button size="small" type="danger" @click="handleInBack" :disabled="backAble">取消入库</el-button>
  56. </el-form-item>
  57. </el-row>
  58. </el-form>
  59. </div>
  60. <div class="tabledata-grid">
  61. <el-table :data="tableData" height="100%" border style="width: 97%;" v-loading="loading" ref="multipleTable" @select="handleTableSelect" @selection-change="handleSelectionChange" @select-all = "selectAll">
  62. <el-table-column type="selection" width="40" header-align="center" align="center"></el-table-column>
  63. <el-table-column prop="plateNo" label="产品编号" width="200" show-overflow-tooltip header-align="center"></el-table-column>
  64. <el-table-column prop="materialName" label="品名" width="100" show-overflow-tooltip header-align="center" align="center"></el-table-column>
  65. <el-table-column prop="ordNo" label="订单号" width="180" show-overflow-tooltip header-align="center"></el-table-column>
  66. <el-table-column prop="model" label="规格型号" width="160" show-overflow-tooltip header-align="center" align="center"></el-table-column>
  67. <el-table-column prop="weight" label="重量" width="120" show-overflow-tooltip align="right" header-align="center"></el-table-column>
  68. <el-table-column prop="materialStandard" label="钢种" width="100" show-overflow-tooltip header-align="center" align="center"></el-table-column>
  69. <el-table-column prop="inCarNo" label="入库车号" width="200" show-overflow-tooltip header-align="center"></el-table-column>
  70. <el-table-column prop="addTime" label="入库时间" width="200" show-overflow-tooltip header-align="center"></el-table-column>
  71. <el-table-column prop="customerName" label="货主" width="300" show-overflow-tooltip header-align="center"></el-table-column>
  72. <el-table-column prop="productionPlace" label="产地" width="250" show-overflow-tooltip header-align="center"></el-table-column>
  73. <el-table-column prop="count" label="件数" width="120" show-overflow-tooltip align="right" header-align="center"></el-table-column>
  74. <el-table-column prop="wgtDcnMtcCd" label="计重方式" width="100" show-overflow-tooltip header-align="center"></el-table-column>
  75. <el-table-column prop="billRule" label="计费规则" width="100" show-overflow-tooltip header-align="center"></el-table-column>
  76. <el-table-column prop="edgeTy" label="切边类型" width="100" show-overflow-tooltip header-align="center"></el-table-column>
  77. <el-table-column prop="appDesc" label="外观描述" width="100" show-overflow-tooltip header-align="center"></el-table-column>
  78. <el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip header-align="center"></el-table-column>
  79. </el-table>
  80. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  81. :page-sizes="pageSizes" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalRows">
  82. </el-pagination>
  83. </div>
  84. <popup-material ref="PopupMaterial" @receviceFromChild="receviceFromMaterial"></popup-material>
  85. <popup-customer ref="PopupCustomer" @receviceFromChild="receviceFromCustomer"></popup-customer>
  86. <popup-customer ref="PopupfkCustomer" @receviceFromChild="receviceFromfkCustomer"></popup-customer>
  87. <popup-customer ref="PopupNewCustomer" @receviceFromChild="receviceFromNewCustomer"></popup-customer>
  88. <popup-address ref="PopupAddress" @receviceFromChild="receviceFromAddress"></popup-address>
  89. <popup-distribution ref="PopupDistribution" @receviceFromChild="receviceFromDistreibution" :selectRows="selectRows"></popup-distribution>
  90. <popup-out ref="PopupOut" @receviceFromChild="receviceFromOut"></popup-out>
  91. <popup-in ref="PopupIn" @receviceFromChild="receviceFromIn" :wares="options" :wareId="query.wareId" :stack="moveFromStack"></popup-in>
  92. <el-dialog title="货权转移" :visible.sync="customerDialogVisible" width="500px">
  93. <el-form>
  94. <el-form-item label="货权转移">
  95. <el-input v-model="newCustomer.name">
  96. <el-button slot="append" icon="el-icon-search" @click="showNewCustomer"></el-button>
  97. </el-input>
  98. </el-form-item>
  99. <el-form-item label="修改目的地">
  100. <el-input v-model="newAddress_fir">
  101. <el-button slot="append" icon="el-icon-search" @click="showAddress"></el-button>
  102. </el-input>
  103. </el-form-item>
  104. <el-form-item label="修改地址">
  105. <el-input v-model="newAddress_lst">
  106. </el-input>
  107. </el-form-item>
  108. <el-form-item label=" ">
  109. <el-button type="success" @click="handleCustomerSave">保存</el-button>
  110. <el-button type="danger" @click="handleCustomerCancelSave">取消</el-button>
  111. </el-form-item>
  112. </el-form>
  113. </el-dialog>
  114. <el-dialog title="导入入库信息" :visible.sync="importDialogVisible" width="1000px">
  115. <el-upload class="upload-demo" action="" :on-change="handleChange" :on-exceed="handleExceed" :on-remove="handleRemove"
  116. ref="upload" :limit="1" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
  117. :auto-upload="false">
  118. <el-button slot="trigger" size="small" type="primary">选择文件</el-button>
  119. <el-button size="small" type="success" @click="inImport">保存</el-button>
  120. <div slot="tip" >只能上传xlsx/xls文 件</div>
  121. </el-upload>
  122. <!--
  123. <el-table :data="imTableData" border>
  124. <el-table-column prop="层数" label="层数" width="60" show-overflow-tooltip header-align="center"></el-table-column>
  125. <el-table-column prop="库房" label="库房" width="100" show-overflow-tooltip header-align="center"></el-table-column>
  126. <el-table-column prop="垛位" label="垛位" width="120" show-overflow-tooltip header-align="center"></el-table-column>
  127. <el-table-column prop="物料" label="物料" width="120" show-overflow-tooltip align="center" header-align="center"></el-table-column>
  128. <el-table-column prop="钢种" label="钢种" width="120" show-overflow-tooltip align="center" header-align="center"></el-table-column>
  129. <el-table-column prop="钢板号" label="钢板号" width="200" show-overflow-tooltip header-align="center"></el-table-column>
  130. <el-table-column prop="规格型号" label="规格型号" width="120" show-overflow-tooltip header-align="center"></el-table-column>
  131. <el-table-column prop="数量" label="数量" width="120" show-overflow-tooltip align="right" header-align="center"></el-table-column>
  132. <el-table-column prop="重量" label="重量" width="120" show-overflow-tooltip align="right" header-align="center"></el-table-column>
  133. <el-table-column prop="客户" label="客户" width="300" show-overflow-tooltip header-align="center"></el-table-column>
  134. <el-table-column prop="备注" label="备注" width="150" show-overflow-tooltip header-align="center"></el-table-column>
  135. </el-table>
  136. -->
  137. </el-dialog>
  138. </div>
  139. </template>
  140. <script>
  141. import axios from '@/axios'
  142. import PopupStack from '@/components/PopupStack.vue'
  143. import PopupMaterial from '@/components/PopupMaterial.vue'
  144. import PopupCustomer from '@/components/PopupCustomer.vue'
  145. import PopupAddress from '@/components/PopupAddress.vue'
  146. import PopupDistribution from '@/components/PopupDistribution.vue'
  147. import PopupOut from '@/components/PopupOut.vue'
  148. import PopupIn from '@/components/PopupIn.vue'
  149. import Export2Excel from '../../excel/Export2Excel.js'
  150. import {
  151. mapState
  152. } from 'vuex'
  153. export default {
  154. components: {
  155. PopupStack,
  156. PopupMaterial,
  157. PopupCustomer,
  158. PopupAddress,
  159. PopupDistribution,
  160. PopupOut,
  161. PopupIn,
  162. },
  163. computed: {
  164. // splitCount: function() {
  165. // let result = Number(this.split.originalCount) - Number(this.split.count)
  166. // return result
  167. // },
  168. // splitWeight: function() {
  169. // let result = Number(this.split.originalWeight) - Number(this.split.weight)
  170. // return result
  171. // },
  172. ...mapState({
  173. serverName: state => state.app.serverName,
  174. // wareBackgroundColor: state => state.color.wareBackgroundColor,
  175. // stackColor: state => state.color.stackColor,
  176. // stackSelectedColor: state => state.color.stackSelectedColor,
  177. // lockColor: state => state.color.lockColor,
  178. })
  179. },
  180. data() {
  181. return {
  182. addressDialogVisible: false,
  183. customerDialogVisible: false,
  184. query: {
  185. wareName: '',
  186. stackName: '',
  187. model: '',
  188. materialName: '',
  189. standard: '',
  190. customerName: '',
  191. fkcustomer: '',
  192. plateNo: '',
  193. ordNo: '',
  194. wareId:'',
  195. },
  196. multipleSelection: [],
  197. tableData: [],
  198. optionsWare: [],
  199. newCustomer: {
  200. id: '',
  201. name: ''
  202. },
  203. newAddress_fir: '',
  204. newAddress_lst: '',
  205. currentPage: 1,
  206. totalRows: 0,
  207. pageSizes: [50, 100, 200],
  208. pageSize: 50,
  209. HideAndShow: 0,
  210. loading: false,
  211. importDialogVisible: false,
  212. selectRows: [],
  213. options: [],
  214. moveFromStack: {}, //移除垛位
  215. fileTemp: [],
  216. imTableData: [],
  217. moveStore: {},
  218. };
  219. },
  220. //键盘监听
  221. mounted() {
  222. this.getWare()
  223. //this.getTableData()
  224. },
  225. methods: {
  226. showMaterial() {
  227. this.$refs.PopupMaterial.show()
  228. },
  229. receviceFromMaterial(material) {
  230. this.query.materialName = material.name
  231. this.query.standard = material.standard
  232. },
  233. showCustomer() {
  234. this.$refs.PopupCustomer.show()
  235. },
  236. receviceFromCustomer(customer) {
  237. this.query.customerName = customer.name
  238. },
  239. showfkCustomer() {
  240. this.$refs.PopupfkCustomer.show()
  241. },
  242. receviceFromfkCustomer(customer) {
  243. this.query.fkcustomer = customer.name
  244. },
  245. showNewCustomer() {
  246. this.$refs.PopupNewCustomer.show()
  247. },
  248. receviceFromNewCustomer(customer) {
  249. this.newCustomer = customer
  250. this.newAddress = customer.address
  251. },
  252. showAddress() {
  253. this.$refs.PopupAddress.show(this.newCustomer.id)
  254. },
  255. receviceFromAddress(address) {
  256. this.newAddress_fir = address.address_fir
  257. this.newAddress_lst = address.address_lst
  258. },
  259. handleSearch() {
  260. this.currentPage = 1
  261. this.getTableData()
  262. },
  263. handleImport() {
  264. this.importDialogVisible = true
  265. },
  266. showUpload() {
  267. this.dialogTravePic = true
  268. },
  269. handleDownload() {
  270. window.open(this.serverName.substr(0, this.serverName.lastIndexOf('/', this.serverName.lastIndexOf('/') - 1)) +
  271. '/import.xls')
  272. },
  273. showIn() {
  274. // if (this.query.wareId == '') {
  275. // this.$message({
  276. // type: 'error',
  277. // message: '请选择入库库房'
  278. // });
  279. // return
  280. // }
  281. // if (this.query.stackId == '') {
  282. // this.$message({
  283. // type: 'error',
  284. // message: '请选择入库垛位'
  285. // });
  286. // return
  287. // }
  288. this.$refs.PopupIn.show()
  289. },
  290. handleInBack() {
  291. if (this.selectRows.length < 1) {
  292. this.$message({
  293. type: 'error',
  294. message: '至少选择一条数据!',
  295. });
  296. return
  297. } else {
  298. var url = 'WareIn/back.do'
  299. var param = {
  300. json: JSON.stringify(this.selectRows),
  301. }
  302. axios.post(url, param).then(response => {
  303. if (response.data.code == 0) {
  304. this.getStoreByStackId(response.data.data)
  305. } else {
  306. this.$message({
  307. type: 'error',
  308. message: '操作失败;' + response.data.msg,
  309. });
  310. }
  311. });
  312. }
  313. },
  314. showDistribution() {
  315. //console.log(this.selectRows.length)
  316. if (this.selectRows.length < 1) {
  317. this.$message({
  318. type: 'warning',
  319. message: '至少选择一条数据!',
  320. });
  321. }
  322. this.$refs.PopupDistribution.show()
  323. },
  324. showOut() {
  325. this.$refs.PopupOut.show()
  326. },
  327. getWare() {
  328. var url = 'MaintWare/queryByUserId.do'
  329. var param = {}
  330. axios.get(url, param).then(response => {
  331. this.optionsWare = response.data.data
  332. console.log('optionsWare',optionsWare)
  333. if (response.data.data.length == 1) {
  334. this.wareName = response.data.data[0].name
  335. }
  336. });
  337. },
  338. handleSizeChange(val) {
  339. this.pageSize = val
  340. this.getTableData()
  341. },
  342. handleCurrentChange(val) {
  343. this.currentPage = val
  344. this.getTableData()
  345. },
  346. search() {
  347. this.currentPage = 1
  348. this.getTableData()
  349. },
  350. getTableData() {
  351. this.loading = true
  352. var url = 'WareStore/queryStore.do'
  353. var param = {
  354. page: this.currentPage,
  355. rows: this.pageSize,
  356. wareName: this.query.wareName,
  357. stackName: this.query.stackName,
  358. model: this.query.model,
  359. materialName: this.query.materialName,
  360. standard: this.query.standard,
  361. customerName: this.query.customerName,
  362. plateNo: this.query.plateNo,
  363. ordNo: this.query.ordNo,
  364. fkcompony: this.query.fkcustomer,
  365. }
  366. axios.get(url, param).then(response => {
  367. if (response.data.code == 0) {
  368. this.tableData = response.data.data.list
  369. this.totalRows = response.data.data.total
  370. } else {
  371. this.$message({
  372. type: 'error',
  373. message: '操作失败;' + response.data.msg,
  374. });
  375. }
  376. this.loading = false
  377. });
  378. },
  379. handleSelectionChange(val) {
  380. this.multipleSelection = val;
  381. },
  382. showChangeCustomer() {
  383. if (this.multipleSelection.length < 1) {
  384. this.$message({
  385. type: 'error',
  386. message: '至少选择一条记录!',
  387. });
  388. return
  389. }
  390. var customerAddress = this.multipleSelection[0].customer.address
  391. var boolean = true
  392. for (var i = 0; i < this.multipleSelection.length; i++) {
  393. if (this.multipleSelection[i].customer.address == customerAddress) {
  394. } else {
  395. boolean = boolean && false
  396. customerAddress = this.multipleSelection[i].customer.address
  397. }
  398. }
  399. if (boolean) {
  400. this.newCustomer = this.multipleSelection[0].customer
  401. this.newAddress = this.multipleSelection[0].receiveAddress
  402. this.customerDialogVisible = true
  403. } else {
  404. this.$message({
  405. type: 'error',
  406. message: '请选择同一客户!',
  407. });
  408. }
  409. },
  410. handleCustomerSave() {
  411. var url = 'WareChange/changeCustomer.do'
  412. var param = {
  413. json: JSON.stringify(this.multipleSelection),
  414. customer: JSON.stringify(this.newCustomer),
  415. address_fir: this.newAddress_fir,
  416. address_lst: this.newAddress_lst
  417. }
  418. axios.post(url, param).then(response => {
  419. if (response.data.code == 0) {
  420. this.getTableData()
  421. this.customerDialogVisible = false
  422. } else {
  423. this.$message({
  424. type: 'error',
  425. message: '操作失败;' + response.data.msg,
  426. });
  427. }
  428. });
  429. },
  430. handleCustomerCancelSave() {
  431. this.customerDialogVisible = false
  432. },
  433. inImport() {
  434. var url = 'WareIn/inImport.do'
  435. var json = JSON.stringify(this.imTableData)
  436. var param = {
  437. json: json
  438. }
  439. axios.post(url, param).then(response => {
  440. if (response.data.code == '0') {
  441. this.$message({
  442. type: 'success',
  443. message: '入库成功!',
  444. });
  445. this.importDialogVisible = false
  446. this.imTableData = []
  447. this.fileTemp = null
  448. } else {
  449. this.$message({
  450. type: 'error',
  451. message: '入库失败!' + response.data.msg
  452. });
  453. }
  454. });
  455. },
  456. handleTableSelectionChange(val) {
  457. this.selectRows = val
  458. this.setLayerColor()
  459. },
  460. receviceFromDistreibution() {
  461. this.getStoreByStackId(null)
  462. },
  463. getStoreByStackId(moveSelect) {
  464. this.tableDataLoading = true
  465. var url = 'WareStore/queryByWareIdStackId.do'
  466. var param = {
  467. wareId: this.query.wareId,
  468. stackId: this.moveFromStack.id
  469. }
  470. axios.get(url, param).then(response => {
  471. if (response.data.code == 0) {
  472. this.tableData = response.data.data
  473. this.selectRows = []
  474. // if (this.isLayer == '0') {
  475. // this.drawStoreNoLayer(response.data.data)
  476. // } else if (this.isLayer == '1') { //1是A开头的,2是B开头的,3是C开头的。
  477. // this.drawStoreAutoLayer(response.data.data)
  478. // } else if (this.isLayer == '2') {
  479. // this.drawStoreManulLayer(response.data.data)
  480. // }
  481. if (moveSelect) {
  482. this.$refs.multipleTable.clearSelection();
  483. for (let i = 0; i < this.tableData.length; i++) {
  484. for (let j = 0; j < moveSelect.length; j++) {
  485. if (moveSelect[j].layer === this.tableData[i].layer) {
  486. this.selectRows.push(this.tableData[i])
  487. }
  488. }
  489. }
  490. this.$nextTick(() => {
  491. this.toggleSelection(this.selectRows, true)
  492. this.setLayerColor()
  493. })
  494. }
  495. } else {
  496. this.$message({
  497. type: 'error',
  498. message: '保存失败' + response.data.msg,
  499. });
  500. }
  501. this.tableDataLoading = false
  502. });
  503. },
  504. receviceFromOut(customer) {
  505. this.getStoreByStackId()
  506. },
  507. receviceFromIn() {
  508. this.getStoreByStackId()
  509. },
  510. handleChange(file, fileList) {
  511. this.fileTemp = file.raw
  512. if (this.fileTemp) {
  513. if ((this.fileTemp.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') || (this.fileTemp.type ==
  514. 'application/vnd.ms-excel')) {
  515. this.importfxx(this.fileTemp)
  516. } else {
  517. this.$message({
  518. type: 'warning',
  519. message: '附件格式错误,请删除后重新上传!'
  520. })
  521. }
  522. } else {
  523. this.$message({
  524. type: 'warning',
  525. message: '请上传附件!'
  526. })
  527. }
  528. },
  529. handleExceed(file, fileList) {},
  530. handleRemove(file, fileList) {
  531. this.fileTemp = null
  532. },
  533. toggleSelection(rows, selected) {
  534. if (rows) {
  535. rows.forEach(row => {
  536. this.$refs.multipleTable.toggleRowSelection(row, selected); //接受两个参数,row传递被勾选行的数据,selected设置是否选中
  537. });
  538. }
  539. },
  540. setLayerColor() {
  541. if (this.selectRows.length == 0) {
  542. for (let i = 0; i < this.moveStore.storage._roots.length; i++) {
  543. if (this.tableData[i].lockFlag == '1') {
  544. this.moveStore.storage._roots[i].attr('style', {
  545. fill: this.lockColor,
  546. })
  547. } else {
  548. this.moveStore.storage._roots[i].attr('style', {
  549. fill: this.stackColor,
  550. })
  551. }
  552. }
  553. } else {
  554. for (let i = 0; i < this.moveStore.storage._roots.length; i++) {
  555. for (let j = 0; j < this.selectRows.length; j++) {
  556. if (this.tableData[i] === this.selectRows[j]) {
  557. this.moveStore.storage._roots[i].attr('style', {
  558. fill: this.stackSelectedColor,
  559. })
  560. break;
  561. } else {
  562. if (this.tableData[i].lockFlag == '1') {
  563. this.moveStore.storage._roots[i].attr('style', {
  564. fill: this.lockColor,
  565. })
  566. } else {
  567. this.moveStore.storage._roots[i].attr('style', {
  568. fill: this.stackColor,
  569. })
  570. }
  571. }
  572. }
  573. }
  574. }
  575. },
  576. handleTableSelect(selection, row) { //第一个参数是目前所有选中的数据
  577. console.log(JSON.stringify(row))
  578. if (row.lockFlag == '1') {
  579. // this.$message({
  580. // type: 'error',
  581. // message: '该行已被配货锁定',
  582. // });
  583. alert("该行已被配货锁定")
  584. this.toggleSelection([row], false)
  585. // for(let i = 0;i<selection.length;i++){
  586. // if(selection[i]==row){
  587. // selection.splice(i,1)
  588. // }
  589. // }
  590. } else {
  591. this.selectRows = selection
  592. this.setLayerColor()
  593. }
  594. },
  595. selectAll(selection){
  596. this.selectRows = selection;
  597. },
  598. handleExport() {
  599. var imptData = [];
  600. var url = 'WareStore/queryStore.do'
  601. var param = {
  602. page: -1,
  603. rows: -1,
  604. wareName: this.query.wareName,
  605. stackName: this.query.stackName,
  606. model: this.query.model,
  607. materialName: this.query.materialName,
  608. standard: this.query.standard,
  609. customerName: this.query.customerName,
  610. plateNo: this.query.plateNo,
  611. ordNo: this.query.ordNo,
  612. fkcompony: this.query.fkcustomer,
  613. }
  614. axios.get(url, param).then(response => {
  615. if (response.data.code == 0) {
  616. var imptData = response.data.data;
  617. if (imptData.length == 0) {
  618. this.$alert('无法导出,选择时间段无记录', '提示', {
  619. confirmButtonText: '确定',
  620. callback: action => {}
  621. });
  622. } else {
  623. this.exportExcel(imptData)
  624. }
  625. } else {
  626. this.$message({
  627. type: 'error',
  628. message: '操作失败;' + response.data.msg,
  629. });
  630. }
  631. });
  632. },
  633. exportExcel(imptData) {
  634. // alert(JSON.stringify(imptData))
  635. const header = ["垛位"
  636. ,"层数"
  637. ,"品名"
  638. ,"钢种"
  639. ,"产品编号"
  640. ,"订单号"
  641. ,"规格型号"
  642. ,"数量"
  643. ,"重量"
  644. ,"货权单位"
  645. ,"客户"
  646. ,"目的地"
  647. ,"收货地址"
  648. ,"计量方式"
  649. ,"切边类型"
  650. ,"产地"
  651. ,"备注"
  652. ,"入库时间"
  653. ] // 导出的表头名
  654. const filterVal = ["stackName"
  655. ,"layer"
  656. ,"materialName"
  657. ,"materialStandard"
  658. ,"plateNo"
  659. ,"ordNo"
  660. ,"model"
  661. ,"count"
  662. ,"weight"
  663. ,"fkComponyId"
  664. ,"customerName"
  665. ,"receiveAddressFir"
  666. ,"receiveAddressLast"
  667. ,"wgtDcnMtcCd"
  668. ,"edgeTy"
  669. ,"productionPlace"
  670. ,"remark"
  671. ,"addTime"
  672. ]
  673. /* for(var i=0;i<imptData.length;i++){
  674. imptData[i]["stackName"] = imptData[i].stack.name;
  675. imptData[i]["materialName"] = imptData[i].material.name;
  676. imptData[i]["materialStandard"] = imptData[i].material.standard;
  677. imptData[i]["customerName"] = imptData[i].customer.name;
  678. } */
  679. const list = imptData
  680. const data = this.formatJson(filterVal, list)
  681. const filename = '库存操作' + (new Date()).toLocaleDateString();
  682. Export2Excel.export_json_to_excel({
  683. header,
  684. data,
  685. filename
  686. })
  687. },
  688. formatJson(filterVal, jsonData) {
  689. return jsonData.map(v => filterVal.map(j => {
  690. return v[j]
  691. }))
  692. },
  693. //showChangeAddress() {},
  694. // handleAddressSave() {
  695. // },
  696. // handleAddressCancelSave() {
  697. // this.addressDialogVisible = false
  698. // },
  699. },
  700. }
  701. </script>
  702. <style>
  703. .option_btn{
  704. margin-left: 30px
  705. }
  706. .searchForm-header{
  707. height: auto;
  708. margin-left: 10px;
  709. }
  710. .tabledata-grid{
  711. font-size: 20px;
  712. margin-left: 5px;
  713. height: calc(100% - 100px);
  714. }
  715. .el-select-dropdown .el-scrollbar .el-scrollbar__wrap
  716. {
  717. overflow: scroll!important;
  718. }
  719. </style>