index.vue 11 KB

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