index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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>
  46. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  47. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  48. </el-form-item>
  49. </el-form>
  50. <el-main>
  51. <el-card v-for="zone in locationZoneList" v-bind:key="zone.zoneName" class="box-card">
  52. <div slot="header" class="clearfix">
  53. <span style="font-weight: bold">{{zone.zoneName}}</span>
  54. </div>
  55. <div class="divBoxCol" v-for="col in zone.basLocationGuiColDTOS">
  56. <div v-for="o in col.baseLocationGuiDTOList" v-bind:key="o.id" class="text item divBox" @click="changeLocation(o)">
  57. <div class="divMinBox" v-show="o.locationNo!=null">
  58. {{o.locationNo}}<!--(<font class="pointcss">{{o.agvStation}}</font>)-->
  59. </div>
  60. <div>
  61. <div v-show="o.isEmpty=='Y'" :class="{'locDiv': true,'colorWhite': true, 'colorYellow': o.stockStatus!='00'}">
  62. </div>
  63. <div v-show="o.isEmpty=='N'" :class="{'locDiv': true,'colorGreen': o.isEmptyPlate != 'Y','colorRed': o.lotatt05 == 'BHG','colorYellow': o.stockStatus!='00'}">
  64. <div class="divMinFontBox" v-show="o.isEmpty=='N' && o.isEmptyPlate != 'Y' ">
  65. <div style="color: #FFFFFF;font-size:10px;">{{o.lotatt07}}&nbsp;&nbsp; </div>
  66. <div v-show="o.sku!=null" style="color: #FFFFFF;font-size:10px;">{{o.sku}}</div>
  67. <div v-show="o.lotatt02!=null" style="color: #FFFFFF;font-size:10px;">{{o.lotatt02}}</div>
  68. <!-- <div v-show="o.lotatt05!=null" style="color: #FFFFFF">{{o.lotatt05}}</div>-->
  69. <!-- <div v-show="o.lotatt08!=null" style="color: #FFFFFF">{{o.lotatt08}}</div>-->
  70. </div>
  71. <div class="divMinFontBoxEmptyPlate" v-show="o.isEmptyPlate == 'Y'">
  72. <svg-icon class-name="pallet-icon" icon-class="pallet" @click.stop="click" style="width: 60px;height: 35px;">{{o.id}}</svg-icon>
  73. <div style="color: #191970;font-size:12px;">{{o.skuName}}&nbsp;&nbsp;</div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </el-card>
  80. </el-main>
  81. <!-- 点击库位弹出展示框做修改 -->
  82. <el-dialog title="操作" :visible.sync="open" width="1000px" append-to-body>
  83. <el-form>
  84. <el-form-item>
  85. <el-button type="primary" @click="lockLoc()">锁定/解锁</el-button>
  86. <el-button type="primary" @click="occupyLoc()">有货/无货</el-button>
  87. <el-button type="primary" @click="clearLoc()">清空</el-button>
  88. <!--<el-button type="primary" @click="submitForm">初始化一个空托盘</el-button>-->
  89. </el-form-item>
  90. </el-form>
  91. <el-divider content-position="center">批次属性信息</el-divider>
  92. <el-table v-loading="loading" :data="form.lotattList">
  93. <el-table-column label="物料" align="center" prop="sku" width="200"/>
  94. <el-table-column label="物料名称" align="center" prop="skuName" width="200"/>
  95. <el-table-column label="库位" align="center" prop="locationNo" width="200"/>
  96. <el-table-column label="库存数量" align="center" prop="qty"/>
  97. <el-table-column label="已分配数量" align="center" prop="qtyallocated" width="200"/>
  98. <el-table-column
  99. v-for="(item, index) in itemOption"
  100. :key="index_back"
  101. :label="item.label"
  102. align="center" :prop="item.prop" width="200">
  103. </el-table-column>
  104. </el-table>
  105. <!--<el-descriptions title="批次属性" :column="2" border>
  106. <el-descriptions-item v-for="(item, index) in itemOption" :label="item.label">{{form[`${item.prop}`]}}</el-descriptions-item>
  107. </el-descriptions>-->
  108. </el-dialog>
  109. </el-container>
  110. </template>
  111. <script>
  112. import { clearLocRequest,locationInvView,queryLocationZoneDict,lockLocRequest,lotattConfigList
  113. ,lotattInfo,occupyLocRequest,queryWarehouseDict} from "@/api/ams/locationView";
  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.getWarehouseList()
  160. this.getBasZoneList()
  161. this.getDataList()
  162. this.getItemopention()
  163. this.timer = setInterval(this.getDataList, 5000)
  164. },
  165. beforeDestroy () {
  166. clearInterval(this.timer)
  167. },
  168. methods: {
  169. getItemopention(){
  170. lotattConfigList().then(response => {
  171. let data = response.data
  172. for(let i=0;i<data.length;i++) {
  173. let obj = new Object();
  174. obj.label = data[i].lotattName
  175. obj.prop = data[i].lotattId
  176. this.itemOption.push(obj)
  177. }
  178. })
  179. },
  180. getDataList () {
  181. this.dataListLoading = true
  182. locationInvView(this.queryParams).then(response => {
  183. this.locationZoneList = response.data
  184. })
  185. this.dataListLoading = false
  186. },
  187. changeLocation(o){
  188. this.selected(o)
  189. // alert(o.locationNo);
  190. },
  191. resetQuery() {//重置搜索
  192. this.resetForm("queryForm");
  193. this.getDataList();
  194. this.handleQuery();
  195. },
  196. selected(item) {
  197. if (item.locationNo) {
  198. this.currentSelect = parseInt(item.id)
  199. this.open = true;
  200. lotattInfo(this.currentSelect).then(response => {
  201. this.form.lotattList = response.data
  202. this.loading = false;
  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. getBasZoneList() {
  249. queryLocationZoneDict().then(response => {
  250. this.locationZoneCombo = response.data
  251. })
  252. },
  253. getWarehouseList() {
  254. queryWarehouseDict().then(response => {
  255. this.warehouseCombo = response.data
  256. });
  257. },
  258. }
  259. }
  260. </script>
  261. <style>
  262. .pointcss{
  263. color: hotpink;
  264. }
  265. .divBoxCol {
  266. width: 150px;
  267. display: block;
  268. float: left;
  269. }
  270. .divBox {
  271. width: 130px;
  272. height: 90px;
  273. display: block;
  274. float: left;
  275. margin-left: 2px;
  276. }
  277. .divMinBox {
  278. margin-top: 0px;
  279. height: 15px;
  280. width: 100%;
  281. text-align: center;
  282. font-weight: bold;
  283. }
  284. .divMinFontBox {
  285. margin-top: 2px;
  286. height: 10px;
  287. width: 100%;
  288. text-align: center;
  289. /*font-size: 1px;*/
  290. }
  291. .locDiv {
  292. float: left;
  293. display: inline-block;
  294. width: 130px;
  295. height: 70px;
  296. margin-top: 1px;
  297. text-align: center;
  298. margin-left: 1px;
  299. border: solid 1px;
  300. }
  301. .colorGreen {
  302. background-color: #19a708;
  303. }
  304. .colorRed {
  305. background-color: #c73c2d;
  306. }
  307. .colorYellow {
  308. background-color: #e2cd0f;
  309. }
  310. .divLeft {
  311. border-top: 1px;
  312. border-color: #2b373d;
  313. text-align: left;
  314. display: inline-block;
  315. height: 30px;
  316. width: 80px;
  317. text-align: center;
  318. margin-top: 42.5px;
  319. padding-top: 5px;
  320. }
  321. .box-card{
  322. width: 100%;
  323. display:inline-block;
  324. overflow: hidden;
  325. }
  326. </style>