From cbe5bd13f359ab0030f60ceefe9fe124550347fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E7=A5=96=E6=9C=9B?= <573413756@qq.com> Date: Thu, 30 Nov 2023 16:24:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=96=B9=E5=BC=8F=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BC=96=E5=8F=B7=E8=87=AA=E5=8A=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/terminal/stock/index.vue | 104 ++++++++++++++---- 1 file changed, 84 insertions(+), 20 deletions(-) diff --git a/xiuosiot-frontend/src/views/terminal/stock/index.vue b/xiuosiot-frontend/src/views/terminal/stock/index.vue index 8fd6add..98d758e 100644 --- a/xiuosiot-frontend/src/views/terminal/stock/index.vue +++ b/xiuosiot-frontend/src/views/terminal/stock/index.vue @@ -6,7 +6,7 @@ style="align-items: baseline; margin-bottom: 30px" >
-
+

库存管理

{{ date }} + + +
@@ -55,7 +63,7 @@
-
{{ terminalTypeDesc }}
+
{{ fzDeviceType ? fzDeviceType : '全部' }}
{{ "总数:" + totalnum }}
@@ -125,6 +133,8 @@ command="教学型RISCV" >教学型RISCV 教学型ARM + 矽数通工业型RISCV + 矽数通工业型ARM
X
@@ -215,9 +225,22 @@ export default { operationType: 1, // 1-新增,2-编辑 form: {}, totalnum: 0, - terminalType: 0, - terminalTypeDesc: '全部', - searchNo: '' + searchNo: '', + fzDeviceType: '', + deviceOptions: [ + '矽灵通RISCV', + '矽灵通ARM', + '矽望通', + '矽慧通', + '矽达通RISCV', + '矽达通ARM', + 'AIIT-RISCV', + 'AIIT-ARM', + '教学型RISCV', + '教学型ARM', + '矽数通工业型RISCV', + '矽数通工业型ARM' + ] } }, mounted() { @@ -231,12 +254,6 @@ export default { this.totalnum = res.data.length }) }, - getListByType(data) { - getListByType(data).then((res) => { - this.list = res.data - this.totalnum = res.data.length - }) - }, handleClick(type, desc) { this.terminalType = type this.terminalTypeDesc = desc @@ -245,13 +262,10 @@ export default { } this.getListByType(data) }, - handleSearch(no) { - if (!no) { - this.terminalTypeDesc = '全部' - this.getList() - } else { + handleSearch() { + if (this.searchNo) { const data = { - device_no: no + device_no: this.searchNo } getListByNo(data).then((res) => { if (res.data) { @@ -263,6 +277,14 @@ export default { this.totalnum = 0 } }) + } else { + const data = { + type: this.fzDeviceType + } + getListByType(data).then((res) => { + this.list = res.data + this.totalnum = res.data.length + }) } }, remove(fzDeviceNo) { @@ -288,7 +310,7 @@ export default { this.visible = true }, add() { - this.form = { fzDeviceType: '矽灵通RISCV' } + this.form = { fzDeviceType: this.fzDeviceType ? this.fzDeviceType : '矽灵通RISCV' } this.operationType = 1 // 新增 this.visible = true }, @@ -296,7 +318,46 @@ export default { this.visible = false }, async save() { - const data = { ...this.form } + let prepend = '' + switch (this.form.fzDeviceType) { + case '矽灵通RISCV': + prepend = '3559A 5G-' + break + case '矽灵通ARM': + prepend = '3559A 4G-' + break + case '矽望通': + prepend = 'M7 A7 5G-' + break + case '矽慧通': + prepend = 'MLU220 5G-' + break + case '矽达通RISCV': + prepend = 'RISCV 4G-1' + break + case '矽达通ARM': + prepend = 'ARM 4G-' + break + case 'AIIT-RISCV': + prepend = 'RISCV-' + break + case 'AIIT-ARM': + prepend = 'ARM-' + break + case '教学型RISCV': + prepend = 'EDU-RISCV-' + break + case '教学型ARM': + prepend = 'EDU-ARM-' + break + case '矽数通工业型RISCV': + prepend = 'RISCV LoRa-' + break + case '矽数通工业型ARM': + prepend = 'M4 LoRa-' + break + } + const data = { ...this.form, fzDeviceNo: prepend + this.form.fzDeviceNo } const res = this.operationType === 1 ? await add(data) @@ -329,6 +390,9 @@ export default { display: inline-block; margin-left: 20%; } + .el-select{ + width: 280px; + } .type_btn { // margin-right: 10%; float: right;