From 232cdf071bfe3bd2b77ba05accba89b67fcc1edc Mon Sep 17 00:00:00 2001 From: Zhang-Hong-Lin <a3219986988@163.com> Date: 星期四, 26 六月 2025 18:51:14 +0800 Subject: [PATCH] 优化bug与添加一键删除按钮 --- 项目代码/WCS/WIDESEAWCS_Client/src/views/Home.vue | 623 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 615 insertions(+), 8 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/Home.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/Home.vue" index 820437a..b3ac4e1 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/Home.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/Home.vue" @@ -1,24 +1,631 @@ <template> - <div class="title"></div> + <div id="title"> + <!--涓�--> + <div id="akuang"> + <!--宸�--> + <div class="xkuang"> + <div class="xian" style="margin-top: 10px"> + <p class="name">鍏ュ簱鎵规鍙凤細</p> + <div class="zhi">{{ InBatch }}</div> + <button class="gai" @click="updates(1)">缂栬緫</button> + </div> + <div class="xian"> + <p class="name">鍑哄簱鎵规鍙凤細</p> + <div class="zhi">{{ OutBatch }}</div> + <button class="gai" @click="updates(2)">缂栬緫</button> + </div> + <div class="xian"> + <p class="name">鍑哄簱绫诲瀷锛�</p> + <div class="zhi"> + <input type="radio" name="a" id="a" />鑷骇 + <input type="radio" name="a" id="b" />澶栬喘 + </div> + <button class="gai" @click="updates(3)">缂栬緫</button> + </div> + </div> + <!--涓�--> + <div class="xkuang"> + <div class="xian" style="margin-top: 10px"> + <p class="name">鍏ュ簱绫诲瀷锛�</p> + <div class="zhi"> + <input type="radio" name="c" id="e" />姝e父鍏ュ簱 + <input type="radio" name="c" id="f" />鐩存帴鍑哄簱 + </div> + <button class="gai" @click="updates(5)">缂栬緫</button> + </div> + <div class="xian"> + <p class="name">瀛樻斁浣嶇疆锛�</p> + <div class="zhi"> + <input type="radio" name="d" id="g" />蹇�熷嚭搴� + <input type="radio" name="d" id="h" />蹇�熷叆搴� + </div> + <button class="gai" @click="updates(6)">缂栬緫</button> + </div> + <div class="xian"> + <p class="name">鏄惁鍑哄簱锛�</p> + <div class="zhi"> + <input type="radio" name="b" id="c" />鏄� + <input type="radio" name="b" id="d" />鍚� + </div> + <button class="gai" @click="updates(4)">缂栬緫</button> + </div> + </div> + <!--鍙�--> + <div class="xkuang"> + <div class="xian" style="margin-top: 10px"> + <p class="names">涓婃澘鏁版嵁璁板綍锛�</p> + <div class="zhis">{{ data.R_CommonRecorder }}</div> + </div> + <div class="xian"> + <p class="names">鍓旈櫎鏁版嵁璁板綍锛�</p> + <div class="zhis">{{ data.R_SpecialRecorder }}</div> + </div> + <div class="xian"> + <p class="names">鏋佹澘鎬婚噸閲忥細</p> + <div class="zhis">{{ data.R_TotalWeight }}</div> + </div> + </div> + </div> + <!--涓�--> + <div id="bkuang" style="border-top: none"> + <div class="skuang"> + <div class="zhuname">澶╄溅</div> + <div class="zhankuang"> + <div class="xname">澶╄溅褰撳墠杩愯妯″紡:</div> + <div class="xzhi">{{ data.R_RunMode }}</div> + </div> + <div class="zhankuang"> + <div class="xname">澶╄溅褰撳墠杩愯鐘舵��:</div> + <div class="xzhi">{{ data.R_RunState }}</div> + </div> + <div class="zhankuang"> + <div class="xname">澶╄溅鎶ヨ浠g爜:</div> + <div class="xzhi">{{ data.R_AlarmCode }}</div> + </div> + <div class="zhankuang"> + <div class="xname">澶╄溅浠诲姟鐘舵��:</div> + <div class="xzhi">{{ data.R_TaskState }}</div> + </div> + <div class="zhankuang"> + <div class="xname">澶╄溅澶ц溅褰撳墠浣嶇疆:</div> + <div class="xzhi">{{ data.R_CurrentLine }}</div> + </div> + <div class="zhankuang"> + <div class="xname">澶╄溅灏忚溅褰撳墠浣嶇疆:</div> + <div class="xzhi">{{ data.R_CurrentColumn }}</div> + </div> + <div class="zhankuang"> + <div class="xname">璧峰崌褰撳墠浣嶇疆:</div> + <div class="xzhi">{{ data.R_RiseUp_Position }}</div> + </div> + <div class="zhankuang"> + <div class="xname">浠诲姟鍙�:</div> + <div class="xzhi">{{ data.R_TaskNumber }}</div> + </div> + <div class="zhankuang"> + <div class="xname">1鍙疯揣鐖槸鍚︽湁璐�:</div> + <div class="xzhi">{{ data.R_Loaded_1 }}</div> + </div> + <div class="zhankuang"> + <div class="xname">2鍙疯揣鐖槸鍚︽湁璐�:</div> + <div class="xzhi">{{ data.R_Loaded_2 }}</div> + </div> + <div class="zhankuang"> + <div class="xname">閲嶉噺:</div> + <div class="xzhi">{{ data.weight }}</div> + </div> + </div> + <div class="skuang"> + <div class="zhuname">瑙勬暣鏈�</div> + <div class="zhankuang"> + <div class="xname">瑙勬暣鏈烘姇鍏ヤ娇鐢�:</div> + <div class="xzhi">{{ data.R_GZJ_isWork }}</div> + </div> + <div class="zhankuang"> + <div class="xname">涓婃枡妯″紡杞ㄩ亾杞�:</div> + <div class="xzhi">{{ data.R_RGVMode }}</div> + </div> + <div class="zhankuang"> + <div class="xname">涓婃枡妯″紡鍙夎溅:</div> + <div class="xzhi">{{ data.R_CCMode }}</div> + </div> + <div class="zhankuang"> + <div class="xname">涓滆法鏋跺瓙鍙彇鏉�:</div> + <div class="xzhi">{{ data.R_DK_isready }}</div> + </div> + <div class="zhankuang"> + <div class="xname">瑗胯法鏋跺瓙鍙彇鏉�:</div> + <div class="xzhi">{{ data.R_XK_isready }}</div> + </div> + <div class="zhankuang"> + <div class="xname">鍓旈櫎鏋跺瓙鍙斁鏉�:</div> + <div class="xzhi">{{ data.R_TC_isready }}</div> + </div> + <div class="zhankuang"> + <div class="xname">鍓旈櫎涓婃枡妯″紡:</div> + <div class="xzhi">{{ data.R_TCMode }}</div> + </div> + </div> + <div class="skuang"> + <div class="zhuname">鏁村舰鏈�</div> + <div class="zhankuang"> + <div class="xname">鏁村舰鏈烘姇鍏ヤ娇鐢�:</div> + <div class="xzhi">{{ data.R_ZXJ_isWork }}</div> + </div> + <div class="zhankuang"> + <div class="xname">涓婃枡妯″紡杞ㄩ亾杞�:</div> + <div class="xzhi">{{ data.R_ZXJ_RGVMode }}</div> + </div> + <div class="zhankuang"> + <div class="xname">涓婃枡妯″紡琛岃溅:</div> + <div class="xzhi">{{ data.R_ZXJ_TCMode }}</div> + </div> + <div class="zhankuang"> + <div class="xname">鍓旈櫎浣嶅彲鍙栨澘:</div> + <div class="xzhi">{{ data.R_ZXJ_TC_isready }}</div> + </div> + <div class="zhankuang"> + <div class="xname">鍓旈櫎妯″紡琛岃溅:</div> + <div class="xzhi">{{ data.R_TCMode_TC }}</div> + </div> + <div class="zhankuang"> + <div class="xname">鍓旈櫎妯″紡鍙夎溅:</div> + <div class="xzhi">{{ data.R_TCMode_CC }}</div> + </div> + <div class="zhankuang"> + <div class="xname">琛岃溅鍙噯澶囧彇鏉�:</div> + <div class="xzhi">{{ data.R_HC_isReady }}</div> + </div> + <div class="zhankuang"> + <div class="xname">琛岃溅鍙斁鏉�:</div> + <div class="xzhi">{{ data.R_HC_isReadyWork }}</div> + </div> + <div class="zhankuang"> + <div class="xname">杩涙枡灏忚溅瀹夊叏浣�:</div> + <div class="xzhi">{{ data.R_issafe }}</div> + </div> + </div> + </div> + <div id="ti"> + <div id="guan" @click="guanbi">X</div> + <div class="dakuang" v-if="xuan == 1"> + <input type="text" id="shu1" /> + </div> + <div class="dakuang" v-if="xuan == 2"> + <input type="text" id="shu2" /> + </div> + <div class="dakuang" v-if="xuan == 3"> + <input type="radio" name="aa" id="aa" class="ding" /> + <div class="yan">鑷骇</div> + <input type="radio" name="aa" id="bb" class="ding" style="margin-left: 40px;" /> + <div class="yan">澶栬喘</div> + </div> + <div class="dakuang" v-if="xuan == 4"> + <input type="radio" name="bb" id="cc" class="ding" /> + <div class="yan">鏄�</div> + <input type="radio" name="bb" id="dd" class="ding" style="margin-left: 40px;" /> + <div class="yan">鍚�</div> + </div> + <div class="dakuang" v-if="xuan == 5" style="margin-left: -100px;width:300px"> + <input type="radio" name="cc" id="ee" class="ding" /> + <div class="yan">姝e父鍏ュ簱</div> + <input type="radio" name="cc" id="ff" class="ding" style="margin-left: 40px;" /> + <div class="yan">鐩存帴鍑哄簱</div> + </div> + <div class="dakuang" v-if="xuan == 6" style="margin-left: -100px;width:300px"> + <input type="radio" name="cc" id="gg" class="ding" /> + <div class="yan">蹇�熷叆搴�</div> + <input type="radio" name="cc" id="hh" class="ding" style="margin-left: 40px;" /> + <div class="yan">蹇�熷嚭搴�</div> + </div> + <div id="xiugai" @click="xiugai()">淇敼</div> + </div> + </div> </template> <script> -import { ref, reactive } from 'vue' +import { ref, reactive, nextTick, computed, watch } from "vue"; +import { useStore } from "vuex"; +import { onMounted } from "vue"; +import axios from "axios"; export default { - setup() { + data() { return { + xuan: 0 + }; + }, + methods: { + updates(x) { + if (x == 1) { + document.getElementById("ti").style.display = "block"; + this.xuan = 1; + } else if (x == 2) { + document.getElementById("ti").style.display = "block"; + this.xuan = 2; + } else if (x == 3) { + document.getElementById("ti").style.display = "block"; + this.xuan = 3; + } else if (x == 4) { + document.getElementById("ti").style.display = "block"; + this.xuan = 4; + } else if (x == 5) { + document.getElementById("ti").style.display = "block"; + this.xuan = 5; + } else if (x == 6) { + document.getElementById("ti").style.display = "block"; + this.xuan = 6; + } + }, + xiugai() { + if (this.xuan == 1) { + let w = document.getElementById("shu1").value; + let http = "api/Batch/UpdateInBatch/?batch=" + w; + let s = {}; + if (w == "" || w == null) { + alert("璇疯緭鍏�"); + } else { + this.gai(http, s); + } + } else if (this.xuan == 2) { + let w = document.getElementById("shu2").value; + let http = "api/Batch/UpdateOutBatch/?batch=" + w; + let s = {}; + if (w == "" || w == null) { + alert("璇疯緭鍏�"); + } else { + this.gai(http, s); + } + } else if (this.xuan == 3) { + let w = "api/Batch/UpdateOutStorageMode"; + let n = document.getElementById("aa").checked; + let m = document.getElementById("bb").checked; + if (n) { + let http = w + "?isout=0"; + let s = {}; + this.gai(http, s); + } else if (m) { + let http = w + "?isout=1"; + let s = {}; + this.gai(http, s); + alert(n + "" + m); + } else { + alert("璇烽�夋嫨"); + } + } else if (this.xuan == 4) { + let w = "api/OutStock/UpdateIsOutStock"; + let n = document.getElementById("cc").checked; + let m = document.getElementById("dd").checked; + if (n) { + let http = w + "?isout=1"; + let s = {}; + this.gai(http, s); + } else if (m) { + let http = w + "?isout=0"; + let s = {}; + this.gai(http, s); + } else { + alert("璇烽�夋嫨"); + } + } else if (this.xuan == 5) { + let w = "api/OutStock/UpdateInOut"; + let n = document.getElementById("ee").checked; + let m = document.getElementById("ff").checked; + if (n) { + let http = w + "?isout=1"; + let s = {}; + this.gai(http, s); + } else if (m) { + let http = w + "?isout=2"; + let s = {}; + this.gai(http, s); + } else { + alert("璇烽�夋嫨"); + } + } else if (this.xuan == 6) { + let w = "api/StorageMode/UpdateStoragemode/"; + let n = document.getElementById("gg").checked; + let m = document.getElementById("hh").checked; + if (n) { + let http = w + "?storagemode=2"; + let s = {}; + this.gai(http, s); + } else if (m) { + let http = w + "?storagemode=1"; + let s = {}; + this.gai(http, s); + } else { + alert("璇烽�夋嫨"); + } + } + }, + gai(http, s) { + axios.post(http, s).then(x => { + document.getElementById("ti").style.display = "none"; + alert("淇敼鎴愬姛"); + }); + }, + guanbi() { + document.getElementById("ti").style.display = "none"; } + }, + setup() { + const store = useStore(); + const data = ref({}); + + const InBatch = ref(); + const OutBatch = ref(); + + const cha = () => { + axios.post("api/Batch/getPageData", { rows: 30 }).then(x => { + InBatch.value = x.data.rows[0].inBatch; + OutBatch.value = x.data.rows[0].outBatch; + if (x.data.rows[0].materType == 0) { + document.getElementById("a").checked = true; + } else if (x.data.rows[0].materType == 1) { + document.getElementById("b").checked = true; + } + }); + axios.post("api/OutStock/getPageData", { rows: 30 }).then(x => { + if (x.data.rows[0].isout == 1) { + document.getElementById("c").checked = true; + } else if (x.data.rows[0].isout == 0) { + document.getElementById("d").checked = true; + } + + if (x.data.rows[0].inOut == 1) { + document.getElementById("e").checked = true; + } else if (x.data.rows[0].inOut == 2) { + document.getElementById("f").checked = true; + } + }); + axios.post("api/StorageMode/getPageData", { rows: 30 }).then(x => { + if (x.data.rows[0].storagemode == 1) { + document.getElementById("g").checked = true; + } else if (x.data.rows[0].storagemode == 2) { + document.getElementById("h").checked = true; + } + }); + }; + + onMounted(() => { + nextTick(() => { + setInterval(() => { + data.value = store.state.homedata; + cha(); + let xian = document.getElementsByClassName("xzhi"); + for (let i = 0; i < xian.length; i++) { + if (xian[i].innerHTML == "true") { + xian[i].style.color = "green"; + } else if (xian[i].innerHTML == "false") { + xian[i].style.color = "red"; + } + } + }, 3000); + }); + }); + return { + data, + InBatch, + OutBatch + }; } -} +}; </script> <style scoped> -.title { - line-height: 70vh; +.zhis { + width: 45%; + height: 5vh; + float: left; + margin-top: 10px; + margin-left: -10%; + line-height: 60px; text-align: center; - font-size: 28px; - color: orange; + font-size: 1.1cqw; + color: white; +} +.names { + width: 28%; + height: 5vh; + float: left; + margin-top: 10px; + margin-left: 20%; + line-height: 60px; + text-align: right; + font-size: 1.1cqw; + color: white; +} +.ding { + float: left; + width: 20px; + height: 20px; + margin-top: 7px; +} +.yan { + color: white; + float: left; + font-size: 25px; +} +.dakuang { + width: 250px; + height: 50px; + position: absolute; + top: 150px; + left: 200px; +} +#xiugai { + width: 100px; + height: 30px; + float: left; + border-radius: 5px; + text-align: center; + line-height: 30px; + cursor: pointer; + border: 1px solid white; + color: white; + background: rgba(255, 255, 255, 0.5); + font-size: 25px; + position: absolute; + top: 150px; + left: 450px; +} +#xiugai:hover { + background: #f60; +} +#shu1, +#shu2 { + width: 200px; + height: 30px; + float: left; + margin-top: 0px; + margin-right: 0px; + border-radius: 5px; + border: 1px solid white; +} +#guan { + width: 40px; + height: 40px; + float: left; + font-size: 1.1cqw; + text-align: center; + line-height: 40px; + cursor: pointer; + margin-left: 560px; + color: white; + position: absolute; +} +#ti { + width: 600px; + height: 300px; + position: relative; + background: rgba(255, 255, 255, 1); + border-radius: 10px; + top: 230px; + left: 35%; + display: none; + background-image: url("../img/1.png"); + background-repeat: no-repeat; + background-size: 170%; + background-position: -220px 0px; +} +.zhuname { + width: 100%; + height: 5vh; + float: left; + text-align: center; + line-height: 50px; + font-weight: 700; + font-size: 1.1cqw; + color: white; +} +.xname { + width: 70%; + height: 80px; + float: left; + line-height: 7vh; + font-size: 1.1cqw; + color: white; +} +.xzhi { + width: 30%; + height: 7vh; + float: left; + line-height: 65px; + font-size: 1.1cqw; + color: white; +} +.zhankuang { + width: 45%; + height: 7vh; + margin-top: 10px; + margin-left: 5%; + float: left; +} +.gai { + width: 15%; + height: 3vh; + float: left; + border-radius: 10px; + cursor: pointer; + margin-top: 22px; + margin-left: 1%; + font-size: 1.1cqw; +} +.gai:hover { + background-color: #f60; + color: white; +} +.zhi { + width: 45%; + height: 5vh; + float: left; + margin-top: 10px; + margin-left: 1%; + line-height: 60px; + text-align: center; + font-size: 1.1cqw; + color: white; +} +.name { + width: 28%; + height: 5vh; + float: left; + margin-top: 10px; + margin-left: 1%; + line-height: 60px; + text-align: right; + font-size: 1.1cqw; + color: white; +} +.xian { + width: 100%; + height: 9vh; + float: left; +} +#title { + float: left; + width: 95%; + height: 88vh; + margin-top: 40px; + margin-left: 3%; + background-image: url("../img/1.png"); + background-repeat: no-repeat; + background-size: 100%; + container-type: inline-size; +} +#akuang { + width: 100%; + height: 33vh; + float: left; +} +#bkuang { + width: 100%; + height: 55vh; + float: left; +} +.xkuang { + float: left; + width: 31%; + height: 28vh; + border-top: none; + border-left: none; + border-bottom: none; + background: rgba(255, 255, 255, 0.2); + margin-left: 1.7%; + margin-top: 20px; + border-radius: 10px; +} +.skuang { + width: 31%; + height: 55vh; + float: left; + border-top: none; + border-left: none; + border-bottom: none; + background: rgba(255, 255, 255, 0.2); + margin-left: 1.7%; + border-radius: 10px; } </style> \ No newline at end of file -- Gitblit v1.9.3