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

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

@ -192,7 +192,9 @@ export default {
{label: "批次", prop: "lot", width:'110px'},
{type: "filter", filters: "inventoryStage", label: "状态", prop: "status", 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: {
cerateRule: {
@ -371,6 +373,9 @@ export default {
item.fromStatus = item.status
item.toStatus = item.status
item.checked = true
// 20230410
item.toLocationErpCode = item.locationErpCode
item.fromLocationErpCode = item.locationErpCode
})
let params = {
worker: store.getters.name.userName,

Loading…
Cancel
Save