信用积分多店铺改造

This commit is contained in:
aixianling
2022-04-13 18:27:25 +08:00
parent 5e5d0b4308
commit fac5ed82bb

View File

@@ -53,13 +53,12 @@
</template>
</ai-list>
<ai-dialog
:title="dialog.title"
:title="dialog.title||'添加店铺'"
:visible.sync="dialog.visible"
:customFooter="true"
:destroyOnClose="true"
@close="init('ruleForm')"
width="520px"
>
@close="dialogInfo={}"
width="520px">
<div class="form_div">
<el-form
ref="ruleForm"
@@ -88,12 +87,18 @@
maxlength="11"
></el-input>
</el-form-item>
<el-form-item label="所在地区" prop="areaId">
<ai-area-get v-model="dialogInfo.areaId" :instance="instance" :root="rootArea"/>
</el-form-item>
<el-form-item label="店铺地址" prop="shopAddress">
<el-input
placeholder="请输入…"
v-model="dialogInfo.shopAddress"
></el-input>
</el-form-item>
<el-form-item label="店铺照片" prop="shopPhoto">
<ai-uploader :instance="instance" :limit="1" @change="handleShopPhoto"/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="dialogInfo.status">
<el-radio label="1">启用</el-radio>
@@ -103,14 +108,8 @@
</el-form>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog.visible = false" size="medium"
>取消
</el-button
>
<el-button @click="onConfirm('ruleForm')" type="primary" size="medium"
>确认
</el-button
>
<el-button @click="dialog.visible = false">取消</el-button>
<el-button @click="onConfirm" type="primary">确认</el-button>
</div>
</ai-dialog>
<ai-dialog :visible.sync="authDialog" title="授权" @onConfirm="handleAuth" @closed="form={}" width="500px">
@@ -214,6 +213,7 @@ export default {
operators: [
{required: true, message: "请选择操作员", trigger: "blur"},
],
shopPhoto: [{required: true, message: "请上传店铺图片"}]
},
peopleAjaxUrl: "/admin/user/page",
authDialog: false,
@@ -224,11 +224,13 @@ export default {
computed: {
...mapState(["user"]),
rootArea() {
return this.user.info.areaId?.replace(/(\d{6}).+/, '$1' + Array(7).join("0"))
}
},
created() {
this.unitId = this.user.info.unitId;
this.$dict.load("assessmentStartStatus").then(() => {
this.getList();
});
@@ -307,7 +309,7 @@ export default {
this.getList();
},
onConfirm(formName) {
onConfirm() {
if (this.dialogInfo.operators.length) {
this.dialogInfo.operators.map((item) => {
if (!item.name) {
@@ -315,16 +317,14 @@ export default {
}
});
}
this.$refs[formName].validate((valid) => {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.instance
.post(`/app/appvillagerintegralshop/addOrUpdate`, this.dialogInfo)
.then((res) => {
if (res.code == 0) {
this.instance.post(`/app/appvillagerintegralshop/addOrUpdate`, this.dialogInfo).then(res => {
if (res?.code == 0) {
this.onReset();
this.onCancel();
}
});
})
} else {
return false;
}
@@ -335,32 +335,16 @@ export default {
this.dialog.visible = false;
this.dialog.visibleStatus = false;
},
init(formName) {
this.$refs[formName].clearValidate();
Object.keys(this.dialogInfo).forEach((e) => {
this.dialogInfo[e] = "";
});
this.dialogInfo.status = "1";
this.dialogInfo.operators = [];
},
delate(index) {
this.dialogInfo.operators.splice(index, 1);
},
onAdd() {
Object.keys(this.dialogInfo).forEach((e) => {
this.dialogInfo[e] = "";
});
this.dialogInfo.status = "1";
this.dialogInfo.operators = [];
this.dialog.visible = true;
this.dialogInfo.areaId = this.areaId;
},
handleShopPhoto(v) {
this.dialogInfo.shopPhoto = v?.[0]?.url || ""
}
},
};
}
</script>
<style lang="scss">