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;