BUG 28443

This commit is contained in:
aixianling
2022-03-22 20:57:09 +08:00
parent af7e1c72a4
commit 26177d03d4
2 changed files with 123 additions and 188 deletions

View File

@@ -5,7 +5,6 @@
<ai-search-bar bottomBorder>
<template slot="left">
<el-button
:disabled="!isLevel5"
type="primary"
icon="iconfont iconAdd"
@click="onAdd">
@@ -40,7 +39,6 @@
@click="editItem(row)">
编辑
</el-button>
<ai-wechat-selecter :instance="instance" v-model="dialogInfo.operators" @change="getSelect">
<el-button
type="text"
@click="statusChage(row)"
@@ -48,7 +46,6 @@
v-if="$permissions('app_appvillagerintegralshop_edit')">
授权
</el-button>
</ai-wechat-selecter>
</div>
</template>
</el-table-column>
@@ -107,95 +104,28 @@
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog.visible = false" size="medium"
>取消</el-button
>取消
</el-button
>
<el-button @click="onConfirm('ruleForm')" type="primary" size="medium"
>确认</el-button
>确认
</el-button
>
</div>
</ai-dialog>
<ai-dialog
title="操作人授权"
:visible.sync="dialog.visibleStatus"
:customFooter="true"
:destroyOnClose="true"
@close="init('ruleStatus')"
width="720px"
>
<div class="form_div">
<el-form
ref="ruleStatus"
:model="dialogInfo"
:rules="formRules"
size="small"
label-suffix=""
label-width="100px"
>
<el-form-item label="事件区域" prop="areaId">
<ai-area-select
clearable
always-show
:instance="instance"
v-model="dialogInfo.areaId"
:hide-level="2"
:disabled-level="user.info.areaList.length"
/>
</el-form-item>
<el-form-item label="操作员" required>
<el-col :span="14" style="width: 60%; margin-right: 8px">
<el-form-item prop="operators">
<div class="organ">
<span v-if="dialogInfo.operators.length">
<span
v-for="(item, i) in dialogInfo.operators"
:key="i"
class="organzation"
>{{ item.userName }}
<span
class="iconfont iconOverrule"
@click.stop="delate(i)"
></span>
</span>
</span>
<span v-else style="color: #999">请选择</span>
</div>
</el-form-item>
</el-col>
<el-col :span="7" style="width: 30%">
<ai-person-select
:instance="instance"
:url="peopleAjaxUrl"
:isMultiple="true"
v-if="$permissions('app_appvillagerintegralshopoperator_edit')"
@selectPerson="getSelect"
:chooseUserList="dialogInfo.operators"
>
<template name="option" v-slot:option="{ item }">
<span class="iconfont iconProlife">{{ item.userName }}</span>
</template>
</ai-person-select>
</el-col>
</el-form-item>
</el-form>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog.visibleStatus = false" size="medium"
>取消</el-button
>
<el-button @click="onConfirm('ruleStatus')" type="primary" size="medium"
>确认</el-button
>
</div>
<ai-dialog :visible.sync="authDialog" title="授权" @onConfirm="handleAuth" @closed="form={}" width="500px">
<ai-user-picker :instance="instance" v-model="form.operators" multiple/>
</ai-dialog>
</section>
</template>
<script>
import {mapState} from "vuex";
import AiUserPicker from "../../../components/AiUserPicker";
export default {
name: "storeManagement",
components: {AiUserPicker},
props: {
instance: Function,
dict: Object,
@@ -285,7 +215,8 @@ export default {
],
},
peopleAjaxUrl: "/admin/user/page",
isLevel5: false,
authDialog: false,
form: {}
};
},
@@ -293,17 +224,16 @@ export default {
...mapState(["user"]),
},
mounted() {
created() {
this.unitId = this.user.info.unitId;
this.$dict.load(["assessmentStartStatus"]).then(() => {
this.$dict.load("assessmentStartStatus").then(() => {
this.getList();
});
},
methods: {
getList() {
this.isLevel5 = this.areaId.substring(this.areaId.length - 3) != "000";
this.instance
.post(`/app/appvillagerintegralshop/list`, null, {
params: {
@@ -337,16 +267,35 @@ export default {
},
statusChage(row) {
this.dialogInfo = { ...row };
if (this.dialogInfo.operators.length) {
this.dialogInfo.operators.map((item) => {
item.userName = item.name;
});
} else {
this.dialogInfo.operators = [];
}
this.authDialog = true
this.form = JSON.parse(JSON.stringify(row))
},
handleAuth() {
this.instance.post(`/app/appvillagerintegralshop/addOrUpdate`, this.form).then((res) => {
if (res?.code == 0) {
this.$message.success("授权成功!")
this.authDialog = false
}
})
},
getSelect(e) {
this.dialogInfo.operators = e;
this.dialogInfo.operators.map((item) => {
if (!item.name) {
item.name = item.userName;
}
});
this.instance
.post(`/app/appvillagerintegralshop/addOrUpdate`, this.dialogInfo)
.then((res) => {
this.dialogInfo.operators = []
if (res.code == 0) {
this.onReset();
}
}).catch(() => {
this.dialogInfo.operators = []
})
},
onReset() {
this.search.current = 1;
this.getList();
@@ -390,24 +339,6 @@ export default {
this.dialogInfo.operators = [];
},
getSelect(e) {
this.dialogInfo.operators = e;
this.dialogInfo.operators.map((item) => {
if (!item.name) {
item.name = item.userName;
}
});
this.instance
.post(`/app/appvillagerintegralshop/addOrUpdate`, this.dialogInfo)
.then((res) => {
this.dialogInfo.operators = []
if (res.code == 0) {
this.onReset();
}
}).catch(() => {
this.dialogInfo.operators = []
})
},
delate(index) {
this.dialogInfo.operators.splice(index, 1);
@@ -431,6 +362,7 @@ export default {
height: 100%;
overflow: auto;
background: #f3f6f9;
.status-0 {
color: #ff4466;
}

View File

@@ -43,5 +43,8 @@ export default {
<style lang="scss" scoped>
.AiUserPicker {
.el-select{
width: 100%;
}
}
</style>