Commit 6c0fc565 by 张立顺

fix 功能联调

1 parent 39289994
...@@ -582,3 +582,13 @@ export function receptionTagPageExport(data) { ...@@ -582,3 +582,13 @@ export function receptionTagPageExport(data) {
data.method = `dj.api.smartcarlife.reception.receptionTagPageExport` data.method = `dj.api.smartcarlife.reception.receptionTagPageExport`
return request(data, "post") return request(data, "post")
} }
// 前店后厂-权限列表
export function getPermissionsList(data) {
data.method = `dj.api.smartcarlife.qdhc.permissions`
return request(data, "post")
}
// 前店后厂-批量新增员工权限
export function addBatchPermissions(data) {
data.method = `dj.api.smartcarlife.qdhc.staff.permissions.batch.authorization`
return request(data, "post")
}
...@@ -12,15 +12,10 @@ ...@@ -12,15 +12,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商户类型" prop="smsCode"> <el-form-item label="权限名称" prop="checkList">
<!-- <el-input placeholder="请填写验证码" v-model="form.smsCode" size="small" style="width: 220px;" /> -->
<el-checkbox-group v-model="form.checkList"> <el-checkbox-group v-model="form.checkList">
<el-checkbox label="复选框 A"></el-checkbox> <el-checkbox v-for="(item, index) in optionsSelectList" :label="JSON.stringify(item)" :key="index"
<el-checkbox label="复选框 B"></el-checkbox> :value="item">{{ item.name }}</el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="复选框 A"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -29,8 +24,7 @@ ...@@ -29,8 +24,7 @@
</template> </template>
<script> <script>
import { getResidentListApi } from "@api/resident" import { getResidentListApi, getPermissionsList, addBatchPermissions } from "@api/resident"
import { yseMerchantModifyMerchantRef } from '@api/publicAccount'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { merchantClassifyList } from '@/common/constants' import { merchantClassifyList } from '@/common/constants'
export default { export default {
...@@ -38,9 +32,40 @@ export default { ...@@ -38,9 +32,40 @@ export default {
data() { data() {
return { return {
merchantClassifyList, merchantClassifyList,
optionsSelectList: [
{
name: "预约客户",
code: 'YUYUEKEHU'
},
{
// 创建施工单 CHUANGJIANSHIGONGDAN
name: "创建施工单",
code: "CHUANGJIANSHIGONGDAN"
},
// 施工确认 SHIGONGQUEREN
{
name: "施工确认",
code: "SHIGONGQUEREN"
},
// 物料出库 WULIAOCHUKU
{
name: "物料出库",
code: "WULIAOCHUKU"
},
// 完成施工 WANCHENGSHIGONG
{
name: "完成施工",
code: "WANCHENGSHIGONG"
},
// 审核施工单 SHENHESHIGONGDAN
{
name: "审核施工单",
code: "SHENHESHIGONGDAN"
}
],
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
form: { form: {
tableData: [],
checkList: [], checkList: [],
staffIds: [] staffIds: []
}, },
...@@ -52,8 +77,8 @@ export default { ...@@ -52,8 +77,8 @@ export default {
// 短信模块 // 短信模块
isSend: false, isSend: false,
rules: { rules: {
smsCode: [{ required: true, message: '请输入验证码', trigger: 'blur' }], checkList: [{ required: true, type: 'array', message: '请选择权限', trigger: 'change' }],
staffIds: [{ required: true, message: '请选择员工', trigger: 'blur' }] staffIds: [{ required: true, type: 'array', message: '请选择员工', trigger: 'change' }]
}, },
isShowOkbtn: true, isShowOkbtn: true,
num: 0 num: 0
...@@ -82,11 +107,21 @@ export default { ...@@ -82,11 +107,21 @@ export default {
}, },
created() { created() {
this.getResidentList() this.getResidentList()
this.getPermissionsList()
}, },
mounted() { mounted() {
}, },
methods: { methods: {
getPermissionsList() {
getPermissionsList({
}).then(res => {
console.log(res, 'getPermissionsList')
this.optionsSelectList = res.list
}).catch((err) => {
console.log(err)
})
},
getResidentList() { getResidentList() {
getResidentListApi({ getResidentListApi({
pageSize: 10, pageSize: 10,
...@@ -98,35 +133,26 @@ export default { ...@@ -98,35 +133,26 @@ export default {
console.log(err) console.log(err)
}) })
}, },
// 短信模块-end
getInfo(subShopMerchantInfo) {
// yseMerchantGetDetail({
// yseUserCode: yseUserCode
// }).then(res => {
// console.log(res, 'res')
this.subShopMerchantList = subShopMerchantInfo.yseMerchantRefs || []
if (this.subShopMerchantList.length > 0) {
this.form.tableData = deepClone(this.subShopMerchantList)
this.options = deepClone(this.subShopMerchantList)
}
},
handleAddConfirm() { handleAddConfirm() {
this.$refs.editSubordinateMerchantFrom.validate(valid => { this.$refs.form.validate(valid2 => {
if (valid) { if (valid2) {
if (!this.form.tableData.length) return this.$message.warning('请选择关联商户') const list = this.form.staffIds.reduce((acc, cur) => {
this.$refs.form.validate(valid2 => { this.form.checkList.forEach(item => {
if (valid2) { acc.push({
var params = { staffPhone: cur.staffPhone,
smsCode: this.form.smsCode, permissionId: JSON.parse(item).code
yseMerchantId: this.subShopMerchantInfo.id,
yseMerchantRefs: this.form.tableData
}
yseMerchantModifyMerchantRef(params).then(res => {
this.notice.okTips('操作成功')
this.handleClose()
}) })
} })
return acc
}, [])
var params = {
private: 1,
list
}
addBatchPermissions(params).then(res => {
this.notice.okTips('新增成功')
this.handleClose()
}) })
} }
}) })
......
...@@ -65,13 +65,12 @@ ...@@ -65,13 +65,12 @@
</div> </div>
<div class="info-item flex permissionBox"> <div class="info-item flex permissionBox">
<label>权限名称:</label> <label>权限名称:</label>
<span> <el-checkbox-group v-model="checkList"> <span>
<el-checkbox label="复选框 A"></el-checkbox> <el-checkbox-group v-model="checkList">
<el-checkbox label="复选框 B"></el-checkbox> <el-checkbox v-for="(item, index) in optionsSelectList" :label="JSON.stringify(item)" :key="index"
<el-checkbox label="复选框 C"></el-checkbox> :value="item" @change="(checked) => handleSingleChange(checked, item)">{{ item.name }}</el-checkbox>
<el-checkbox label="禁用"></el-checkbox> </el-checkbox-group>
<el-checkbox label="选中且禁用"></el-checkbox> </span>
</el-checkbox-group></span>
</div> </div>
</div> </div>
</div> </div>
...@@ -100,7 +99,7 @@ ...@@ -100,7 +99,7 @@
<i class="el-icon-warning custom-icon"></i> <i class="el-icon-warning custom-icon"></i>
<span class="log-text">已修改为{{ <span class="log-text">已修改为{{
detail.nextMonthBasicSalary detail.nextMonthBasicSalary
}}元,次月生效,当前月份基本工资仍为{{ }}元,次月生效,当前月份基本工资仍为{{
isEmpty(detail.basicSalary) ? "-" : detail.basicSalary isEmpty(detail.basicSalary) ? "-" : detail.basicSalary
}}元</span> }}元</span>
</div> </div>
...@@ -127,7 +126,7 @@ ...@@ -127,7 +126,7 @@
<i class="el-icon-warning custom-icon"></i> <i class="el-icon-warning custom-icon"></i>
<span class="log-text">已修改为{{ <span class="log-text">已修改为{{
detail.nextMonthPerformanceSalary detail.nextMonthPerformanceSalary
}}元,次月生效,当前月份绩效工资仍为{{ }}元,次月生效,当前月份绩效工资仍为{{
isEmpty(detail.performanceSalary) isEmpty(detail.performanceSalary)
? "-" ? "-"
: detail.performanceSalary : detail.performanceSalary
...@@ -194,7 +193,7 @@ ...@@ -194,7 +193,7 @@
<i class="el-icon-warning custom-icon"></i> <i class="el-icon-warning custom-icon"></i>
<span class="log-text">已修改为{{ <span class="log-text">已修改为{{
filterStr(detail.nextMonthJobType, tempjobTypeList) || "-" filterStr(detail.nextMonthJobType, tempjobTypeList) || "-"
}},次{{ }},次{{
(detail.jobType == 0 || detail.jobType == 1) && (detail.jobType == 0 || detail.jobType == 1) &&
(detail.nextMonthJobType == 1 || detail.nextMonthJobType == 2) (detail.nextMonthJobType == 1 || detail.nextMonthJobType == 2)
? "日" ? "日"
...@@ -492,6 +491,38 @@ export default { ...@@ -492,6 +491,38 @@ export default {
filterStr, filterStr,
isEmpty, isEmpty,
staffSceneLabelList: staffSceneLabelList, staffSceneLabelList: staffSceneLabelList,
optionsSelectList: [
{
name: "预约客户",
code: 'YUYUEKEHU'
},
{
// 创建施工单 CHUANGJIANSHIGONGDAN
name: "创建施工单",
code: "CHUANGJIANSHIGONGDAN"
},
// 施工确认 SHIGONGQUEREN
{
name: "施工确认",
code: "SHIGONGQUEREN"
},
// 物料出库 WULIAOCHUKU
{
name: "物料出库",
code: "WULIAOCHUKU"
},
// 完成施工 WANCHENGSHIGONG
{
name: "完成施工",
code: "WANCHENGSHIGONG"
},
// 审核施工单 SHENHESHIGONGDAN
{
name: "审核施工单",
code: "SHENHESHIGONGDAN"
}
],
info: {}, info: {},
checkList: [], checkList: [],
detail: { detail: {
...@@ -704,8 +735,37 @@ export default { ...@@ -704,8 +735,37 @@ export default {
this.jobTypeList = this.externalLevelList this.jobTypeList = this.externalLevelList
this.tempjobTypeList = this.tempExternalLevelList this.tempjobTypeList = this.tempExternalLevelList
} }
// this.getPermissionsList()
}, },
methods: { methods: {
handleSingleChange(checked, item) {
if (checked) {
console.log('勾选了:', item)
this.onItemSelected(item)
} else {
console.log('取消勾选了:', item)
this.onItemDeselected(item)
}
},
onItemSelected(item) {
// 处理勾选逻辑
console.log('处理勾选:', item)
},
onItemDeselected(item) {
// 处理取消勾选逻辑
console.log('处理取消勾选:', item)
},
getPermissionsList() {
getPermissionsList({
}).then(res => {
console.log(res, 'getPermissionsList')
this.optionsSelectList = res.list
}).catch((err) => {
console.log(err)
})
},
resetData() { resetData() {
this.getStaffWhite() this.getStaffWhite()
this.getResidentTeacherList() this.getResidentTeacherList()
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<performance-deduction-dialog :deduction-visible="deductionVisible" v-if="deductionVisible" <performance-deduction-dialog :deduction-visible="deductionVisible" v-if="deductionVisible"
@dialogClose="handleDeductionCloseDialog"></performance-deduction-dialog> @dialogClose="handleDeductionCloseDialog"></performance-deduction-dialog>
<!-- 新增权限 --> <!-- 新增权限 -->
<PermissionDialog :permissionVisible.sync="permissionVisible"></PermissionDialog> <PermissionDialog v-if="permissionVisible" :permissionVisible.sync="permissionVisible"></PermissionDialog>
</div> </div>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!