index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <el-container>
  3. <el-header style="height: 40px">
  4. <div>
  5. <div class="divLeft colorYellow">
  6. 任务中
  7. </div>
  8. <div class="divLeft colorWhite">
  9. </div>
  10. <div class="divLeft colorGreen">
  11. 有货
  12. </div>
  13. <div class="divLeft colorRed">
  14. 不合格
  15. </div>
  16. <!-- <div class="divLeft">-->
  17. <!-- 库存<icon-svg name="steel" class="site-sidebar__menu-icon"></icon-svg>-->
  18. <!-- </div>-->
  19. <div class="divLeft">
  20. 【托盘】<svg-icon class-name="pallet-icon" icon-class="pallet" @click.stop="click" />
  21. </div>
  22. </div>
  23. </el-header>
  24. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="600px" label-position="right">
  25. <el-form-item label="仓库" prop="warehouseId" v-show="false">
  26. <el-select v-model="queryParams.warehouseId" placeholder="请选择所属仓库" clearable size="small" style="width: 100%" >
  27. <el-option
  28. v-for="dict in this.warehouseCombo"
  29. :key="dict.warehouseId"
  30. :label="dict.warehouseName"
  31. :value="dict.warehouseId"
  32. />
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item label="区域" prop="zoneId">
  36. <el-select v-model="queryParams.zoneId" placeholder="请选择库区" clearable size="small" style="width: 100%">
  37. <el-option
  38. v-for="dict in this.locationZoneCombo"
  39. :key="dict.zoneId"
  40. :label="dict.zoneName"
  41. :value="dict.zoneId"
  42. />
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item label="刷新时间" labelWidth="80px">
  46. <el-select v-model="timerValue" @change="timerChange()" placeholder="" clearable size="small" style="width: 50%" >
  47. <el-option
  48. v-for="item in timerOptions"
  49. :key="item.value"
  50. :label="item.label"
  51. :value="item.value">
  52. </el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item>
  56. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  57. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  58. </el-form-item>
  59. </el-form>
  60. <el-main>
  61. <el-card v-for="zone in locationZoneList" v-bind:key="zone.zoneName" class="box-card">
  62. <div slot="header" class="clearfix">
  63. <span style="font-weight: bold">{{zone.zoneName}}</span>
  64. </div>
  65. <div class="divBoxCol" v-for="col in zone.basLocationGuiColDTOS">
  66. <div v-for="o in col.baseLocationGuiDTOList" v-bind:key="o.id" class="text item divBox" @click="changeLocation(o)">
  67. <div class="divMinBox" v-show="o.locationNo!=null">
  68. {{o.locationNo}}<!--(<font class="pointcss">{{o.agvStation}}</font>)-->
  69. </div>
  70. <div>
  71. <div v-show="o.isEmpty=='Y'" :class="{'locDiv': true,'colorWhite': true, 'colorYellow': o.stockStatus!='00'}">
  72. </div>
  73. <div v-show="o.isEmpty=='N'" :class="{'locDiv': true,'colorGreen': o.isEmptyPlate != 'Y','colorRed': o.lotatt05 == 'BHG','colorYellow': o.stockStatus!='00'}">
  74. <div class="divMinFontBox" v-show="o.isEmpty=='N' && o.isEmptyPlate != 'Y' ">
  75. <div style="color: #FFFFFF;font-size:10px;">{{o.lotatt01}}&nbsp;&nbsp; </div>
  76. <!-- <div v-show="o.skuName!=null" style="color: #FFFFFF;font-size:10px;">{{o.skuName}}</div>-->
  77. <!-- <div v-show="o.lotatt05!=null" style="color: #FFFFFF">{{o.lotatt05}}</div>-->
  78. <!-- <div v-show="o.lotatt08!=null" style="color: #FFFFFF">{{o.lotatt08}}</div>-->
  79. </div>
  80. <div class="divMinFontBoxEmptyPlate" v-show="o.isEmptyPlate == 'Y'">
  81. <svg-icon class-name="pallet-icon" icon-class="pallet" @click.stop="click" style="width: 60px;height: 35px;">{{o.id}}</svg-icon>
  82. <div style="color: #191970;font-size:12px;">{{o.skuName}}&nbsp;&nbsp;</div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </el-card>
  89. </el-main>
  90. <!-- 点击库位弹出展示框做修改 -->
  91. <el-dialog title="操作" :visible.sync="open" width="1000px" append-to-body>
  92. <el-form>
  93. <el-form-item>
  94. <el-button type="primary" @click="lockLoc()">锁定/解锁</el-button>
  95. <el-button type="primary" @click="occupyLoc()">有货/无货</el-button>
  96. <el-button type="primary" @click="clearLoc()">清空</el-button>
  97. <!--<el-button type="primary" @click="submitForm">初始化一个空托盘</el-button>-->
  98. </el-form-item>
  99. </el-form>
  100. <el-divider content-position="center">批次属性信息</el-divider>
  101. <el-table v-loading="loading" :data="form.lotattList">
  102. <el-table-column label="物料" align="center" prop="sku" width="200"/>
  103. <el-table-column label="物料名称" align="center" prop="skuName" width="200"/>
  104. <el-table-column label="库位" align="center" prop="locationNo" width="200"/>
  105. <el-table-column label="库存数量" align="center" prop="qty"/>
  106. <el-table-column label="已分配数量" align="center" prop="qtyallocated" width="200"/>
  107. <el-table-column
  108. v-for="(item, index) in itemOption"
  109. :key="index_back"
  110. :label="item.label"
  111. align="center" :prop="item.prop" width="200">
  112. </el-table-column>
  113. </el-table>
  114. <!--<el-descriptions title="批次属性" :column="2" border>
  115. <el-descriptions-item v-for="(item, index) in itemOption" :label="item.label">{{form[`${item.prop}`]}}</el-descriptions-item>
  116. </el-descriptions>-->
  117. </el-dialog>
  118. </el-container>
  119. </template>
  120. <script>
  121. import { clearLocRequest,locationInvView,queryLocationZoneDict,lockLocRequest,lotattConfigList
  122. ,lotattInfo,occupyLocRequest,queryWarehouseDict} from "@/api/ams/locationView";
  123. export default {
  124. data () {
  125. return {
  126. timerOptions: [{
  127. value: 60000,
  128. label: '1分钟'
  129. }, {
  130. value: 300000,
  131. label: '5分钟'
  132. }, {
  133. value: 600000,
  134. label: '10分钟'
  135. }, {
  136. value: 900000,
  137. label: '15分钟'
  138. }, {
  139. value: 1200000,
  140. label: '20分钟'
  141. },
  142. {
  143. value: 5000,
  144. label: '5秒'
  145. }],
  146. timerValue: 5000,
  147. open: false,
  148. showSearch: true,
  149. dataForm: {
  150. zoneId: ''
  151. },
  152. queryParams: {
  153. zoneId: '',
  154. warehouseId: ''
  155. },
  156. locationZoneList: [],
  157. locationList: {'a': [1, 2, 3]},
  158. locationClearVisible: false,
  159. // 表单参数
  160. form: {
  161. lotatt01: '',
  162. lotatt02: '',
  163. lotatt03: '',
  164. lotatt04: '',
  165. lotatt05: '',
  166. lotatt06: '',
  167. lotatt07: '',
  168. lotatt08: '',
  169. lotatt09: '',
  170. lotatt10: '',
  171. lotatt11: '',
  172. lotatt12: '',
  173. lotatt13: '',
  174. lotatt14: '',
  175. lotatt15: '',
  176. lotatt16: '',
  177. lotatt17: '',
  178. lotatt18: '',
  179. lotattList: null
  180. },
  181. itemOption: []
  182. }
  183. },
  184. mounted () {
  185. },
  186. activated () {
  187. },
  188. created () {
  189. // this.getWarehouseList()
  190. this.getBasZoneList()
  191. this.getDataList()
  192. this.getItemopention()
  193. this.timer = setInterval(this.getDataList, this.timerValue);
  194. },
  195. beforeDestroy () {
  196. clearInterval(this.timer)
  197. },
  198. methods: {
  199. handleQuery() {
  200. this.getDataList();
  201. },
  202. clearInterval () {
  203. clearInterval(this.timer)
  204. },
  205. timerChange(){
  206. this.clearInterval ();
  207. this.timer = setInterval(this.getDataList, this.timerValue);
  208. },
  209. getItemopention(){
  210. lotattConfigList().then(response => {
  211. let data = response.data
  212. for(let i=0;i<data.length;i++) {
  213. let obj = new Object();
  214. obj.label = data[i].lotattName
  215. obj.prop = data[i].lotattId
  216. this.itemOption.push(obj)
  217. }
  218. })
  219. },
  220. getDataList () {
  221. this.dataListLoading = true
  222. locationInvView(this.queryParams).then(response => {
  223. this.locationZoneList = response.data
  224. })
  225. this.dataListLoading = false
  226. },
  227. changeLocation(o){
  228. this.selected(o)
  229. // alert(o.locationNo);
  230. },
  231. resetQuery() {//重置搜索
  232. this.resetForm("queryForm");
  233. this.getDataList();
  234. },
  235. selected(item) {
  236. if (item.locationNo) {
  237. this.currentSelect = parseInt(item.id)
  238. this.open = true;
  239. lotattInfo(this.currentSelect).then(response => {
  240. this.form.lotattList = response.data
  241. this.loading = false;
  242. })
  243. }
  244. },
  245. lockLoc() {
  246. let that = this
  247. this.$modal.confirm('是否确认要锁定/解锁?').then(function() {
  248. lockLocRequest(that.currentSelect).then(response => {
  249. if (response.code === 200) {
  250. that.open = false;
  251. that.$modal.msgSuccess(response.msg);
  252. that.search();
  253. } else {
  254. that.$modal.msgError(response.msg);
  255. }
  256. });
  257. });
  258. },
  259. occupyLoc() {
  260. let that = this
  261. this.$modal.confirm('是否确认要修改库位状态?').then(function() {
  262. occupyLocRequest(that.currentSelect).then(response => {
  263. if (response.code === 200) {
  264. that.open = false;
  265. that.$modal.msgSuccess(response.msg);
  266. that.search();
  267. } else {
  268. that.$modal.msgError(response.msg);
  269. }
  270. });
  271. });
  272. },
  273. clearLoc() {
  274. let that = this
  275. this.$modal.confirm('是否确认要清空库存?').then(function() {
  276. clearLocRequest(that.currentSelect).then(response => {
  277. if (response.code === 200) {
  278. that.open = false;
  279. that.$modal.msgSuccess(response.msg);
  280. that.search();
  281. } else {
  282. that.$modal.msgError(response.msg);
  283. }
  284. });
  285. });
  286. },
  287. getBasZoneList() {
  288. queryLocationZoneDict().then(response => {
  289. this.locationZoneCombo = response.data
  290. })
  291. },
  292. getWarehouseList() {
  293. queryWarehouseDict().then(response => {
  294. this.warehouseCombo = response.data
  295. });
  296. },
  297. }
  298. }
  299. </script>
  300. <style>
  301. .pointcss{
  302. color: hotpink;
  303. }
  304. .divBoxCol {
  305. width: 150px;
  306. display: block;
  307. float: left;
  308. }
  309. .divBox {
  310. width: 130px;
  311. height: 90px;
  312. display: block;
  313. float: left;
  314. margin-left: 2px;
  315. }
  316. .divMinBox {
  317. margin-top: 0px;
  318. height: 15px;
  319. width: 100%;
  320. text-align: center;
  321. font-weight: bold;
  322. }
  323. .divMinFontBox {
  324. margin-top: 2px;
  325. height: 10px;
  326. width: 100%;
  327. text-align: center;
  328. /*font-size: 1px;*/
  329. }
  330. .locDiv {
  331. float: left;
  332. display: inline-block;
  333. width: 130px;
  334. height: 70px;
  335. margin-top: 1px;
  336. text-align: center;
  337. margin-left: 1px;
  338. border: solid 1px;
  339. }
  340. .colorWhite {
  341. background-color: #e6ece6;
  342. }
  343. .colorGreen {
  344. background-color: #19a708;
  345. }
  346. .colorRed {
  347. background-color: #c73c2d;
  348. }
  349. .colorYellow {
  350. background-color: #e2cd0f;
  351. }
  352. .divLeft {
  353. border-top: 1px;
  354. border-color: #2b373d;
  355. text-align: left;
  356. display: inline-block;
  357. height: 30px;
  358. width: 80px;
  359. text-align: center;
  360. margin-top: 42.5px;
  361. padding-top: 5px;
  362. }
  363. .box-card{
  364. width: 100%;
  365. display:inline-block;
  366. overflow: hidden;
  367. }
  368. </style>