明晋仓库前台
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.

store.vue 41KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426
  1. <template>
  2. <div id='store'>
  3. <el-row>
  4. <el-col :span="10">
  5. <el-select v-model="query.wareId" size="small" style="margin-left: 5px; width: 200px" clearable placeholder="请选择库房" @change="change">
  6. <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id">
  7. </el-option>
  8. </el-select>
  9. <el-select v-model="query.areaId" size="small" style="margin-left: 5px; width: 100px" clearable placeholder="请选择区域" @change="changeArea">
  10. <el-option v-for="item in optionsArea" :key="item.id" :label="item.name" :value="item.code">
  11. </el-option>
  12. </el-select>
  13. <el-input v-model="query.stackId" size="small" placeholder="垛位" style="margin-left: 5px; width: 100px;"></el-input>
  14. <el-button type="info" @click="search" size="small">查询</el-button>
  15. <el-checkbox :v-model="showStoreLayer" size="small" @change="changeShowLayout">显示库图</el-checkbox>
  16. </el-col>
  17. <el-col :span="10">
  18. <el-button size="small" type="primary" @click="handleImport">导入</el-button>
  19. <el-button size="small" type="primary" @click="handleDownload">下载模板</el-button>
  20. <el-button size="small" type="success" @click="showIn">入库</el-button>
  21. <el-button size="small" type="danger" @click="handleInBack" :disabled="backAble">取消入库</el-button>
  22. <el-button type="primary" size="small" @click="showDistribution">配货</el-button>
  23. <el-button type="primary" size="small" @click="showOut">出库</el-button>
  24. </el-col>
  25. <el-col :span="2">
  26. <el-row style=" margin:10px;">
  27. </el-row>
  28. </el-col>
  29. </el-row>
  30. <el-row>
  31. <el-col :span="showStoreLayerSpanA">
  32. <div id="wareLayout" style=" margin:10px;width:700px; height: 550px;background-color: #DCDCDC; float:left;"></div>
  33. <el-table :data="tableData" v-loading="tableDataLoading" border ref="multipleTable" @select="handleTableSelect"
  34. :row-class-name="tableRowClassName" @select-all = "selectAll">
  35. <!-- //@selection-change="handleTableSelectionChange" -->
  36. <el-table-column type="selection" width="40" header-align="center" align="center"></el-table-column>
  37. <el-table-column prop="layer" label="层数" width="60" show-overflow-tooltip header-align="center" align="center">
  38. </el-table-column>
  39. <el-table-column prop="stack.name" label="垛位" width="60" show-overflow-tooltip header-align="center" align="center">
  40. </el-table-column>
  41. <el-table-column prop="material.name" label="货物品名" width="100" show-overflow-tooltip header-align="center" align="center">
  42. </el-table-column>
  43. <el-table-column prop="ordNo" label="订单号" width="180" show-overflow-tooltip header-align="center">
  44. </el-table-column>
  45. <el-table-column prop="contractNo" label="合约号" width="180" show-overflow-tooltip header-align="center">
  46. </el-table-column>
  47. <el-table-column prop="material.standard" label="材质" width="100" show-overflow-tooltip header-align="center" align="center">
  48. </el-table-column>
  49. <el-table-column prop="plateNo" label="钢板号" width="200" show-overflow-tooltip header-align="center">
  50. </el-table-column>
  51. <el-table-column prop="model" label="规格型号" width="160" show-overflow-tooltip header-align="center" align="center">
  52. </el-table-column>
  53. <el-table-column prop="count" label="数量" width="120" show-overflow-tooltip align="right" header-align="center">
  54. </el-table-column>
  55. <el-table-column prop="weight" label="重量" width="120" show-overflow-tooltip align="right" header-align="center">
  56. </el-table-column>
  57. <el-table-column prop="customer.name" label="订单客户" width="300" show-overflow-tooltip header-align="center">
  58. </el-table-column>
  59. <el-table-column prop="receiveAddress" label="收货地址" width="300" show-overflow-tooltip header-align="center">
  60. </el-table-column>
  61. <el-table-column prop="fkComponyId" label="客户名称" width="300" show-overflow-tooltip header-align="center">
  62. </el-table-column>
  63. <el-table-column prop="carNo" label="车号" width="150" show-overflow-tooltip header-align="center">
  64. </el-table-column>
  65. <el-table-column prop="productionPlace" label="产地" width="250" show-overflow-tooltip header-align="center">
  66. </el-table-column>
  67. <el-table-column prop="remark1" label="垛位备注" width="250" show-overflow-tooltip header-align="center">
  68. </el-table-column>
  69. <el-table-column prop="tallyPeople" label="吊装工" width="250" show-overflow-tooltip header-align="center">
  70. </el-table-column>
  71. <el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip header-align="center">
  72. </el-table-column>
  73. <el-table-column prop="addTime" label="入库时间" width="200" show-overflow-tooltip header-align="center">
  74. </el-table-column>
  75. <el-table-column prop="lockFlag" label="锁定" v-if="false" width="200" show-overflow-tooltip header-align="center">
  76. </el-table-column>
  77. </el-table>
  78. </el-col>
  79. <el-col :span="showStoreLayerSpanB">
  80. <div id="storeLayer" :style="'width:'+storeLayerWidth+'px;height:'+ storeLayerHeight +'px;margin:10px;background-color: #DCDCDC; float:left;position:relative;'"></div>
  81. </el-col>
  82. <el-col :span="4">
  83. <el-row style=" margin:10px;">
  84. <el-button type="primary" size="small" @click="handleSelect">选中</el-button>
  85. </el-row>
  86. <el-row style=" margin:10px;" v-if="isLayerShow">
  87. <el-button type="primary" size="small" @click="handleTop">置顶</el-button>
  88. </el-row>
  89. <el-row style=" margin:10px;" v-if="isLayerShow">
  90. <el-input v-model="upStep" size="small" style="float: left;width: 50px;" >上移</el-input>
  91. <el-button size="small" style="float: left;" type="primary" @click="handleUp">上移</el-button>
  92. </el-row>
  93. <el-row style=" margin:10px;" v-if="isLayerShow">
  94. <el-input v-model="downStep" size="small" style="float: left;width: 50px;" >上移</el-input>
  95. <el-button size="small" style="float: left;" type="primary" @click="handleDown">下移</el-button>
  96. </el-row>
  97. <el-row style=" margin:10px;">
  98. <el-button type="primary" size="small" @click="handleMove">转移</el-button>
  99. </el-row>
  100. <el-row style=" margin:10px;">
  101. <el-button type="primary" size="small" @click="handleSplit">拆分</el-button>
  102. </el-row>
  103. <el-row style=" margin:10px;">
  104. <el-button type="primary" size="small" @click="handleCombine">合并</el-button>
  105. </el-row>
  106. <el-row style=" margin:10px;">
  107. <el-button type="primary" size="small" @click="showDeficit">盘亏</el-button>
  108. </el-row>
  109. </el-col>
  110. </el-row>
  111. <el-dialog title="客户明细" :visible.sync="splitDialogVisible" width="500px">
  112. <el-form :model="split" label-width="100px">
  113. <el-form-item label="原始数量">
  114. <el-input v-model="split.originalCount" disabled></el-input>
  115. </el-form-item>
  116. <el-form-item label="原始重量">
  117. <el-input v-model="split.originalWeight" disabled></el-input>
  118. </el-form-item>
  119. <el-form-item label="拆分数量">
  120. <el-input v-model="split.count"></el-input>
  121. </el-form-item>
  122. <el-form-item label="拆分重量">
  123. <el-input v-model="split.weight"></el-input>
  124. </el-form-item>
  125. <el-form-item label="剩余数量">
  126. <el-input v-model="splitCount" disabled></el-input>
  127. </el-form-item>
  128. <el-form-item label="剩余重量">
  129. <el-input v-model="splitWeight" disabled></el-input>
  130. </el-form-item>
  131. <el-button type="success" @click="handleSplitSave">保存</el-button>
  132. <el-button @click="handleSplitCancelSave">取消</el-button>
  133. </el-form>
  134. </el-dialog>
  135. <el-dialog title="库房明细" :visible.sync="importDialogVisible" width="1000px">
  136. <el-upload class="upload-demo" action="" :on-change="handleChange" :on-exceed="handleExceed" :on-remove="handleRemove"
  137. ref="upload" :limit="1" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
  138. :auto-upload="false" >
  139. <el-button slot="trigger" size="small" type="primary">选择文件</el-button>
  140. <el-button size="small" type="success" @click="inImport" :disabled="imptAble">保存</el-button>
  141. </el-upload>
  142. <el-table :data="imTableData" border>
  143. <el-table-column prop="产品编号" label="产品编号" width="100" show-overflow-tooltip header-align="center">
  144. </el-table-column>
  145. <el-table-column prop="仓库" label="仓库" width="100" show-overflow-tooltip header-align="center">
  146. </el-table-column>
  147. <el-table-column prop="垛位" label="垛位" width="100" show-overflow-tooltip header-align="center">
  148. </el-table-column>
  149. <el-table-column prop="品名" label="品名" width="100" show-overflow-tooltip header-align="center">
  150. </el-table-column>
  151. <el-table-column prop="材质" label="材质" width="100" show-overflow-tooltip header-align="center">
  152. </el-table-column>
  153. <el-table-column prop="规格" label="规格" width="100" show-overflow-tooltip header-align="center">
  154. </el-table-column>
  155. <el-table-column prop="数量" label="数量" width="100" show-overflow-tooltip header-align="center">
  156. </el-table-column>
  157. <el-table-column prop="重量" label="重量" width="100" show-overflow-tooltip header-align="center">
  158. </el-table-column>
  159. <el-table-column prop="入库车号" label="入库车号" width="100" show-overflow-tooltip header-align="center">
  160. </el-table-column>
  161. <el-table-column prop="货主" label="货主" width="100" show-overflow-tooltip header-align="center">
  162. </el-table-column>
  163. <el-table-column prop="收货地址" label="收货地址" width="100" show-overflow-tooltip header-align="center">
  164. </el-table-column>
  165. <el-table-column prop="产地" label="产地" width="100" show-overflow-tooltip header-align="center">
  166. </el-table-column>
  167. <el-table-column prop="计重方式" label="计重方式" width="100" show-overflow-tooltip header-align="center">
  168. </el-table-column>
  169. <el-table-column prop="备注" label="备注" width="100" show-overflow-tooltip header-align="center">
  170. </el-table-column>
  171. <el-table-column prop="订单号" label="订单号" width="100" show-overflow-tooltip header-align="center">
  172. </el-table-column>
  173. <el-table-column prop="合约号" label="合约号" width="100" show-overflow-tooltip header-align="center">
  174. </el-table-column>
  175. <el-table-column prop="垛位备注" label="垛位备注" width="100" show-overflow-tooltip header-align="center">
  176. </el-table-column>
  177. </el-table>
  178. </el-dialog>
  179. <el-dialog title="选择行" :visible.sync="selectDialogVisible" width="500px">
  180. <el-form>
  181. <el-form-item label="">
  182. <el-input v-model="startRow" style="width: 100px;"></el-input>
  183. ~
  184. <el-input v-model="endRow" style="width: 100px;"></el-input>
  185. </el-form-item>
  186. <el-form-item label="">
  187. <el-button type="success" @click="handleSelectComfirm">选中</el-button>
  188. <el-button @click="handleSelectCancel">取消</el-button>
  189. </el-form-item>
  190. </el-form>
  191. </el-dialog>
  192. <el-dialog title="盘亏原因" :visible.sync="deficitDialogVisible" width="500px">
  193. <el-form>
  194. <el-form-item label="原因">
  195. <el-input v-model="deficitReason" type="textarea"></el-input>
  196. </el-form-item>
  197. <el-form-item label=" ">
  198. <el-button type="success" @click="handleDeficitSave">保存</el-button>
  199. <el-button type="danger" @click="handleDeficitCancelSave">取消</el-button>
  200. </el-form-item>
  201. </el-form>
  202. </el-dialog>
  203. <popup-stack-with-select-ware :wares="options" :fromStack="moveFromStack" ref="PopupStackWithSelectWare"
  204. @receviceFromChild="receviceFromWareStack"></popup-stack-with-select-ware>
  205. <popup-stack :wareName="store.wareName" ref="PopupStack" @receviceFromChild="receviceFromStack"></popup-stack>
  206. <popup-distribution ref="PopupDistribution" @receviceFromChild="receviceFromDistreibution" :selectRows="selectRows"></popup-distribution>
  207. <popup-out ref="PopupOut" @receviceFromChild="receviceFromOut"></popup-out>
  208. <popup-in ref="PopupIn" @receviceFromChild="receviceFromIn" :wares="options" :wareId="query.wareId" :stack="moveFromStack"></popup-in>
  209. </div>
  210. </template>
  211. <script>
  212. import axios from '@/axios'
  213. import zrender from 'zrender'
  214. import PopupStackWithSelectWare from '@/components/PopupStackWithSelectWare.vue'
  215. import PopupStack from '@/components/PopupStack.vue'
  216. import PopupDistribution from '@/components/PopupDistribution.vue'
  217. import PopupOut from '@/components/PopupOut.vue'
  218. import PopupIn from '@/components/PopupIn.vue'
  219. import {
  220. mapState
  221. } from 'vuex'
  222. export default {
  223. components: {
  224. PopupStackWithSelectWare,
  225. PopupStack,
  226. PopupDistribution,
  227. PopupOut,
  228. PopupIn,
  229. },
  230. computed: {
  231. splitCount: function() {
  232. let result = Number(this.split.originalCount) - Number(this.split.count)
  233. return result
  234. },
  235. splitWeight: function() {
  236. let result = Number(this.split.originalWeight) - Number(this.split.weight)
  237. return result
  238. },
  239. ...mapState({
  240. serverName: state => state.app.serverName,
  241. wareBackgroundColor: state => state.color.wareBackgroundColor,
  242. stackColor: state => state.color.stackColor,
  243. stackSelectedColor: state => state.color.stackSelectedColor,
  244. lockColor: state => state.color.lockColor,
  245. })
  246. },
  247. data() {
  248. return {
  249. upStep: 1,
  250. downStep: 1,
  251. showStoreLayer: false,
  252. showStoreLayerSpanA: 20,
  253. showStoreLayerSpanB: 0,
  254. storeLayerWidth: 600,
  255. storeLayerHeight: 300,
  256. imTableData: [],
  257. deficitDialogVisible: false,
  258. splitDialogVisible: false,
  259. importDialogVisible: false,
  260. disDialogVisible: false,
  261. selectDialogVisible: false,
  262. startRow: 0,
  263. endRow: 0,
  264. isLayerShow: true,
  265. showLayout: true,
  266. options: [],
  267. optionsArea: [],
  268. query: {
  269. wareId: '',
  270. areaId:'',
  271. stackId: ''
  272. },
  273. tableData: [],
  274. tableDataLoading: false,
  275. currentPage: 1,
  276. totalRows: 0,
  277. pageSizes: [50, 100, 200],
  278. pageSize: 50,
  279. selectRows: [],
  280. moveStack: {},
  281. moveStore: {},
  282. isLayer: "0",
  283. wareStack: [], //当前选中库房的所有垛位
  284. moveFromStack: {}, //移除垛位
  285. moveToStack: {}, //移入垛位
  286. split: {
  287. originalCount: 0,
  288. originalWeight: 0,
  289. count: 0,
  290. weight: 0,
  291. remainCount: 0,
  292. remainWeight: 0,
  293. },
  294. store: {
  295. id: '',
  296. wareName: '',
  297. stackName: '',
  298. layer: 0,
  299. materialName: '',
  300. materialNo: '',
  301. standard: '',
  302. model: '',
  303. customerName: '',
  304. customerNo: '',
  305. count: '',
  306. weight: '',
  307. remark: '',
  308. plateNo: '',
  309. receiveAddress: ''
  310. },
  311. optionsWare: [],
  312. optionsStack: [],
  313. layerDisable: false,
  314. fileTemp: [],
  315. deficitReason: '',
  316. backAble:false,
  317. inAble:false,
  318. imptAble:false,
  319. }
  320. },
  321. mounted() {
  322. this.getWare()
  323. },
  324. methods: {
  325. getWare() {
  326. var url = 'MaintWare/queryByUserId.do'
  327. var param = {}
  328. axios.get(url, param).then(response => {
  329. this.options = response.data.data
  330. //console.log("getWare() :" + JSON.stringify(this.options))
  331. if (response.data.data.length == 1) {
  332. this.query.wareId = response.data.data[0].id
  333. this.getAllStackByWareId(this.query.wareId)
  334. this.getArea()
  335. }
  336. });
  337. },
  338. getArea() {
  339. var url = 'MaintArea/queryAll.do'
  340. var param = {
  341. wareId: this.query.wareId
  342. }
  343. axios.get(url, param).then(response => {
  344. this.optionsArea = response.data.data
  345. });
  346. },
  347. change(val) {
  348. this.query.areaId = ""
  349. if (val != '') {
  350. this.getAllStackByWareId(val)
  351. }
  352. this.getArea()
  353. },
  354. changeArea(val) {
  355. if (val != '') {
  356. this.getAllStackByWareId(val)
  357. }
  358. },
  359. getAllStackByWareId() {
  360. var url = 'MaintStack/queryByWareId.do'
  361. var param = {
  362. wareId: this.query.wareId,
  363. areaId: this.query.areaId
  364. }
  365. axios.get(url, param).then(response => {
  366. if (response.data.code == 0) {
  367. this.wareStack = response.data.data
  368. this.drawWareLayout(response.data.data)
  369. } else {
  370. this.$message({
  371. type: 'error',
  372. message: '保存失败' + response.data.msg,
  373. });
  374. }
  375. });
  376. },
  377. drawWareLayout(data) {
  378. this.moveStack = zrender.init(document.getElementById('wareLayout'));
  379. for (let i = 0; i < data.length; i++) {
  380. if(data[i].onStackAmt == 0 ){
  381. var rect = new zrender.Rect({
  382. shape: {
  383. x: data[i].stackX, // * 600 / data[i].ware.width,
  384. y: data[i].stackY, // * 300 / data[i].ware.height,
  385. width: data[i].width, // * 600 / data[i].ware.width,
  386. height: data[i].height, // * 300 / data[i].ware.height,
  387. },
  388. style: {
  389. text: data[i].name,
  390. textAlign: 'center',
  391. textVerticalAlign: 'middle',
  392. fill: this.stackColor,
  393. stroke: '#000000',
  394. }
  395. })
  396. }else{
  397. var rect = new zrender.Rect({
  398. shape: {
  399. x: data[i].stackX, // * 600 / data[i].ware.width,
  400. y: data[i].stackY, // * 300 / data[i].ware.height,
  401. width: data[i].width, // * 600 / data[i].ware.width,
  402. height: data[i].height, // * 300 / data[i].ware.height,
  403. },
  404. style: {
  405. text: data[i].name,
  406. textAlign: 'center',
  407. textVerticalAlign: 'middle',
  408. fill: '#97FFFF',
  409. stroke: '#000000',
  410. }
  411. })
  412. }
  413. rect.on('click', () => {
  414. this.moveFromStack = data[i]
  415. this.query.stackId = data[i].name
  416. this.isLayer = data[i].isLayer
  417. this.getStoreByStackId()
  418. this.setStackColor()
  419. this.setMoveButton()
  420. });
  421. this.moveStack.add(rect);
  422. }
  423. },
  424. getStoreByStackId(moveSelect) {
  425. this.tableDataLoading = true
  426. var url = 'WareStore/queryByWareIdStackId.do'
  427. var param = {
  428. wareId: this.query.wareId,
  429. stackId: this.moveFromStack.id
  430. }
  431. axios.get(url, param).then(response => {
  432. if (response.data.code == 0) {
  433. this.tableData = response.data.data
  434. this.selectRows = []
  435. if (this.isLayer == '0') {
  436. this.drawStoreNoLayer(response.data.data)
  437. } else if (this.isLayer == '1') { //1是A开头的,2是B开头的,3是C开头的。
  438. this.drawStoreAutoLayer(response.data.data)
  439. } else if (this.isLayer == '2') {
  440. this.drawStoreManulLayer(response.data.data)
  441. }
  442. if (moveSelect) {
  443. this.$refs.multipleTable.clearSelection();
  444. for (let i = 0; i < this.tableData.length; i++) {
  445. for (let j = 0; j < moveSelect.length; j++) {
  446. if (moveSelect[j].layer === this.tableData[i].layer) {
  447. this.selectRows.push(this.tableData[i])
  448. }
  449. }
  450. }
  451. this.$nextTick(() => {
  452. this.toggleSelection(this.selectRows, true)
  453. this.setLayerColor()
  454. })
  455. }
  456. } else {
  457. this.$message({
  458. type: 'error',
  459. message: '保存失败' + response.data.msg,
  460. });
  461. }
  462. this.tableDataLoading = false
  463. });
  464. },
  465. drawStoreAutoLayer(data) {
  466. var height = 0;
  467. var plateLength = 0
  468. var plateWidth = 0
  469. var plateHeight = 0
  470. var firstStarIndex = 0
  471. var secondStarindex = 0
  472. var totalheight = 0
  473. height = (data.length + 1) * 20
  474. if (height < 300) {
  475. height = 300
  476. }
  477. this.storeLayerWidth = 600
  478. this.storeLayerHeight = height
  479. this.moveStore = zrender.init(document.getElementById('storeLayer'), {
  480. 'width': this.storeLayerWidth,
  481. 'height': this.storeLayerHeight
  482. });
  483. for (let i = 0; i < data.length; i++) {
  484. firstStarIndex = data[i].model.substring(0, data[i].model.lastIndexOf("*")).lastIndexOf("*")
  485. secondStarindex = data[i].model.lastIndexOf("*")
  486. plateLength = data[i].model.substring(0, firstStarIndex)
  487. plateWidth = data[i].model.substring(firstStarIndex + 1, secondStarindex)
  488. plateHeight = data[i].model.substring(secondStarindex + 1, data[i].model.length)
  489. plateHeight = 15
  490. totalheight = totalheight * 1 + plateHeight * 1 + 5
  491. var color = ''
  492. if (data[i].lockFlag == '1') {
  493. color = this.lockColor
  494. } else {
  495. color = this.stackColor
  496. }
  497. var rect = new zrender.Rect({
  498. shape: {
  499. x: (600 - plateWidth/8) / 2, // data[i].ware.width,
  500. y: totalheight, // i * 30, // data[i].ware.height,
  501. width: plateWidth/8 , //* 600 / data[i].ware.width,
  502. height: plateHeight //* 300 / data[i].ware.height,
  503. },
  504. style: {
  505. text: data[i].material.name + ' ' + data[i].plateNo + ' ' + data[i].model,
  506. textAlign: 'center',
  507. textVerticalAlign: 'middle',
  508. fill: color,
  509. stroke: '#000000',
  510. },
  511. }).on('click', (e) => {
  512. if (e.target.style.fill != this.stackSelectedColor) {
  513. if (this.tableData[i].lockFlag == '1') {
  514. this.$message({
  515. type: 'error',
  516. message: '该行已被配货锁定',
  517. });
  518. } else {
  519. this.selectRows.push(this.tableData[i])
  520. this.$nextTick(() => {
  521. this.toggleSelection(this.selectRows, true)
  522. this.setLayerColor()
  523. })
  524. }
  525. } else {
  526. for (var j = 0; j < this.selectRows.length; j++) {
  527. if (this.selectRows[j] === this.tableData[i]) {
  528. this.selectRows.splice(j, 1);
  529. }
  530. }
  531. this.$nextTick(() => {
  532. this.toggleSelection([this.tableData[i]], false)
  533. this.setLayerColor()
  534. })
  535. }
  536. });
  537. this.moveStore.add(rect);
  538. }
  539. },
  540. drawStoreManulLayer(data) {
  541. var totalLayer = 0
  542. var curLayer = -1;
  543. for (let i = 0; i < data.length; i++) {
  544. if (curLayer != data[i].layer) {
  545. curLayer = data[i].layer
  546. totalLayer += 1
  547. }
  548. }
  549. var height = totalLayer * 65
  550. if (height < 300) {
  551. height = 300
  552. }
  553. this.storeLayerWidth = 600
  554. this.storeLayerHeight = height
  555. this.moveStore = zrender.init(document.getElementById('storeLayer'), {
  556. 'width': this.storeLayerWidth,
  557. 'height': this.storeLayerHeight
  558. });
  559. var curRow = 0
  560. var curCol = 0
  561. curLayer = -1
  562. for (let i = 0; i < data.length; i++) {
  563. if (curLayer != data[i].layer) {
  564. curLayer = data[i].layer
  565. curRow += 1
  566. curCol = 1
  567. } else {
  568. curCol += 1
  569. }
  570. var color = ''
  571. if (data[i].lockFlag == '1') {
  572. color = this.lockColor
  573. } else {
  574. color = this.stackColor
  575. }
  576. var rect = new zrender.Rect({
  577. shape: {
  578. x: 60 * (curCol - 1), // data[i].ware.width,
  579. y: 60 * (curRow - 1) + 5 * curRow, // data[i].ware.height,
  580. width: 60, //* 600 / data[i].ware.width,
  581. height: 60 //* 300 / data[i].ware.height,
  582. },
  583. style: {
  584. text: data[i].materialName + ' \n' + data[i].weight + '吨\n' + data[i].count + '件',
  585. textAlign: 'center',
  586. textVerticalAlign: 'middle',
  587. fill: color,
  588. stroke: '#000000',
  589. },
  590. })
  591. rect.on('click', (e) => {
  592. if (e.target.style.fill == this.stackColor) {
  593. this.selectRows.push(this.tableData[i])
  594. this.$nextTick(() => {
  595. this.toggleSelection(this.selectRows, true)
  596. this.setLayerColor()
  597. })
  598. } else {
  599. for (var j = 0; j < this.selectRows.length; j++) {
  600. if (this.selectRows[j] === this.tableData[i]) {
  601. this.selectRows.splice(j, 1);
  602. }
  603. }
  604. this.$nextTick(() => {
  605. this.toggleSelection([this.tableData[i]], false)
  606. this.setLayerColor()
  607. })
  608. }
  609. });
  610. this.moveStore.add(rect);
  611. }
  612. },
  613. drawStoreNoLayer(data) {
  614. this.storeLayerWidth = 600
  615. this.storeLayerHeight = (data.length / 10 + 1) * 60
  616. this.moveStore = zrender.init(document.getElementById('storeLayer'), {
  617. 'width': this.storeLayerWidth,
  618. 'height': this.storeLayerHeight
  619. });
  620. for (let i = 0; i < data.length; i++) {
  621. var currentRow = parseInt(i / 10)
  622. var currentCol = Math.floor(i % 10)
  623. var color = ''
  624. if (data[i].lockFlag == '1') {
  625. color = this.lockColor
  626. } else {
  627. color = this.stackColor
  628. }
  629. var rect = new zrender.Rect({
  630. shape: {
  631. x: 60 * currentCol, // data[i].ware.width,
  632. y: 60 * currentRow, // data[i].ware.height,
  633. width: 60, //* 600 / data[i].ware.width,
  634. height: 60 //* 300 / data[i].ware.height,
  635. },
  636. style: {
  637. text: data[i].materialName + ' \n' + data[i].weight + '吨\n' + data[i].count + '件',
  638. textAlign: 'center',
  639. textVerticalAlign: 'middle',
  640. fill: color,
  641. stroke: '#000000',
  642. },
  643. })
  644. rect.on('click', (e) => {
  645. if (e.target.style.fill == this.stackColor) {
  646. this.selectRows.push(this.tableData[i])
  647. this.$nextTick(() => {
  648. this.toggleSelection(this.selectRows, true)
  649. this.setLayerColor()
  650. })
  651. } else {
  652. for (var j = 0; j < this.selectRows.length; j++) {
  653. if (this.selectRows[j] === this.tableData[i]) {
  654. this.selectRows.splice(j, 1);
  655. }
  656. }
  657. this.$nextTick(() => {
  658. this.toggleSelection([this.tableData[i]], false)
  659. this.setLayerColor()
  660. })
  661. }
  662. });
  663. this.moveStore.add(rect);
  664. }
  665. },
  666. changeShowLayout() {
  667. this.showStoreLayout = !this.showStoreLayout
  668. if (this.showStoreLayout) {
  669. this.showStoreLayerSpanA = 10
  670. this.showStoreLayerSpanB = 10
  671. } else {
  672. this.showStoreLayerSpanA = 20
  673. this.showStoreLayerSpanB = 0
  674. }
  675. },
  676. search() {
  677. //this.currentPage = 1
  678. //this.getTableData()
  679. },
  680. handleTableSelectionChange(val) {
  681. this.selectRows = val
  682. this.setLayerColor()
  683. },
  684. toggleSelection(rows, selected) {
  685. if (rows) {
  686. rows.forEach(row => {
  687. this.$refs.multipleTable.toggleRowSelection(row, selected);
  688. });
  689. }
  690. },
  691. setLayerColor() {
  692. if (this.selectRows.length == 0) {
  693. for (let i = 0; i < this.moveStore.storage._roots.length; i++) {
  694. if (this.tableData[i].lockFlag == '1') {
  695. this.moveStore.storage._roots[i].attr('style', {
  696. fill: this.lockColor,
  697. })
  698. } else {
  699. this.moveStore.storage._roots[i].attr('style', {
  700. fill: this.stackColor,
  701. })
  702. }
  703. }
  704. } else {
  705. for (let i = 0; i < this.moveStore.storage._roots.length; i++) {
  706. for (let j = 0; j < this.selectRows.length; j++) {
  707. if (this.tableData[i] === this.selectRows[j]) {
  708. this.moveStore.storage._roots[i].attr('style', {
  709. fill: this.stackSelectedColor,
  710. })
  711. break;
  712. } else {
  713. if (this.tableData[i].lockFlag == '1') {
  714. this.moveStore.storage._roots[i].attr('style', {
  715. fill: this.lockColor,
  716. })
  717. } else {
  718. this.moveStore.storage._roots[i].attr('style', {
  719. fill: this.stackColor,
  720. })
  721. }
  722. }
  723. }
  724. }
  725. }
  726. },
  727. handleTop() {
  728. if (this.selectRows.length < 1) {
  729. this.$message({
  730. type: 'error',
  731. message: '至少选择一条数据!',
  732. });
  733. return
  734. } else {
  735. var url = 'WareMove/top.do'
  736. var param = {
  737. json: JSON.stringify(this.selectRows),
  738. }
  739. axios.post(url, param).then(response => {
  740. if (response.data.code == 0) {
  741. //this.getTableData()
  742. this.getStoreByStackId(response.data.data)
  743. } else {
  744. this.$message({
  745. type: 'error',
  746. message: '操作失败;' + response.data.msg,
  747. });
  748. }
  749. });
  750. }
  751. },
  752. handleUp() {
  753. if (this.selectRows.length < 1) {
  754. this.$message({
  755. type: 'error',
  756. message: '至少选择一条数据!',
  757. });
  758. return
  759. } else {
  760. var url = 'WareMove/up.do'
  761. var param = {
  762. json: JSON.stringify(this.selectRows),
  763. step:this.upStep
  764. }
  765. axios.post(url, param).then(response => {
  766. if (response.data.code == 0) {
  767. //this.getTableData()
  768. this.getStoreByStackId(response.data.data)
  769. } else {
  770. this.$message({
  771. type: 'error',
  772. message: '操作失败;' + response.data.msg,
  773. });
  774. }
  775. });
  776. }
  777. },
  778. handleDown() {
  779. if (this.selectRows.length < 1) {
  780. this.$message({
  781. type: 'error',
  782. message: '至少选择一条数据!',
  783. });
  784. return
  785. }
  786. if (this.downStep == '') {
  787. this.$message({
  788. type: 'error',
  789. message: '请输入下移层数!',
  790. });
  791. return
  792. }
  793. var url = 'WareMove/down.do'
  794. var param = {
  795. json: JSON.stringify(this.selectRows),
  796. step:this.downStep,
  797. }
  798. axios.post(url, param).then(response => {
  799. if (response.data.code == 0) {
  800. this.getStoreByStackId(response.data.data)
  801. } else {
  802. this.$message({
  803. type: 'error',
  804. message: '操作失败;' + response.data.msg,
  805. });
  806. }
  807. });
  808. },
  809. handleMove() {
  810. if (this.selectRows.length < 1) {
  811. this.$message({
  812. type: 'error',
  813. message: '至少选择一条数据!',
  814. });
  815. return
  816. } else {
  817. var url = 'WareMove/moveCheck.do'
  818. var param = {
  819. json: JSON.stringify(this.selectRows),
  820. from: JSON.stringify(this.moveFromStack),
  821. to: JSON.stringify(this.moveToStack),
  822. }
  823. axios.post(url, param).then(response => {
  824. if (response.data.code == 0) {
  825. this.$refs.PopupStackWithSelectWare.show()
  826. //this.getStoreByStackId(response.data.data)
  827. } else {
  828. this.$message({
  829. type: 'error',
  830. message: '操作失败;' + response.data.msg,
  831. });
  832. }
  833. });
  834. }
  835. },
  836. receviceFromWareStack(stack, layer) {
  837. //console.log(layer)
  838. this.moveToStack = stack
  839. var url = 'WareMove/move.do'
  840. var param = {
  841. json: JSON.stringify(this.selectRows),
  842. from: JSON.stringify(this.moveFromStack),
  843. to: JSON.stringify(this.moveToStack),
  844. layer: layer
  845. }
  846. axios.post(url, param).then(response => {
  847. if (response.data.code == 0) {
  848. this.getStoreByStackId([])
  849. } else {
  850. this.$message({
  851. type: 'error',
  852. message: '操作失败;' + response.data.msg,
  853. });
  854. }
  855. });
  856. },
  857. handleTableSelect(selection, row) {
  858. if (row.lockFlag == '1') { //如果已经被配货,,但是仍应该能做移动等操作。指示不能拆分,合并等。
  859. // this.$message({
  860. // type: 'error',
  861. // message: '该行已被配货锁定',
  862. // });
  863. // this.toggleSelection([row], false)
  864. // for(let i = 0;i<selection.length;i++){
  865. // if(selection[i]==row){
  866. // selection.splice(i,1)
  867. // }
  868. // }
  869. this.selectRows = selection
  870. } else {
  871. this.selectRows = selection
  872. this.setLayerColor()
  873. }
  874. },
  875. setStackColor() {
  876. // alert("ll")
  877. for (let i = 0; i < this.moveStack.storage._roots.length; i++) {
  878. // alert(JSON.stringify(this.moveStack.storage._roots[i]))
  879. if (this.wareStack[i] === this.moveFromStack ) {
  880. this.moveStack.storage._roots[i].attr('style', {
  881. fill: this.stackSelectedColor,
  882. })
  883. } else if(this.wareStack[i].onStackAmt > 0) {
  884. this.moveStack.storage._roots[i].attr('style', {
  885. fill: '#97FFFF',
  886. })
  887. }else{
  888. this.moveStack.storage._roots[i].attr('style', {
  889. fill: this.stackColor,
  890. })
  891. }
  892. }
  893. },
  894. setMoveButton() {
  895. if (this.moveFromStack.isLayer == '1') {
  896. this.isLayerShow = true
  897. } else {
  898. this.isLayerShow = false
  899. }
  900. },
  901. handleSplit() {
  902. var isLock = false;
  903. if (this.selectRows.length != 1) {
  904. this.$message({
  905. type: 'error',
  906. message: '选择一条数据拆分!',
  907. });
  908. return
  909. }
  910. for(var i = 0 ;i < this.selectRows.length;i++){
  911. if(this.selectRows[i].lockFlag == "1"){
  912. isLock = true
  913. }
  914. }
  915. if(isLock){
  916. this.$message({
  917. type: 'error',
  918. message: '该行已被配货锁定,不能拆分',
  919. });
  920. return
  921. }
  922. // if(this.selectRows[0].count == 1){
  923. // this.$message({
  924. // type: 'error',
  925. // message: '数量为1,不允许拆分!',
  926. // });
  927. // return
  928. // }
  929. this.splitDialogVisible = true
  930. this.split.originalCount = this.selectRows[0].count
  931. this.split.originalWeight = this.selectRows[0].weight
  932. },
  933. handleSplitSave() {
  934. var url = 'WareSplit/split.do'
  935. var param = {
  936. json: JSON.stringify(this.selectRows),
  937. splitCount: this.split.count,
  938. splitWeight: this.split.weight,
  939. }
  940. axios.post(url, param).then(response => {
  941. if (response.data.code == 0) {
  942. this.splitDialogVisible = false
  943. this.getStoreByStackId(null)
  944. } else {
  945. this.$message({
  946. type: 'error',
  947. message: '操作失败;' + response.data.msg,
  948. });
  949. }
  950. });
  951. },
  952. handleSplitCancelSave() {
  953. this.splitDialogVisible = false
  954. },
  955. // handleOut() {
  956. // if (this.selectRows.length < 1) {
  957. // this.$message({
  958. // type: 'error',
  959. // message: '至少选择一条数据!',
  960. // });
  961. // return
  962. // } else {
  963. // var url = 'WareOut/out.do'
  964. // var param = {
  965. // json: JSON.stringify(this.selectRows),
  966. // }
  967. // axios.post(url, param).then(response => {
  968. // if (response.data.code == 0) {
  969. // this.getStoreByStackId(response.data.data)
  970. // } else {
  971. // this.$message({
  972. // type: 'error',
  973. // message: '操作失败;' + response.data.msg,
  974. // });
  975. // }
  976. // });
  977. // }
  978. // },
  979. handleImport() {
  980. this.importDialogVisible = true
  981. },
  982. handleDownload() {
  983. window.open(this.serverName.substr(0, this.serverName.lastIndexOf('/', this.serverName.lastIndexOf('/') - 1)) +
  984. '/thware_mj/import.xls')
  985. },
  986. handleInBack() {
  987. if (this.selectRows.length < 1) {
  988. this.$message({
  989. type: 'error',
  990. message: '至少选择一条数据!',
  991. });
  992. return
  993. } else {
  994. this.backAble = true;
  995. var url = 'WareIn/back.do'
  996. var param = {
  997. json: JSON.stringify(this.selectRows),
  998. }
  999. axios.post(url, param).then(response => {
  1000. if (response.data.code == 0) {
  1001. this.getStoreByStackId(response.data.data)
  1002. } else {
  1003. this.$message({
  1004. type: 'error',
  1005. message: '操作失败;' + response.data.msg,
  1006. });
  1007. }
  1008. this.backAble = false;
  1009. });
  1010. }
  1011. },
  1012. showStack() {
  1013. this.$refs.PopupStack.show()
  1014. },
  1015. receviceFromStack(stack) {
  1016. //console.log("receviceFromStack")
  1017. this.store.stackName = stack.name
  1018. if (stack.isLayer == '1') {
  1019. this.getLayer()
  1020. this.layerDisable = false
  1021. } else {
  1022. this.store.layer = 0
  1023. this.layerDisable = true
  1024. }
  1025. },
  1026. showIn() {
  1027. if (this.query.wareId == '') {
  1028. this.$message({
  1029. type: 'error',
  1030. message: '请选择入库库房'
  1031. });
  1032. return
  1033. }
  1034. if (this.query.stackId == '') {
  1035. this.$message({
  1036. type: 'error',
  1037. message: '请选择入库垛位'
  1038. });
  1039. return
  1040. }
  1041. this.$refs.PopupIn.show()
  1042. },
  1043. receviceFromIn() {
  1044. this.getStoreByStackId()
  1045. },
  1046. showOut() {
  1047. this.$refs.PopupOut.show()
  1048. },
  1049. receviceFromOut(customer) {
  1050. this.getStoreByStackId()
  1051. },
  1052. handleExceed(file, fileList) {},
  1053. handleChange(file, fileList) {
  1054. this.fileTemp = file.raw
  1055. if (this.fileTemp) {
  1056. if ((this.fileTemp.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') || (this.fileTemp.type ==
  1057. 'application/vnd.ms-excel')) {
  1058. this.importfxx(this.fileTemp)
  1059. } else {
  1060. this.$message({
  1061. type: 'warning',
  1062. message: '附件格式错误,请删除后重新上传!'
  1063. })
  1064. }
  1065. } else {
  1066. this.$message({
  1067. type: 'warning',
  1068. message: '请上传附件!'
  1069. })
  1070. }
  1071. },
  1072. handleRemove(file, fileList) {
  1073. this.fileTemp = null;
  1074. this.imTableData = [];
  1075. },
  1076. importfxx(obj) {
  1077. let _this = this;
  1078. // 通过DOM取文件数据
  1079. this.file = obj
  1080. var rABS = false; //是否将文件读取为二进制字符串
  1081. var f = this.file;
  1082. var reader = new FileReader();
  1083. //if (!FileReader.prototype.readAsBinaryString) {
  1084. FileReader.prototype.readAsBinaryString = function(f) {
  1085. var binary = "";
  1086. var rABS = false; //是否将文件读取为二进制字符串
  1087. var pt = this;
  1088. var wb; //读取完成的数据
  1089. var outdata;
  1090. var reader = new FileReader();
  1091. reader.onload = function(e) {
  1092. var bytes = new Uint8Array(reader.result);
  1093. var length = bytes.byteLength;
  1094. for (var i = 0; i < length; i++) {
  1095. binary += String.fromCharCode(bytes[i]);
  1096. }
  1097. var XLSX = require('xlsx');
  1098. if (rABS) {
  1099. wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
  1100. type: 'base64'
  1101. });
  1102. } else {
  1103. wb = XLSX.read(binary, {
  1104. type: 'binary'
  1105. });
  1106. }
  1107. outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); //outdata就是你想要的东西
  1108. // console.log(JSON.stringify(outdata))
  1109. _this.imTableData = outdata
  1110. // this.da = [...outdata]
  1111. // let arr = []
  1112. // this.da.map(v => {
  1113. // let obj = {}
  1114. // obj.code = v['设备ID']
  1115. // obj.type = v['设备型号']
  1116. // arr.push(obj)
  1117. // })
  1118. // return arr
  1119. }
  1120. reader.readAsArrayBuffer(f);
  1121. }
  1122. if (rABS) {
  1123. reader.readAsArrayBuffer(f);
  1124. } else {
  1125. reader.readAsBinaryString(f);
  1126. }
  1127. },
  1128. inImport() {
  1129. var url = 'WareIn/inImport.do'
  1130. var json = JSON.stringify(this.imTableData)
  1131. var param = {
  1132. json: json
  1133. }
  1134. this.imptAble = true;
  1135. // console.log(json)
  1136. axios.post(url, param).then(response => {
  1137. if (response.data.code == '0') {
  1138. this.$message({
  1139. type: 'success',
  1140. message: '入库成功!',
  1141. });
  1142. this.importDialogVisible = false
  1143. this.imTableData = []
  1144. this.fileTemp = null
  1145. } else {
  1146. this.$message({
  1147. type: 'error',
  1148. message: '入库失败!' + response.data.msg
  1149. });
  1150. }
  1151. this.imptAble = false;
  1152. });
  1153. },
  1154. handleCombine() {
  1155. var isLock = false;
  1156. if (this.selectRows.length < 2) {
  1157. this.$message({
  1158. type: 'error',
  1159. message: '至少选择两条数据拆合并!',
  1160. });
  1161. return
  1162. }
  1163. // if (this.moveFromStack.isLayer == '1') {
  1164. // this.$message({
  1165. // type: 'error',
  1166. // message: '分层垛位不允许合并!',
  1167. // });
  1168. // return
  1169. // }
  1170. for(var i = 0 ;i < this.selectRows.length;i++){
  1171. if(this.selectRows[i].lockFlag == "1"){
  1172. isLock = true
  1173. }
  1174. }
  1175. if(isLock){
  1176. this.$message({
  1177. type: 'error',
  1178. message: '选中行存在配货锁定,不能合并',
  1179. });
  1180. return
  1181. }
  1182. var url = 'WareCombine/combine.do'
  1183. var param = {
  1184. json: JSON.stringify(this.selectRows),
  1185. }
  1186. axios.post(url, param).then(response => {
  1187. if (response.data.code == 0) {
  1188. this.splitDialogVisible = false
  1189. this.getStoreByStackId(null)
  1190. } else {
  1191. this.$message({
  1192. type: 'error',
  1193. message: '操作失败;' + response.data.msg,
  1194. });
  1195. }
  1196. });
  1197. },
  1198. showDeficit() {
  1199. var isLock = false;
  1200. if (this.selectRows.length < 1) {
  1201. this.$message({
  1202. type: 'error',
  1203. message: '至少选择一条数据!',
  1204. });
  1205. return
  1206. }
  1207. for(var i = 0 ;i < this.selectRows.length;i++){
  1208. if(this.selectRows[i].lockFlag == "1"){
  1209. isLock = true
  1210. }
  1211. }
  1212. if(isLock){
  1213. this.$message({
  1214. type: 'error',
  1215. message: '该行已被配货锁定,不能盘亏',
  1216. });
  1217. return
  1218. }
  1219. this.deficitDialogVisible = true
  1220. },
  1221. handleDeficitSave() {
  1222. var url = 'WareDeficit/deficit.do'
  1223. var param = {
  1224. json: JSON.stringify(this.selectRows),
  1225. reason: this.deficitReason,
  1226. }
  1227. axios.post(url, param).then(response => {
  1228. if (response.data.code == 0) {
  1229. this.getStoreByStackId(null)
  1230. this.deficitDialogVisible = false
  1231. } else {
  1232. this.$message({
  1233. type: 'error',
  1234. message: '操作失败;' + response.data.msg,
  1235. });
  1236. }
  1237. });
  1238. },
  1239. handleDeficitCancelSave() {
  1240. this.deficitDialogVisible = false
  1241. },
  1242. showDistribution() {
  1243. if (this.selectRows.length < 1) {
  1244. this.$message({
  1245. type: 'warning',
  1246. message: '至少选择一条数据!',
  1247. });
  1248. return;
  1249. }
  1250. var isLock = false;
  1251. for(var i = 0 ;i < this.selectRows.length;i++){
  1252. if(this.selectRows[i].lockFlag == "1"){
  1253. isLock = true
  1254. }
  1255. }
  1256. if(isLock){
  1257. this.$message({
  1258. type: 'error',
  1259. message: '选中记录中存在已配货产品,不能配车',
  1260. });
  1261. return
  1262. }
  1263. //console.log(this.selectRows.length)
  1264. this.$refs.PopupDistribution.show()
  1265. },
  1266. receviceFromDistreibution() {
  1267. this.getStoreByStackId(null)
  1268. },
  1269. tableRowClassName({
  1270. row,
  1271. rowIndex
  1272. }) {
  1273. if (row.lockFlag == '1') {
  1274. return 'warning-row';
  1275. }
  1276. return '';
  1277. },
  1278. handleSelect() {
  1279. if (this.query.stackId == '') {
  1280. this.$message({
  1281. type: 'error',
  1282. message: '请选择垛位!',
  1283. });
  1284. return
  1285. }
  1286. this.selectDialogVisible = true
  1287. },
  1288. handleSelectComfirm() {
  1289. if (this.endRow > this.tableData.length) {
  1290. this.$message({
  1291. type: 'error',
  1292. message: '超出最大层数!',
  1293. });
  1294. return
  1295. }
  1296. if (this.endRow < this.startRow) {
  1297. this.$message({
  1298. type: 'error',
  1299. message: '开始层数不得大于结束层数!',
  1300. });
  1301. return
  1302. }
  1303. for (let i = 0; i < this.tableData.length; i++) {
  1304. if (this.tableData[i].layer >= this.startRow && this.tableData[i].layer <= this.endRow && this.tableData[i].lockFlag !=
  1305. '1') {
  1306. this.selectRows.push(this.tableData[i])
  1307. }
  1308. }
  1309. this.toggleSelection(this.selectRows, true)
  1310. this.setLayerColor()
  1311. this.selectDialogVisible = false
  1312. },
  1313. handleSelectCancel() {
  1314. this.selectDialogVisible = false
  1315. },
  1316. selectAll(selection){
  1317. this.selectRows = selection;
  1318. }
  1319. }
  1320. }
  1321. //测试用备注信息
  1322. </script>
  1323. <style>
  1324. .el-table .warning-row {
  1325. background: #F08080;
  1326. }
  1327. .el-select-dropdown .el-scrollbar .el-scrollbar__wrap
  1328. {
  1329. overflow: scroll!important;
  1330. }
  1331. .el-upload-list__item-name{
  1332. background-color: #9f9;
  1333. }
  1334. /*#store{
  1335. zoom:1;
  1336. }*/
  1337. </style>