This commit is contained in:
曹辉 2023-01-09 10:28:05 +08:00
parent dd5ff2ec04
commit 7c96ddade7
2 changed files with 39 additions and 30 deletions

View File

@ -214,7 +214,7 @@
@click="clickinnerVisible" @click="clickinnerVisible"
v-if="StationName == '请选择所属护理站'" v-if="StationName == '请选择所属护理站'"
style=" style="
width: 200px; width: 210px;
text-align: left; text-align: left;
height: 36px; height: 36px;
color: #c0c4cc; color: #c0c4cc;
@ -227,10 +227,9 @@
@click="clickinnerVisible" @click="clickinnerVisible"
v-else v-else
style=" style="
width: 200px; width: 210px;
text-align: left; text-align: left;
height: 36px; height: 36px;
padding-left: -10px;
overflow: hidden; overflow: hidden;
" "
>{{ StationName }}</el-button >{{ StationName }}</el-button
@ -269,11 +268,20 @@
</el-form-item> </el-form-item>
<el-form-item label="商品度量单位" prop="goodsUnit"> <el-form-item label="商品度量单位" prop="goodsUnit">
<el-input <el-input
max="8"
v-model="form.goodsUnit" v-model="form.goodsUnit"
placeholder="请输入商品度量单位" placeholder="请输入商品度量单位"
style="width: 210px" style="width: 210px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="商品顺序" prop="sort">
<el-input
max="8"
v-model.number="form.sort"
placeholder="请输入商品顺序"
style="width: 210px"
/>
</el-form-item>
<el-form-item label="商品图片" prop="goodsPictureUrl"> <el-form-item label="商品图片" prop="goodsPictureUrl">
<stationAcatar <stationAcatar
@imgUrl="imgUrl" @imgUrl="imgUrl"
@ -298,7 +306,6 @@
<el-table-column label="商品单价" align="center"> <el-table-column label="商品单价" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.goodsPrice" v-model="scope.row.goodsPrice"
type="number" type="number"
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>7){value=value.slice(0,7)}" oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>7){value=value.slice(0,7)}"
@ -316,7 +323,7 @@
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="显示顺序" align="center"> <el-table-column label="商品属性顺序" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.attributeDetailsSort" v-model="scope.row.attributeDetailsSort"
@ -356,7 +363,7 @@
style="margin-top: 20px" style="margin-top: 20px"
> >
<editor <editor
@imgs="imgs" @imgs="imgs"
:min-height="100" :min-height="100"
style="width: 90%; margin: 0 auto" style="width: 90%; margin: 0 auto"
v-model="form.goodsRemark" v-model="form.goodsRemark"

View File

@ -20,7 +20,6 @@ export default {
return { return {
imgsurl: { pictureUrlList: [] }, imgsurl: { pictureUrlList: [] },
imgone: "", imgone: "",
imageUrl: "", //商品图片 imageUrl: "", //商品图片
value: "", value: "",
datas: null, datas: null,
@ -124,7 +123,11 @@ export default {
{ required: true, message: "请输入商品度量单位", trigger: "blur" }, { required: true, message: "请输入商品度量单位", trigger: "blur" },
], ],
goodsPictureUrl: [ goodsPictureUrl: [
{ required: true, message: "请输入选择图片", trigger: "blur" }, { required: true, message: "请选择图片", trigger: "blur" },
],
sort: [
{ required: true, message: "请输入商品顺序", trigger: "blur" },
], ],
}, },
homestation: null, homestation: null,
@ -138,7 +141,7 @@ export default {
imgs(item) { imgs(item) {
this.imgsurl.pictureUrlList.push(item); this.imgsurl.pictureUrlList.push(item);
// console.log(this.imgsurl) // console.log(this.imgsurl)
}, },
upwhetherShelf(row) { upwhetherShelf(row) {
console.log(row); console.log(row);
if (row.whetherShelf == false) { if (row.whetherShelf == false) {
@ -180,20 +183,19 @@ export default {
}, },
// 添加 // 添加
addgoodAttributeDetail() { addgoodAttributeDetail() {
console.log(this.goodDetailsLists); // if (this.goodDetailsLists.length == 5) {
if (this.goodDetailsLists.length == 5) { // this.$message.error("最多只能5条");
this.$message.error("最多只能5条"); // } else {
} else { this.ids++;
this.ids++; var obj = {
var obj = { attributePitureUrl: "",
attributePitureUrl: "", goodsPrice: "",
goodsPrice: "", goodsStock: "",
goodsStock: "", sort: "",
sort: "", ids: this.ids,
ids: this.ids, };
}; this.goodDetailsLists.push(obj);
this.goodDetailsLists.push(obj); // }
}
}, },
// 删除 // 删除
delgoodAttributeDetail(item) { delgoodAttributeDetail(item) {
@ -231,8 +233,8 @@ export default {
} }
if (this.imgsurl.pictureUrlList.length > 0) { if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {}); updatePicture(this.imgsurl).then((res) => {});
} }
this.imgsurl={pictureUrlList:[]}; this.imgsurl = { pictureUrlList: [] };
this.open = false; this.open = false;
this.reset(); this.reset();
this.StationName = "请选择所属护理站"; this.StationName = "请选择所属护理站";
@ -393,7 +395,7 @@ export default {
if (this.imgone != this.form.goodsPictureUrl) { if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.imgone); obj.pictureUrlList.push(this.imgone);
} }
this.imgsurl={pictureUrlList:[]}; this.imgsurl = { pictureUrlList: [] };
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => { updatePicture(obj).then((res) => {
console.log(res); console.log(res);
@ -406,9 +408,9 @@ export default {
}); });
} else { } else {
this.form.goodDetailsLists.forEach(e => { this.form.goodDetailsLists.forEach(e => {
e.goodsPrice = Number(e.goodsPrice) e.goodsPrice = Number(e.goodsPrice)
}) })
// this.nurseStationId=this.form.nurseStationId // this.nurseStationId=this.form.nurseStationId
addGoodsInfo(this.form).then((response) => { addGoodsInfo(this.form).then((response) => {
console.log(this.form); console.log(this.form);
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");