2/17 高拍仪设置优化1.0

20240912_adapter
wangwei 2 months ago
parent a16362af4b
commit ff20685b6e

@ -203,13 +203,13 @@
</template> </template>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8" class="el-col"> <el-col :span="8" class="el-col">
<el-form-item label="扫码数量设置:" prop="scanMaxCount" style="margin-bottom: 0"> <el-form-item label="扫码数量设置:" prop="fixedCount" style="margin-bottom: 0">
<el-input <el-input
style="width: 90%" style="width: 90%"
size="small" size="small"
type='number' type='number'
splaceholder="请输入内容" splaceholder="请输入内容"
v-model="formData.FixedCount" v-model="formData.fixedCount"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -236,8 +236,8 @@
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!--</el-col>--> <!--</el-col>-->
<el-col :span="8" class="el-col"> <el-col :span="8" class="el-col">
<el-form-item label="是否自动解码:" prop="AutoDecode" style="margin-bottom: 0"> <el-form-item label="是否自动解码:" prop="autoDecode" style="margin-bottom: 0">
<el-select v-model="formData.AutoDecode" placeholder="选择是否自动解码"> <el-select v-model="formData.autoDecode" placeholder="选择是否自动解码">
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
</el-select> </el-select>
@ -245,8 +245,8 @@
</el-col> </el-col>
<el-col :span="8" class="el-col"> <el-col :span="8" class="el-col">
<el-form-item label="输出顺序:" prop="OutputMode" > <el-form-item label="输出顺序:" prop="outputMode" >
<el-select v-model="formData.OutputMode" placeholder="选择输出顺序"> <el-select v-model="formData.outputMode" placeholder="选择输出顺序">
<el-option label="不排序" :value="0"></el-option> <el-option label="不排序" :value="0"></el-option>
<el-option label="从左到右" :value="1"></el-option> <el-option label="从左到右" :value="1"></el-option>
<el-option label="从右到左" :value="2"></el-option> <el-option label="从右到左" :value="2"></el-option>
@ -369,11 +369,11 @@ export default {
lastCodeSplit: true, lastCodeSplit: true,
isScanCodeCheck: true, isScanCodeCheck: true,
getSplitConfirm: false, getSplitConfirm: false,
FixedCount:null, fixedCount:null,
pdaMaxCount: null, pdaMaxCount: null,
ipcMaxCount: null, ipcMaxCount: null,
AutoDecode:1, autoDecode:1,
OutputMode:1 outputMode:1,
}, },
systemParam: null, systemParam: null,
socket:null, socket:null,
@ -393,7 +393,7 @@ export default {
getSet().then((response) => { getSet().then((response) => {
if (response.code == 20000) { if (response.code == 20000) {
this.formData = response.data this.formData = response.data
// this.formData.AutoDecode = 1 // this.formData.autoDecode = 1
// this.formData.OutputMode = 1 // this.formData.OutputMode = 1
} }
}) })
@ -402,7 +402,6 @@ export default {
this.ShelfDisplayFlag = true this.ShelfDisplayFlag = true
}, },
save() { save() {
if (isBlank(this.formData.scanMaxCount)){ if (isBlank(this.formData.scanMaxCount)){
this.formData.scanMaxCount = 0 this.formData.scanMaxCount = 0
} }
@ -412,6 +411,15 @@ export default {
if (isBlank(this.formData.ipcMaxCount)){ if (isBlank(this.formData.ipcMaxCount)){
this.formData.ipcMaxCount = 0 this.formData.ipcMaxCount = 0
} }
if (isBlank(this.formData.autoDecode)){
this.formData.autoDecode = 1
}
if (isBlank(this.formData.fixedCount)){
this.formData.fixedCount = 0
}
if (isBlank(this.formData.outputMode)){
this.formData.outputMode = 1
}
updateSet(this.formData) updateSet(this.formData)
.then((response) => { .then((response) => {
if (response.code != 20000) { if (response.code != 20000) {
@ -421,17 +429,40 @@ export default {
}) })
.catch(() => { .catch(() => {
}); });
if (this.socket && this.socket.readyState === WebSocket.OPEN){
if (!isBlank(this.formData.AutoDecode)){ if (this.socket && this.socket.readyState === WebSocket.OPEN) {
var setStr = "AutoDecode=" + this.formData.AutoDecode const { autoDecode, fixedCount, outputMode } = this.formData;
this.sendData(setStr)
} const settings = [
if (!isBlank(this.formData.FixedCount)){ { key: "AutoDecode", value: autoDecode },
var setStr = "FixedCount=" + this.formData.FixedCount { key: "FixedCount", value: fixedCount },
this.sendData(setStr) { key: "OutputMode", value: outputMode }
} ];
settings.forEach(setting => {
if (!isBlank(setting.value)) {
const setStr = `${setting.key}=${setting.value}`;
this.sendData(setStr);
}
});
} }
// if (this.socket && this.socket.readyState === WebSocket.OPEN){
// if (!isBlank(this.formData.autoDecode)){
// var setStr = "AutoDecode=" + this.formData.autoDecode
// this.sendData(setStr)
// }
// if (!isBlank(this.formData.fixedCount)){
// var setStr = "FixedCount=" + this.formData.fixedCount
// this.sendData(setStr)
// }
//
// if (!isBlank(this.formData.outputMode) ){
// var setStr = "OutputMode=" + this.formData.outputMode
// this.sendData(setStr)
// }
//
// }
}, },
// WebSocket // WebSocket
connectWebSocket() { connectWebSocket() {

Loading…
Cancel
Save