Browse Source

table组件数字输入项修改

dev_web_online
陈薪名 2 years ago
parent
commit
9ac4bb2c5a
  1. 27
      fe/PC/src/components/currenTable/index.vue
  2. 7
      fe/PC/src/views/inventoryManage/InventoryQuery/InventoryTransferLog-Query.vue

27
fe/PC/src/components/currenTable/index.vue

@ -59,18 +59,17 @@
:rules="item.rules" :rules="item.rules"
> >
<el-input <el-input
v-model="searchData[item.prop]" v-model="scope.row[item.prop]"
:maxlength="item.maxlength" :maxlength="item.maxlength"
:onkeyup="typeNumberOnkeyup(item,searchData[item.prop])" :onkeyup="typeNumberOnkeyup(item,item.prop,scope.$index)"
clearable clearable
:disabled="Boolean(item.disabled)" :disabled="Boolean(item.disabled)"
:placeholder="'请输入' + item.label" :placeholder="'请输入' + item.label"
:prefix-icon="item.icon" :prefix-icon="item.icon"
:show-password="item.showPassword" :show-password="item.showPassword"
@change="changeInput(item.prop,$event)"
@clear="clearInput(item.prop,$event)" @clear="clearInput(item.prop,$event)"
@blur=" @blur="
inputPlaceholder($event, item, 'blur',searchData) inputPlaceholder($event, item, 'blur',scope.row)
" "
@focus="inputPlaceholder($event, item, 'focus')" @focus="inputPlaceholder($event, item, 'focus')"
></el-input> ></el-input>
@ -446,16 +445,16 @@ export default {
} }
}, },
// inputonkeyup // inputonkeyup
typeNumberOnkeyup(item,value){ typeNumberOnkeyup(item,value,index){
if(value){ if(this.tableData[index][value]){
let _match = String(value).match(/\d+/)// let _match = String(this.tableData[index][value]).match(/\d+/)//
this.searchData[item.prop] = _match?_match[0]:_match this.tableData[index][value] = _match?_match[0]:_match
} }
if(this.searchData[item.prop] > item.max){ if(this.tableData[index][value] > item.max){
this.searchData[item.prop] = item.max this.tableData[index][value] = item.max
} }
if(this.searchData[item.prop] && this.searchData[item.prop] < item.min){ if(this.tableData[index][value] && this.tableData[index][value] < item.min){
this.searchData[item.prop] = item.min this.tableData[index][value] = item.min
} }
if(item.onkeyup)item.onkeyup() if(item.onkeyup)item.onkeyup()
}, },
@ -509,8 +508,8 @@ export default {
func[item.prop]= Number(val.target.value) func[item.prop]= Number(val.target.value)
} }
// item.valueType // item.valueType
// ? (this.searchData[item.prop] = item.valueType( // ? (this.tableData[index][value] = item.valueType(
// this.searchData[item.prop] // this.tableData[index][value]
// )) // ))
// : () => { // : () => {
// return; // return;

7
fe/PC/src/views/inventoryManage/InventoryQuery/InventoryTransferLog-Query.vue

@ -192,7 +192,9 @@ export default {
{label: "批次", prop: "lot", width:'110px'}, {label: "批次", prop: "lot", width:'110px'},
{type: "filter", filters: "inventoryStage", label: "状态", prop: "status", width:'80px'}, {type: "filter", filters: "inventoryStage", label: "状态", prop: "status", width:'80px'},
{label: "单位", prop: "uom", width:'80px'}, {label: "单位", prop: "uom", width:'80px'},
{type: "input", label: "数量", prop: "qty", validType:'number' }, // {type: "input", label: "", prop: "qty", validType:'number' },
{type: "inputNumber", label: "数量", prop: "qty" },
], ],
editRules: { editRules: {
cerateRule: { cerateRule: {
@ -371,6 +373,9 @@ export default {
item.fromStatus = item.status item.fromStatus = item.status
item.toStatus = item.status item.toStatus = item.status
item.checked = true item.checked = true
// 20230410
item.toLocationErpCode = item.locationErpCode
item.fromLocationErpCode = item.locationErpCode
}) })
let params = { let params = {
worker: store.getters.name.userName, worker: store.getters.name.userName,

Loading…
Cancel
Save