Commit ba99c522 by 萱草

update: 卡券账号分组调整

parent d22af545
.ml40[data-v-29eba1e0]{margin-left:40px}.filter-block[data-v-29eba1e0]{color:#303133;background:#f7f8fa;padding:20px;margin-bottom:20px}.filter-block span[data-v-29eba1e0]{margin-left:10px;margin-right:10px;line-height:20px}.card[data-v-29eba1e0]{padding-left:70px;min-height:60px;position:relative}.card img[data-v-29eba1e0]{position:absolute;left:0;top:0;width:60px;height:60px;border-radius:4px}.card .name[data-v-29eba1e0]{color:#303133;padding-top:8px;margin-bottom:7px;line-height:22px}.el-icon-delete[data-v-23a65bd6]{display:inline-block;font-size:17px;padding:9px;margin-right:10px;color:#909399;border:1px solid #e4e7ed;border-radius:50%;vertical-align:middle;cursor:pointer;position:relative;top:-60px}.el-icon-delete[data-v-23a65bd6]:hover{background:#fef0f0;border:1px solid #fbc4c4;color:#f5222d}
\ No newline at end of file
.ml40[data-v-29eba1e0]{margin-left:40px}.filter-block[data-v-29eba1e0]{color:#303133;background:#f7f8fa;padding:20px;margin-bottom:20px}.filter-block span[data-v-29eba1e0]{margin-left:10px;margin-right:10px;line-height:20px}.card[data-v-29eba1e0]{padding-left:70px;min-height:60px;position:relative}.card img[data-v-29eba1e0]{position:absolute;left:0;top:0;width:60px;height:60px;border-radius:4px}.card .name[data-v-29eba1e0]{color:#303133;padding-top:8px;margin-bottom:7px;line-height:22px}.el-icon-delete[data-v-f6806fa8]{display:inline-block;font-size:17px;padding:9px;margin-right:10px;color:#909399;border:1px solid #e4e7ed;border-radius:50%;vertical-align:middle;cursor:pointer;position:relative;top:-60px}.el-icon-delete[data-v-f6806fa8]:hover{background:#fef0f0;border:1px solid #fbc4c4;color:#f5222d}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -25,6 +25,5 @@ let packages = {
saveCustomSetting: '/setting/save-setting', // 保存配置 - 转增扣库存
};
packages = getFetch(packages, welfarePrefix);
export default { ...packages };
......@@ -26,8 +26,9 @@
<el-checkbox :label="1"><el-tooltip open-delay="200" content="不占用库存,使用福利中心“可占库存”,与其他应用使用同个库存" placement="top"><span class="tooltip-icon">实时库存</span></el-tooltip></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="操作人权限" prop="operAuthType">
<dm-acc-group-select :etype.sync="ruleForm.operAuthType" :group-ids.sync="ruleForm.operAuth" />
<el-form-item label="操作人权限" prop="operAuthType" required>
<!-- <dm-acc-group-select :etype.sync="ruleForm.operAuthType" :group-ids.sync="ruleForm.operAuth" /> -->
<dm-acc-group-select ref="accg" input-width="250px" :scene-type="sceneType" :relation-id="relationId" :is-echo="isEcho" />
</el-form-item>
<!-- <el-form-item>
<el-button type="primary" v-if="isAdd" @click="addForm">保存并添加卡券</el-button>
......@@ -100,7 +101,8 @@ import { cardType } from '@/config/mapping/gic-card';
import { formatDateTimeByType } from '@/utils/index.js';
import fetch from '@/api/card-package.js';
const { addPackages, editPackages, getPackageDetail, addPackageItem, delPackageItem } = fetch;
import commomApi from '@/api/common.js';
const { getRelationId } = commomApi;
export default {
name: 'MergeForm',
......@@ -124,13 +126,13 @@ export default {
}
callback();
};
const validateOperAuth = (rule, value, callback) => {
if (this.ruleForm.operAuthType == 2 && !this.ruleForm.operAuth.length) {
callback(new Error('请选择部分分组账号'));
return;
}
callback();
};
// const validateOperAuth = (rule, value, callback) => {
// if (this.ruleForm.operAuthType == 2 && !this.ruleForm.operAuth.length) {
// callback(new Error('请选择部分分组账号'));
// return;
// }
// callback();
// };
return {
loading: false,
cardLoading: false,
......@@ -161,7 +163,7 @@ export default {
packageStock: [ { required: true, message: '请输入卡券包库存', trigger: 'change' } ],
effectiveMode: [ { required: true, validator: validateSendType, trigger: 'change' } ],
cardIds: [ { required: true, validator: validateCardIds, message: '请选择卡券', trigger: 'change' } ],
operAuthType: [ { required: true, validator: validateOperAuth, trigger: 'change' } ],
// operAuthType: [ { required: true, validator: validateOperAuth, trigger: 'change' } ],
},
pickerOptions: {
disabledDate(now) {
......@@ -172,6 +174,9 @@ export default {
isAdd: this.$route.meta.type === 'add',
isEdit: this.$route.meta.type === 'edit',
isInfo: this.$route.meta.type === 'info',
relationId: '', // 账号分组relationId
isEcho: false, // 控制操作人权限是否回显数据
sceneType: 10, // 场景值,现在测试使用,后期提供确定的
};
},
created() {
......@@ -181,11 +186,21 @@ export default {
if(this.currentAreaId) {
if(!this.isAdd) {
this.couponPackageId = this.$route.query.id;
this.relationId = this.$route.query.id;
this.isEcho = true;
this.getInfo();
}else{
this.getRelationId();
}
}
},
methods: {
getRelationId() {
getRelationId().then(res => {
this.couponPackageId = res.result;
this.relationId = res.result;
});
},
// 添加卡券
saveWelfare(welfare) {
const { welfareId, customStock } = welfare;
......@@ -270,13 +285,15 @@ export default {
if(this.loading) {
return;
}
if(!this.$refs.accg.validate()) return;
this.$refs.accg.save();
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
PublicMethods.jumpToFormError(); // eslint-disable-line
return;
} else {
// this.ruleForm.couponIds = this.couponList.join(','); // 卡券ids用,分割
let params = { ...this.ruleForm, memberCardId: this.currentAreaId };
let params = { ...this.ruleForm, memberCardId: this.currentAreaId, couponPackageId: this.couponPackageId };
params.stockUseType = this.stockType.length == 2 ? 2 : this.stockType[0];
params.beginDate = formatDateTimeByType(this.dateTime[0], 'yyyy-MM-dd');
params.endDate = formatDateTimeByType(this.dateTime[1], 'yyyy-MM-dd');
......@@ -299,6 +316,7 @@ export default {
if(!this.isAdd) {
this.$router.push('/card-package/list');
} else {
this.isEcho = true;
this.$router.push(`/card-package/edit?id=${res.result}`);
}
}).finally(() => {
......@@ -319,6 +337,8 @@ export default {
this.$tips({ message: '卡券包库存大于福利库存,请调整福利占用库存', type: 'error' });
return;
}
if(!this.$refs.accg.validate()) return;
this.$refs.accg.save();
const params = {
couponPackageId: this.couponPackageId,
count: Math.abs(this.info.packageStock - this.ruleForm.packageStock),
......
......@@ -380,6 +380,9 @@ export default {
isAdd: this.$route.meta.type === 'add',
isEdit: this.$route.meta.type === 'edit',
isCopy: this.$route.meta.type === 'copy',
relationId: '', // 账号分组relationId
isEcho: false, // 控制操作人权限是否回显数据
sceneType: 10, // 场景值,现在测试使用,后期提供确定的
};
},
created() {
......@@ -401,6 +404,7 @@ export default {
getRelationId() {
getRelationId().then(res => {
this.couponId = res.result;
this.relationId = res.result;
});
},
getMallShopList() {
......@@ -709,6 +713,8 @@ export default {
if (this.loading) {
return;
}
if(!this.$refs.accg.validate()) return;
this.$refs.accg.save();
let params = { ...this.ruleForm1, ...this.ruleForm2, goodsSearchId: this.goodsSearchId };
try {
params.couponId = this.couponId; // 主键在一进来页面的时候就已经确定
......
......@@ -227,7 +227,8 @@
</el-checkbox-group>
</el-form-item>
<el-form-item label="操作人权限">
<dm-acc-group-select :etype.sync="ruleForm1.operAuthType" :group-ids.sync="ruleForm1.operAuth" />
<!-- <dm-acc-group-select :etype.sync="ruleForm1.operAuthType" :group-ids.sync="ruleForm1.operAuth" /> -->
<dm-acc-group-select ref="accg" input-width="250px" :scene-type="sceneType" :relation-id="relationId" :is-echo="isEcho" />
</el-form-item>
<el-form-item prop="useExplain" label="使用说明">
<el-input show-word-limit type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" class="w260 autosize" :rows="4" v-model="ruleForm1.useExplain" :maxlength="500" placeholder="建议填写卡券的具体使用信息"/>
......
......@@ -76,7 +76,10 @@ export default {
fileList: [], // 导入券码的的文件的列表
linkData: {}, // 首图链接
linkData2: {}, // 跳转配置
operAuth: []
operAuth: [],
relationId: this.$route.query.id, // 账号分组relationId
isEcho: true, // 控制操作人权限是否回显数据
sceneType: 10, // 场景值,现在测试使用,后期提供确定的
};
},
created() {
......@@ -118,6 +121,8 @@ export default {
if (this.loading) {
return;
}
if(!this.$refs.accg.validate()) return;
this.$refs.accg.save();
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
PublicMethods.jumpToFormError(); // eslint-disable-line
......
......@@ -94,7 +94,8 @@
{{ info.stockUseType == 0 ? '固定库存' : info.stockUseType == 1 ? '实时库存' : '固定+实时库存' }}
</el-form-item>
<el-form-item label="操作人权限">
<dm-acc-group-select :etype.sync="info.operAuthType" :group-ids.sync="operAuth" read-only />
<!-- <dm-acc-group-select :etype.sync="info.operAuthType" :group-ids.sync="operAuth" read-only /> -->
<dm-acc-group-select ref="accg" input-width="250px" :scene-type="sceneType" :relation-id="relationId" :is-echo="isEcho" />
</el-form-item>
<el-form-item prop="useExplain" label="使用说明">
<el-input show-word-limit v-if="isEdit" type="textarea" :rows="4" v-model="ruleForm.useExplain" class="w500" :maxlength="500" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment