This commit is contained in:
闫晓茹 2022-12-02 15:30:10 +08:00
parent 7b2bca2a5c
commit b9f3f4fe08
6 changed files with 89 additions and 55 deletions

View File

@ -56,13 +56,13 @@ export default {
type: {
type: String,
default: "url",
}
},
},
data() {
return {
uploadUrl: process.env.VUE_APP_BASE_API + "/common/richTextPictureUrl", //
headers: {
Authorization: "Bearer " + getToken()
Authorization: "Bearer " + getToken(),
},
Quill: null,
currentValue: "",
@ -73,16 +73,16 @@ export default {
modules: {
//
toolbar: [
["bold", "italic", "underline", "strike"], // 线 线
["blockquote", "code-block"], //
[{ list: "ordered" }, { list: "bullet" }], //
[{ indent: "-1" }, { indent: "+1" }], //
[{ size: ["small", false, "large", "huge"] }], //
[{ header: [1, 2, 3, 4, 5, 6, false] }], //
[{ color: [] }, { background: [] }], //
[{ align: [] }], //
["clean"], //
["link", "image", "video"] //
["bold", "italic", "underline", "strike"], // 线 线
["blockquote", "code-block"], //
[{ list: "ordered" }, { list: "bullet" }], //
[{ indent: "-1" }, { indent: "+1" }], //
[{ size: ["small", false, "large", "huge"] }], //
[{ header: [1, 2, 3, 4, 5, 6, false] }], //
[{ color: [] }, { background: [] }], //
[{ align: [] }], //
["clean"], //
["link", "image", "video"], //
],
},
placeholder: "请输入内容",
@ -126,7 +126,7 @@ export default {
const editor = this.$refs.editor;
this.Quill = new Quill(editor, this.options);
//
if (this.type == 'url') {
if (this.type == "url") {
let toolbar = this.Quill.getModule("toolbar");
toolbar.addHandler("image", (value) => {
this.uploadType = "image";
@ -176,7 +176,14 @@ export default {
//
let length = quill.getSelection().index;
// res.url
quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
quill.insertEmbed(
length,
"image",
process.env.VUE_APP_BASE_API + res.fileName
);
this.$emit("imgs", res.fileName);
//
quill.setSelection(length + 1);
} else {
@ -191,7 +198,8 @@ export default {
</script>
<style>
.editor, .ql-toolbar {
.editor,
.ql-toolbar {
white-space: pre-wrap !important;
line-height: normal !important;
}

View File

@ -366,6 +366,7 @@
style="margin-top: 20px"
>
<editor
@imgs="imgs"
:min-height="100"
style="width: 90%; margin: 0 auto"
v-model="form.goodsRemark"
@ -506,8 +507,8 @@ export default {
name: "OperateGoodsInfo",
data() {
return {
imgsurl: { pictureUrlList: [] },
imgone: "",
imageUrl: "", //
value: "",
datas: null,
@ -627,6 +628,9 @@ export default {
this.infos();
},
methods: {
imgs(item) {
this.imgsurl.pictureUrlList.push(item);
},
upwhetherShelf(row) {
console.log(row);
if (row.whetherShelf == false) {
@ -718,6 +722,10 @@ export default {
console.log(res);
});
}
if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {});
}
this.imgsurl = { pictureUrlList: [] };
this.open = false;
this.reset();
this.StationName = "请选择所属护理站";

View File

@ -18,6 +18,7 @@ export default {
name: "OperateGoodsInfo",
data() {
return {
imgsurl: { pictureUrlList: [] },
imgone: "",
imageUrl: "", //商品图片
value: "",
@ -53,22 +54,22 @@ export default {
nursetotal: 0,
nurseStationId: null,
goods: [{
value: "BUSINESS",
label: "买卖",
},
{
value: "LEASE",
label: "租赁",
},
value: "BUSINESS",
label: "买卖",
},
{
value: "LEASE",
label: "租赁",
},
],
options: [{
value: 0,
label: "否",
},
{
value: 1,
label: "是",
},
value: 0,
label: "否",
},
{
value: 1,
label: "是",
},
],
// goodAttributeDetailsLists:[],
goodDetailsLists: [],
@ -138,6 +139,9 @@ export default {
this.infos();
},
methods: {
imgs(item) {
this.imgsurl.pictureUrlList.push(item);
},
upwhetherShelf(row) {
console.log(row);
if (row.whetherShelf == false) {
@ -229,6 +233,10 @@ export default {
console.log(res);
});
}
if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => { });
}
this.imgsurl = { pictureUrlList: [] };
this.open = false;
this.reset();
this.StationName = "请选择所属护理站";
@ -239,8 +247,8 @@ export default {
goodsPrice: "",
goodsStock: "",
sort: "",
}, ],
}, ];
},],
},];
},
handleQuery2() {
@ -259,7 +267,7 @@ export default {
pageNum: 1,
pageSize: 10,
}),
this.handleQuery2();
this.handleQuery2();
},
addcancel() {
this.resetQuery2();
@ -292,7 +300,7 @@ export default {
goodsStock: "",
sort: "",
ids: 9999999,
}, ];
},];
this.resetForm("form");
},
/** 搜索按钮操作 */
@ -335,7 +343,7 @@ export default {
goodsStock: "",
sort: "",
ids: 9999999,
}, ];
},];
this.open = true;
},
/** 修改按钮操作 */
@ -366,9 +374,9 @@ export default {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.goodsInfoId != null) {
this.form.goodDetailsLists.forEach((e) => {
this.form.goodDetailsLists.forEach((e) => {
e.goodsPrice = Number(e.goodsPrice);
});
});
this.form.id = this.form.goodsInfoId;
updateGoodsInfo(this.form).then((response) => {
var obj = { pictureUrlList: [] };
@ -387,7 +395,7 @@ export default {
} else {
this.form.goodDetailsLists.forEach((e) => {
e.goodsPrice = Number(e.goodsPrice);
});
});
addGoodsInfo(this.form).then((response) => {
console.log(this.form);
this.$modal.msgSuccess("新增成功");
@ -404,10 +412,10 @@ export default {
handleDelete(row) {
console.log("row :>> ", row);
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.goodsPictureUrl);
@ -421,7 +429,7 @@ export default {
// console.log('this.OrderDetailsList :>> ', this.OrderDetailsList);
});
})
.catch(() => {});
.catch(() => { });
},
// handleDelete(row) {
// const ids = row.id || this.ids;

View File

@ -349,6 +349,7 @@
style="margin-top: 20px"
>
<editor
@imgs="imgs"
:min-height="100"
style="width: 90%; margin: 0 auto"
v-model="form.goodsRemark"

View File

@ -303,6 +303,7 @@
</el-form-item>
<el-form-item label="护理站简介" prop="agencyIntroduce">
<editor
@imgs="imgs"
:min-height="62"
style="width: 90%; margin: 0 auto"
v-model="form.agencyIntroduce"
@ -468,6 +469,7 @@ export default {
}
};
return {
imgsurl: { pictureUrlList: [] },
imageUrl: "",
imageUrl2: "",
imgtwo: "",
@ -604,6 +606,9 @@ export default {
this.infos();
},
methods: {
imgs(item) {
this.imgsurl.pictureUrlList.push(item);
},
imgUrl(imgUrl) {
this.form.stationPictureUrl = imgUrl;
},
@ -693,6 +698,11 @@ export default {
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {});
}
this.imgsurl = { pictureUrlList: [] };
this.open = false;
this.reset();
},
@ -898,8 +908,6 @@ export default {
info() {
//
getListByUser(this.getListByUserquery).then((res) => {
//
// /
this.nurseStationlist = res.rows;
this.total2 = res.total;
this.loading = false;

View File

@ -285,20 +285,13 @@
prop="nurseStationItem.nurseItemContent"
>
<editor
@imgs="imgs"
:min-height="82"
style="width: 90%"
maxlength="300"
v-model="form.nurseStationItem.nurseItemContent"
></editor>
<!-- <el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
placeholder="请输入内容"
style="width: 208px"
v-model="form.nurseStationItem.nurseItemContent"
> -->
<!-- </el-input> -->
</el-form-item>
<el-form-item label="项目时长和价格" required>
<el-table
@ -692,6 +685,7 @@ export default {
name: "NurseItem",
data() {
return {
imgsurl: { pictureUrlList: [] },
imageUrl: "",
imgone: "",
handstationlist: [],
@ -809,6 +803,10 @@ export default {
// this.getList();
},
methods: {
imgs(item) {
console.log(item)
this.imgsurl.pictureUrlList.push(item);
},
imgUrl(imgUrl) {
this.form.nurseStationItem.itemPictureUrl = imgUrl;
},
@ -950,7 +948,10 @@ export default {
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {});
}
this.imgsurl = { pictureUrlList: [] };
this.open = false;
this.reset();
},