|
@@ -193,9 +193,8 @@
|
|
|
<div>代煎:</div>
|
|
<div>代煎:</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="right">
|
|
<div class="right">
|
|
|
- <el-select size="mini" v-model="form.daijian" placeholder="请选择">
|
|
|
|
|
- <el-option label="显示" value="0"></el-option>
|
|
|
|
|
- <el-option label="不显示" value="1"></el-option>
|
|
|
|
|
|
|
+ <el-select size="mini" v-model="form.daijian" placeholder="请选择" multiple clearable>
|
|
|
|
|
+ <el-option v-for="item in optionsAgency" :key="item.value" v-bind="item" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -205,9 +204,8 @@
|
|
|
<div>默认代煎:</div>
|
|
<div>默认代煎:</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="right">
|
|
<div class="right">
|
|
|
- <el-select size="mini" v-model="form.ddaijian" placeholder="请选择">
|
|
|
|
|
- <el-option label="是" value="0"></el-option>
|
|
|
|
|
- <el-option label="否" value="1"></el-option>
|
|
|
|
|
|
|
+ <el-select size="mini" v-model="form.ddaijian" placeholder="请选择" clearable>
|
|
|
|
|
+ <el-option v-for="item in optionsAgency" :key="item.value" v-bind="item" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -226,9 +224,8 @@
|
|
|
<div>配送:</div>
|
|
<div>配送:</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="right">
|
|
<div class="right">
|
|
|
- <el-select size="mini" v-model="form.peisong" placeholder="请选择">
|
|
|
|
|
- <el-option label="显示" value="0"></el-option>
|
|
|
|
|
- <el-option label="不显示" value="1"></el-option>
|
|
|
|
|
|
|
+ <el-select size="mini" v-model="form.peisong" placeholder="请选择" multiple clearable>
|
|
|
|
|
+ <el-option v-for="item in optionsDelivery" :key="item.value" v-bind="item" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -238,9 +235,8 @@
|
|
|
<div>默认配送:</div>
|
|
<div>默认配送:</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="right">
|
|
<div class="right">
|
|
|
- <el-select size="mini" v-model="form.dpeisong" placeholder="请选择">
|
|
|
|
|
- <el-option label="是" value="0"></el-option>
|
|
|
|
|
- <el-option label="否" value="1"></el-option>
|
|
|
|
|
|
|
+ <el-select size="mini" v-model="form.dpeisong" placeholder="请选择" clearable>
|
|
|
|
|
+ <el-option v-for="item in optionsDelivery" :key="item.value" v-bind="item" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -305,6 +301,8 @@ import {
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ optionsAgency: [],
|
|
|
|
|
+ optionsDelivery: [],
|
|
|
form: {
|
|
form: {
|
|
|
area: "",
|
|
area: "",
|
|
|
medName: "", // 医疗结构
|
|
medName: "", // 医疗结构
|
|
@@ -437,11 +435,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (this.type == "add") {
|
|
|
|
|
- this.addPharmacyData();
|
|
|
|
|
- } else if (this.type == "edit") {
|
|
|
|
|
- this.editPharmacMsg();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.setPharmacyMsg();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 获取医共体选择器
|
|
// 获取医共体选择器
|
|
@@ -526,72 +520,13 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- //提交数据
|
|
|
|
|
- async addPharmacyData() {
|
|
|
|
|
- let ksIds = JSON.stringify(this.form.departName);
|
|
|
|
|
- let departmentidSelsource = [];
|
|
|
|
|
- let list = this.form.departName;
|
|
|
|
|
-
|
|
|
|
|
- let departIds = [];
|
|
|
|
|
- list.forEach(item => {
|
|
|
|
|
- departIds = [...departIds, ...item];
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- departmentidSelsource = this.removalID(departIds);
|
|
|
|
|
-
|
|
|
|
|
- let params = {
|
|
|
|
|
- agencyPrice: this.form.daijianPrice,
|
|
|
|
|
- areaCode: this.form.addressCode,
|
|
|
|
|
- defaultAgency: this.form.ddaijian,
|
|
|
|
|
- defaultDelivery: this.form.dpeisong,
|
|
|
|
|
- defaultSpecialDeployment: this.form.dtiaopei,
|
|
|
|
|
- defaultSystemOfCream: this.form.dzhigao,
|
|
|
|
|
- deliveryPrice: this.form.peisongPrice,
|
|
|
|
|
- departmentidSelsource: departmentidSelsource.join(","),
|
|
|
|
|
- ksIds,
|
|
|
|
|
- displayAgency: this.form.daijian,
|
|
|
|
|
- displayDelivery: this.form.peisong,
|
|
|
|
|
- displayName: this.form.showName,
|
|
|
|
|
- displaySpecialDeployment: this.form.tiaopei,
|
|
|
|
|
- displaySystemOfCream: this.form.zhigao,
|
|
|
|
|
- dosageForms: this.form.doseType.join(","),
|
|
|
|
|
- pharmacyId: this.form.id,
|
|
|
|
|
- pharmacyName: this.form.name,
|
|
|
|
|
- pharmacyProperties: this.form.attribute,
|
|
|
|
|
- seqn: this.form.sqen,
|
|
|
|
|
- specialDeploymentPrice: this.form.tiaopeiPrice,
|
|
|
|
|
- // stitutionsId: this.getuserinfo.sititutionid,
|
|
|
|
|
- systemOfCreamPrice: this.form.zhigaoPrice,
|
|
|
|
|
- usableRange: this.form.area,
|
|
|
|
|
- stitutionsId: this.form.medName
|
|
|
|
|
- };
|
|
|
|
|
- const loading = this.$loading({
|
|
|
|
|
- lock: true,
|
|
|
|
|
- text: "Loading",
|
|
|
|
|
- spinner: "el-icon-loading",
|
|
|
|
|
- background: "rgba(0, 0, 0, 0.7)"
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- let res = await addPharmacyData(params).catch(err => {
|
|
|
|
|
- loading.close();
|
|
|
|
|
- });
|
|
|
|
|
- if (res.ResultCode == 0) {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: "提交成功",
|
|
|
|
|
- showClose: true,
|
|
|
|
|
- type: "success"
|
|
|
|
|
- });
|
|
|
|
|
- loading.close();
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.$router.back();
|
|
|
|
|
- }, 2000);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
// 获取详细数据
|
|
// 获取详细数据
|
|
|
async getPharmacyMsg() {
|
|
async getPharmacyMsg() {
|
|
|
let res = await getPharmacyMsg(this.pid);
|
|
let res = await getPharmacyMsg(this.pid);
|
|
|
if (res.ResultCode == 0) {
|
|
if (res.ResultCode == 0) {
|
|
|
let data = res.Data;
|
|
let data = res.Data;
|
|
|
|
|
+ this.optionsAgency = data.optionsAgency;
|
|
|
|
|
+ this.optionsDelivery = data.optionsDelivery;
|
|
|
this.form = {
|
|
this.form = {
|
|
|
area: data.usableRange,
|
|
area: data.usableRange,
|
|
|
sqen: data.seqn,
|
|
sqen: data.seqn,
|
|
@@ -623,8 +558,8 @@ export default {
|
|
|
this.getDepartList(this.form.medName, data.ksIds ? "auto" : "1");
|
|
this.getDepartList(this.form.medName, data.ksIds ? "auto" : "1");
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // 修改数据
|
|
|
|
|
- async editPharmacMsg() {
|
|
|
|
|
|
|
+ // 设置详细数据
|
|
|
|
|
+ async setPharmacyMsg() {
|
|
|
let ksIds = JSON.stringify(this.form.departName);
|
|
let ksIds = JSON.stringify(this.form.departName);
|
|
|
let departmentidSelsource = [];
|
|
let departmentidSelsource = [];
|
|
|
let list = this.form.departName;
|
|
let list = this.form.departName;
|
|
@@ -635,6 +570,21 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
departmentidSelsource = this.removalID(departIds);
|
|
departmentidSelsource = this.removalID(departIds);
|
|
|
|
|
+
|
|
|
|
|
+ let displayAgency = '';
|
|
|
|
|
+ let displayDelivery = '';
|
|
|
|
|
+ if (Array.isArray(this.form.daijian)) {
|
|
|
|
|
+ displayAgency = this.form.daijian.map(value => {
|
|
|
|
|
+ const option = this.optionsAgency.find(option => option.value === value);
|
|
|
|
|
+ return option ? `${option.label}:${option.value}` : void 0;
|
|
|
|
|
+ }).filter(Boolean).join(',');
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Array.isArray(this.form.peisong)) {
|
|
|
|
|
+ displayDelivery = this.form.peisong.map(value => {
|
|
|
|
|
+ const option = this.optionsDelivery.find(option => option.value === value);
|
|
|
|
|
+ return option ? `${option.label}:${option.value}` : void 0;
|
|
|
|
|
+ }).filter(Boolean).join(',');
|
|
|
|
|
+ }
|
|
|
let params = {
|
|
let params = {
|
|
|
agencyPrice: this.form.daijianPrice,
|
|
agencyPrice: this.form.daijianPrice,
|
|
|
areaCode: this.form.addressCode,
|
|
areaCode: this.form.addressCode,
|
|
@@ -645,8 +595,8 @@ export default {
|
|
|
deliveryPrice: this.form.peisongPrice,
|
|
deliveryPrice: this.form.peisongPrice,
|
|
|
departmentidSelsource: departmentidSelsource.join(","),
|
|
departmentidSelsource: departmentidSelsource.join(","),
|
|
|
ksIds,
|
|
ksIds,
|
|
|
- displayAgency: this.form.daijian,
|
|
|
|
|
- displayDelivery: this.form.peisong,
|
|
|
|
|
|
|
+ displayAgency,
|
|
|
|
|
+ displayDelivery,
|
|
|
displayName: this.form.showName,
|
|
displayName: this.form.showName,
|
|
|
displaySpecialDeployment: this.form.tiaopei,
|
|
displaySpecialDeployment: this.form.tiaopei,
|
|
|
displaySystemOfCream: this.form.zhigao,
|
|
displaySystemOfCream: this.form.zhigao,
|
|
@@ -668,20 +618,25 @@ export default {
|
|
|
spinner: "el-icon-loading",
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- let res = await editPharmacMsg(params).catch(err => {
|
|
|
|
|
- loading.close();
|
|
|
|
|
- });
|
|
|
|
|
- if (res.ResultCode == 0) {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: "提交成功",
|
|
|
|
|
- showClose: true,
|
|
|
|
|
- type: "success"
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ let request = Promise.reject();
|
|
|
|
|
+ if (this.type === 'edit') {
|
|
|
|
|
+ params.pid = this.pid;
|
|
|
|
|
+ request = editPharmacMsg(params);
|
|
|
|
|
+ } else if (this.type === 'add') {
|
|
|
|
|
+ request = addPharmacyData(params);
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await request;
|
|
|
|
|
+ if (+res.ResultCode === 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: '提交成功',
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(() => { this.$router.back(); }, 1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ } finally {
|
|
|
loading.close();
|
|
loading.close();
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.$router.back();
|
|
|
|
|
- }, 2000);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|