index.vue 10 KB

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