测试问题修改

This commit is contained in:
zzyuan 2025-06-11 16:22:31 +08:00
parent 04d5cb11ef
commit 0f449ae06f
9 changed files with 44 additions and 18 deletions

View File

@ -175,6 +175,7 @@
accept=".png, .jpg, .jpeg" accept=".png, .jpg, .jpeg"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:class="{ disabled: uploadDisabled }" :class="{ disabled: uploadDisabled }"
:before-upload="handleBeforeUpload"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-remove="handleRemove" :on-remove="handleRemove"
> >
@ -440,6 +441,14 @@
this.$modal.msgError(error) this.$modal.msgError(error)
}) })
}, },
//
handleBeforeUpload(file) {
const isLt = file.size / 1024 / 1024 < 5
if (!isLt) {
this.$modal.msgError(`图片大小不能超过 5 MB`)
return false
}
},
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
console.log('success') console.log('success')
}, },

View File

@ -200,6 +200,7 @@
list-type="picture-card" list-type="picture-card"
accept=".png, .jpg, .jpeg" accept=".png, .jpg, .jpeg"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="handleBeforeUpload"
:class="{ disabled: uploadDisabled }" :class="{ disabled: uploadDisabled }"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-remove="handleRemove" :on-remove="handleRemove"
@ -724,6 +725,14 @@ export default {
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.warning('最多只可以上传一张图片') this.$message.warning('最多只可以上传一张图片')
}, },
//
handleBeforeUpload(file) {
const isLt = file.size / 1024 / 1024 < 5
if (!isLt) {
this.$modal.msgError(`图片大小不能超过 5 MB`)
return false
}
},
handleRemove(file, fileList) { handleRemove(file, fileList) {
let sum = 0 let sum = 0
this.checkUrlNameList.forEach((item, index) => { this.checkUrlNameList.forEach((item, index) => {

View File

@ -366,7 +366,7 @@
<el-form-item label="菜品价格" prop="price" v-if="baseForm.sizeType==1"> <el-form-item label="菜品价格" prop="price" v-if="baseForm.sizeType==1">
<el-input <el-input
v-model="baseForm.price" v-model="baseForm.price"
placeholder="请输入菜品价格" maxlength="10" placeholder="请输入菜品价格" maxlength="9"
@input="handleNumericInput('price', $event)" @input="handleNumericInput('price', $event)"
@blur="formatNumericValue('price')" @blur="formatNumericValue('price')"
> >
@ -377,7 +377,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="成本价" prop="materialCost" v-if="baseForm.sizeType==1"> <el-form-item label="成本价" prop="materialCost" v-if="baseForm.sizeType==1">
<el-input <el-input
v-model="baseForm.materialCost" maxlength="10" v-model="baseForm.materialCost" maxlength="9"
placeholder="请输入成本价" disabled placeholder="请输入成本价" disabled
@input="handleNumericInput('materialCost', $event)" @input="handleNumericInput('materialCost', $event)"
@blur="formatNumericValue('materialCost')" @blur="formatNumericValue('materialCost')"

View File

@ -182,22 +182,22 @@
</el-table-column> </el-table-column>
<el-table-column label="当餐售价" align="center" prop="price"> <el-table-column label="当餐售价" align="center" prop="price">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.price" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.price=v.replace(/[^\d.]/g,''))"/> <el-input v-model="scope.row.price" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.price=v.replace(/[^\d.]/g,''))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="当餐优惠价" align="center" prop="salePrice"> <el-table-column label="当餐优惠价" align="center" prop="salePrice">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/> <el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最大供应量" align="center" prop="supplyNum"> <el-table-column label="最大供应量" align="center" prop="supplyNum">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.supplyNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.supplyNum=v.replace(/[^\d]/g,''))"/> <el-input v-model="scope.row.supplyNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.supplyNum=v.replace(/[^\d]/g,''))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="每人限购数" align="center" prop="limitNum"> <el-table-column label="每人限购数" align="center" prop="limitNum">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.limitNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.limitNum=v.replace(/[^\d]/g,''))"/> <el-input v-model="scope.row.limitNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.limitNum=v.replace(/[^\d]/g,''))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="移动端推荐" align="center" prop="recommendFlag"> <el-table-column label="移动端推荐" align="center" prop="recommendFlag">

View File

@ -182,22 +182,22 @@
</el-table-column> </el-table-column>
<el-table-column label="当餐售价" align="center" prop="price"> <el-table-column label="当餐售价" align="center" prop="price">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.price" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.price=v.replace(/[^\d.]/g,''))"/> <el-input v-model="scope.row.price" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.price=v.replace(/[^\d.]/g,''))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="当餐优惠价" align="center" prop="salePrice"> <el-table-column label="当餐优惠价" align="center" prop="salePrice">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/> <el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最大供应量" align="center" prop="supplyNum"> <el-table-column label="最大供应量" align="center" prop="supplyNum">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.supplyNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.supplyNum=v.replace(/[^\d]/g,''))"/> <el-input v-model="scope.row.supplyNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.supplyNum=v.replace(/[^\d]/g,''))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="每人限购数" align="center" prop="limitNum"> <el-table-column label="每人限购数" align="center" prop="limitNum">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.limitNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.limitNum=v.replace(/[^\d]/g,''))"/> <el-input v-model="scope.row.limitNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.limitNum=v.replace(/[^\d]/g,''))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="移动端推荐" align="center" prop="recommendFlag"> <el-table-column label="移动端推荐" align="center" prop="recommendFlag">

View File

@ -552,7 +552,7 @@
canteenId:row.canteenId, canteenId:row.canteenId,
stallId:row.stallId, stallId:row.stallId,
} }
this.$router.push({ path: "/device/doubleScreen",query: obj }); this.$router.push({ path: "/canteen/device/canteenDevices",query: obj });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {

View File

@ -80,7 +80,7 @@
<el-form-item label="商品进价" prop="unitPrice"> <el-form-item label="商品进价" prop="unitPrice">
<el-input <el-input
v-model="form.unitPrice" v-model="form.unitPrice"
placeholder="请输入商品进价" placeholder="请输入商品进价" maxlength="8"
@input="handleNumericInput('unitPrice', $event)" @input="handleNumericInput('unitPrice', $event)"
@blur="formatNumericValue('unitPrice')" @blur="formatNumericValue('unitPrice')"
> >
@ -93,7 +93,7 @@
<el-input <el-input
v-model="form.salePrice" v-model="form.salePrice"
placeholder="请输入零售价" placeholder="请输入零售价"
maxlength="20" maxlength="8"
@input="handleNumericInput('salePrice', $event)" @input="handleNumericInput('salePrice', $event)"
@blur="formatNumericValue('salePrice')" @blur="formatNumericValue('salePrice')"
/> />

View File

@ -975,8 +975,7 @@
"areaId": "", "areaId": "",
"ifRelateDrp": 2, "ifRelateDrp": 2,
"imgUrl": "", "imgUrl": "",
} }
this.baseForm = {};
this.resetForm("baseForm"); this.resetForm("baseForm");
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
@ -1172,10 +1171,10 @@
// - // -
async handleNodeClick(data, node) { async handleNodeClick(data, node) {
console.log(data) console.log(data)
// this.handleQuery(); // this.handleShopQuery();
}, },
handleCheckChange(data, checked, indeterminate) { handleCheckChange(data, checked, indeterminate) {
this.handleQuery(); this.handleShopQuery();
}, },
/* 树节点增加 */ /* 树节点增加 */
appendTreeNode(data) { appendTreeNode(data) {
@ -1369,7 +1368,7 @@
/** 商品新增 */ /** 商品新增 */
handleShopAdd() { handleShopAdd() {
this.reset(); // this.reset();
this.openAddProduct = true; this.openAddProduct = true;
this.titleAddProduct = "新增-超市商品"; this.titleAddProduct = "新增-超市商品";
this.getAddShopList(); this.getAddShopList();

View File

@ -620,6 +620,7 @@
list-type="picture-card" list-type="picture-card"
accept=".png, .jpg, .jpeg" accept=".png, .jpg, .jpeg"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="handleBeforeUpload"
:class="{ disabled: uploadDisabled }" :class="{ disabled: uploadDisabled }"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-remove="handleRemove" :on-remove="handleRemove"
@ -1421,6 +1422,14 @@ export default {
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
console.log('success') console.log('success')
}, },
//
handleBeforeUpload(file) {
const isLt = file.size / 1024 / 1024 < 5
if (!isLt) {
this.$modal.msgError(`图片大小不能超过 5 MB`)
return false
}
},
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.warning('最多只可以上传一张图片') this.$message.warning('最多只可以上传一张图片')
}, },