This commit is contained in:
fan 2019-08-19 19:32:23 +08:00
commit 442b3fd686
31 changed files with 2335 additions and 2263 deletions

View File

@ -40,5 +40,10 @@ export default {
codeHasExist: 'Coding already exists',
formartError: 'The format is incorrect, only characters/numbers/_',
createDictionaryFailed: 'Failed to create dictionary',
updateDictionaryFailed: 'Failed to update dictionary'
updateDictionaryFailed: 'Failed to update dictionary',
createDetailFailed: 'Failed to create details',
updateDetailFailed: 'Failed to update details',
addFailed: 'Failure to add',
updateFailed: 'Failure to update'
};

View File

@ -52,6 +52,7 @@ export default {
transferQRCode: 'Transfer QRCode',
today: 'Today',
yesterday: 'Yesterday',
addOrder: 'AddOrder',
aWeekAgo: 'A week ago',
updateOrder: 'Update order',
renewOrder: 'Renew order',
@ -79,6 +80,7 @@ export default {
trialTime: 'Trial time',
distributionUser: 'Distribution user',
orderNumber: 'Order Number',
select: 'Select',
sourcesOfInformation: 'Sources of information',
distributePermission: 'Distribute permission',
orderCreation: 'Order creation',

View File

@ -181,6 +181,10 @@ export default {
goodsDescribtionInput: 'Please enter product description',
userNameInput: 'Please enter user name',
permissionTypeInput: 'Please select the permission type',
timeInput: 'Please enter the time',
chooseUser: 'Please select the user',
pleaseInputLessonName: 'Please enter the course name',
pleaseSelectTraining: 'Please select training',
maxScaling: '(The maximum scale is 8 steps)',
skinCodingInput: 'Please enter skin code',

View File

@ -11,8 +11,8 @@ export default {
updateSuccess: 'Update successful',
destory: 'Destory',
simulationGroup: 'Simulation Group',
username: 'User Name',
phoneNumber: 'Cell-phone Number',
userName: 'User Name',
mobile: 'Cell-phone Number',
skinCode: 'Skin Code',
prdType: 'Product Type',
simulationType: 'Simulation Type',
@ -21,5 +21,34 @@ export default {
isError: 'Is Error',
isSuspend: 'Is Suspend',
isDrivingAsplanned: 'Whether to drive as planned',
delUserSimulationIsContinue: 'This operation will delete the user simulation data. Do you want to continue?'
delUserSimulationIsContinue: 'This operation will delete the user simulation data. Do you want to continue?',
createDetail: 'Create details',
editDetail: 'Editorial details',
mapName: 'Map Name',
trainingName: 'Training Name',
trainingUseTime: 'Training Time',
minute: 'Minute',
second: 'Second',
createSimulationTitle: 'Create Simulation Information',
addSuccess: 'Added Successfully',
pleaseInputNames: 'Please enter your nickname/name/cell phone number',
examUser: 'Examination Users',
examScore: 'Examination Score',
examResult: 'Examination Results',
examName: 'Paper Name',
delExamResultIsContinue: 'This operation will delete the test result. Do you want to continue?',
editExamDetail: 'Edit exam details',
subscribeMap: 'Subscribe',
roles: 'Roles',
email: 'Email',
nickname: 'Nickname',
delTypeIsContinue: 'This operation will delete the type. Do you want to continue?',
permission: 'Permission',
editUserPermission: 'Edit User Rights',
lessonName: 'Lesson Name',
selectTraining: 'Selection Training',
createUserTraining: 'Creating User Training',
editTrainingDetail: 'Editor Training Details',
trainingTime: 'Training duration'
};

View File

@ -40,6 +40,10 @@ export default {
codeHasExist: '编码已存在',
formartError: '格式不正确,只能是字符/数字/_',
createDictionaryFailed: '创建字典失败',
updateDictionaryFailed: '更新字典失败'
updateDictionaryFailed: '更新字典失败',
createDetailFailed: '创建明细失败',
updateDetailFailed: '更新明细失败',
addFailed: '添加失败',
updateFailed: '更新失败'
};

View File

@ -83,5 +83,6 @@ export default {
sourcesOfInformation: '信息来源',
distributePermission: '权限分发',
orderCreation: '订单创建',
select: '选择',
chooseGoods: '选择商品'
};

View File

@ -180,6 +180,10 @@ export default {
goodsDescribtionInput: '请输入商品描述',
userNameInput: '请输入用户名称',
permissionTypeInput: '请选择权限类型',
timeInput: '请输入时长',
chooseUser: '请选择用户',
pleaseInputLessonName: '请输入课程名称',
pleaseSelectTraining: '请选择实训',
maxScaling: '(缩放比例最大为8级)',
skinCodingInput: '请输入皮肤编码',

View File

@ -11,8 +11,8 @@ export default {
updateSuccess: '更新成功',
destory: '销 毁',
simulationGroup: '仿真Group',
username: '用户名',
phoneNumber: '手机号',
userName: '用户名',
mobile: '手机号',
skinCode: '皮肤编号',
prdType: '产品类型',
simulationType: '仿真类型',
@ -21,5 +21,34 @@ export default {
isError: '是否错误',
isSuspend: '是否暂停',
isDrivingAsplanned: '是否按计划行车',
delUserSimulationIsContinue: '此操作将删除此用户仿真数据, 是否继续?'
delUserSimulationIsContinue: '此操作将删除此用户仿真数据, 是否继续?',
createDetail: '创建明细',
editDetail: '编辑明细',
mapName: '地图名称',
trainingName: '实训名称',
trainingUseTime: '实训用时',
minute: '分',
second: '秒',
createSimulationTitle: '创建仿真信息',
addSuccess: '添加成功',
pleaseInputNames: '请输入昵称/名字/手机号',
examUser: '考试用户',
examScore: '考试成绩',
examResult: '考试结果',
examName: '试卷名称',
delExamResultIsContinue: '此操作将删除此考试结果, 是否继续?',
editExamDetail: '编辑考试详情',
subscribeMap: '订阅地图',
roles: '角色',
email: '邮箱',
nickname: '昵称',
delTypeIsContinue: '此操作将删除该类型, 是否继续?',
permission: '权限',
editUserPermission: '编辑用户权限',
lessonName: '课程名称',
selectTraining: '选择实训',
createUserTraining: '创建用户实训',
editTrainingDetail: '编辑实训详情',
trainingTime: '实训时长'
};

View File

@ -40,12 +40,12 @@ export default {
const form = {
labelWidth: '60px',
items: [
{ prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd },
{ prop: 'name', label: '名称', type: 'text', required: true },
{ prop: 'code', label: this.$t('system.code'), type: 'text', required: true, disabled: !isAdd },
{ prop: 'name', label: this.$t('system.name'), type: 'text', required: true },
{
prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status
prop: 'status', label: this.$t('system.status'), type: 'select', required: true, options: this.$ConstSelect.Status
},
{ prop: 'remarks', label: '备注', type: 'textarea', required: false }
{ prop: 'remarks', label: this.$t('system.remarks'), type: 'textarea', required: false }
]
};
return form;
@ -53,21 +53,21 @@ export default {
rules() {
const crules = {
name: [
{ required: true, message: '请输入名称', trigger: 'blur' },
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
],
remarks: [
{ max: 50, message: '不能超过 50 个字符', trigger: 'blur' }
{ max: 50, message: this.$t('rules.strLengthNotExceed50'), trigger: 'blur' }
]
};
if (this.type === 'ADD') {
return Object.assign(crules, {
code: [
{ required: true, message: '请输入编码', trigger: 'blur' },
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' },
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' },
{ validator: this.validateCode, trigger: 'blur' }
]
});
@ -77,25 +77,25 @@ export default {
},
title() {
if (this.type === 'ADD') {
return '创建明细';
return this.$t('system.createDetail');
} else {
return '编辑明细';
return this.$t('system.editDetail');
}
}
},
methods: {
validateCode(rule, value, callback) {
if (!validateCharCode(value)) {
return callback(new Error('格式不正确,只能是字符/数字/_'));
return callback(new Error(this.$t('error.formartError')));
} else {
checkDicDetailCodeExist(this.dicId, value).then(response => {
if (response.data) {
return callback(new Error('编码已存在'));
return callback(new Error(this.$t('error.codeHasExist')));
} else {
return callback();
}
}).catch(() => {
return callback(new Error('服务异常'));
return callback(new Error(this.$t('error.serviceException')));
});
}
},
@ -121,21 +121,21 @@ export default {
create() {
const self = this;
create(this.dicId, this.formModel).then(response => {
self.$message.success('创建字典目录成功');
self.$message.success(this.$t('system.createSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error('创建字典目录失败:' + error.message);
self.$message.error(`${this.$t('error.createDetailFailed')}:${error.message}`);
});
},
update() {
const self = this;
update(this.dicId, this.formModel).then(response => {
self.$message.success('更新字典目录成功');
self.$message.success(this.$t('system.updateSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error('更新字典目录失败:' + error.message);
self.$message.error(`${this.$t('error.updateDetailFailed')}:${error.message}`);
});
},
handleClose(done) {

View File

@ -28,11 +28,11 @@ export default {
},
userName: {
type: 'text',
label: this.$t('system.username')
label: this.$t('system.userName')
},
mobile: {
type: 'text',
label: this.$t('system.phoneNumber')
label: this.$t('system.mobile')
},
skinCode: {
type: 'select',
@ -64,11 +64,11 @@ export default {
indexShow: true,
columns: [
{
title: this.$t('system.username'),
title: this.$t('system.userName'),
prop: 'creator.name'
},
{
title: this.$t('system.phoneNumber'),
title: this.$t('system.mobile'),
prop: 'creator.mobile'
},
{
@ -170,7 +170,7 @@ export default {
return sessionId;
},
handleDelete(index, row) {
this.$confirm(this.$t('global.delUserSimulationIsContinue'), this.$t('global.tips'), {
this.$confirm(this.$t('system.delUserSimulationIsContinue'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'

View File

@ -1,9 +1,9 @@
<template>
<el-dialog :title="'编辑用户权限'" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
<el-dialog :title="$t('system.editUserPermission')" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
@ -31,11 +31,11 @@ export default {
const form = {
labelWidth: '60px',
items: [
{ prop: 'name', label: '名称', type: 'text', required: true, disabled: true },
{ prop: 'name', label: this.$t('system.name'), type: 'text', required: true, disabled: true },
// { prop: 'nickname', label: '', type: 'text', required: true },
// { prop: 'mobile', label: '', type: 'text', required: true },
// { prop: 'email', label: '', type: 'text' },
{ prop: 'roles', label: '权限', type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true }
{ prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true }
]
};
return form;
@ -43,11 +43,11 @@ export default {
rules() {
const crules = {
name: [
{ required: true, message: '请输入名称', trigger: 'blur' },
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
]
};
return crules;
@ -76,11 +76,11 @@ export default {
update() {
const self = this;
putRoles(this.formModel).then(response => {
self.$message.success('修改成功');
self.$message.success(this.$t('system.updateSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error('修改失败:' + error.message);
self.$message.error(`${this.$t('error.updateFailed')}: ${error.message}`);
});
},
handleClose(done) {

View File

@ -29,11 +29,11 @@ export default {
queryObject: {
name: {
type: 'text',
label: '名称'
label: this.$t('system.name')
},
roles: {
type: 'select',
label: '角色',
label: this.$t('system.roles'),
config: {
data: this.$ConstSelect.roleList
}
@ -47,23 +47,23 @@ export default {
indexShow: true,
columns: [
{
title: '名称',
title: this.$t('system.name'),
prop: 'name'
},
{
title: '昵称',
title: this.$t('system.nickname'),
prop: 'nickname'
},
{
title: '电话',
title: this.$t('system.mobile'),
prop: 'mobile'
},
{
title: '邮箱',
title: this.$t('system.email'),
prop: 'email'
},
{
title: '角色',
title: this.$t('system.roles'),
prop: 'roles',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
@ -71,15 +71,15 @@ export default {
},
{
type: 'button',
title: '操作',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: '编辑',
name: this.$t('global.edit'),
handleClick: this.handleUserEdit
},
{
name: '订阅地图',
name: this.$t('system.subscribeMap'),
handleClick: this.handleMapCorrelation,
type: 'danger'
}
@ -100,9 +100,9 @@ export default {
//
handleUserDelete(index, row) {
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('system.delTypeIsContinue'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
// delPublishMap(row.id).then(response => {

View File

@ -2,8 +2,8 @@
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
@ -34,12 +34,12 @@ export default {
computed: {
form() {
const form = {
labelWidth: '100px',
labelWidth: '160px',
items: [
{ prop: 'userName', label: '用户名称', type: 'text', required: false, disabled: true },
{ prop: 'examName', label: '试卷名称', type: 'text', required: true, disabled: true },
{ prop: 'score', label: '考试分数', type: 'text', required: true },
{ prop: 'result', label: '考试结果', type: 'select', required: true, options: this.$ConstSelect.examResultList }
{ prop: 'userName', label: this.$t('system.userName'), type: 'text', required: false, disabled: true },
{ prop: 'examName', label: this.$t('system.examName'), type: 'text', required: true, disabled: true },
{ prop: 'score', label: this.$t('system.examScore'), type: 'text', required: true },
{ prop: 'result', label: this.$t('system.examResult'), type: 'select', required: true, options: this.$ConstSelect.examResultList }
]
};
return form;
@ -47,16 +47,16 @@ export default {
rules() {
const crules = {
score: [
{ required: true, message: '请输入名称', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' }
],
result: [
{ required: true, message: '请选择状态', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
]
};
return crules;
},
title() {
return '编辑考试详情';
return this.$t('system.editExamDetail');
}
},
methods: {
@ -79,11 +79,11 @@ export default {
update() {
const self = this;
updateExam(this.formModel).then(response => {
self.$message.success('修改成功!');
self.$message.success(this.$t('system.updateSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error('修改失败!' + error.message);
self.$message.error(`${this.$t('error.updateFailed')}: ${error.message}`);
});
},
handleClose(done) {

View File

@ -22,20 +22,20 @@ export default {
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
labelWidth: '150px',
reset: true,
queryObject: {
examName: {
type: 'text',
label: '试卷名称'
label: this.$t('system.examName')
},
userName: {
type: 'text',
label: '考试用户'
label: this.$t('system.examUser')
},
result: {
type: 'select',
label: '考试结果',
label: this.$t('system.examResult'),
config: {
data: this.$ConstSelect.examResultList
}
@ -49,11 +49,11 @@ export default {
indexShow: true,
columns: [
{
title: '试卷名称',
title: this.$t('system.examName'),
prop: 'examName'
},
{
title: '考试结果',
title: this.$t('system.examResult'),
prop: 'result',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.result, this.$ConstSelect.examResultList, ['value', 'label']); },
@ -67,28 +67,28 @@ export default {
}
},
{
title: '考试成绩',
title: this.$t('system.examScore'),
prop: 'score'
},
{
title: '考试用户',
title: this.$t('system.examUser'),
prop: 'userName'
},
{
title: '用户手机号',
title: this.$t('system.mobile'),
prop: 'userMobile'
},
{
type: 'button',
title: '操作',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: '编辑',
name: this.$t('global.edit'),
handleClick: this.edit
},
{
name: '删除',
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
@ -115,17 +115,17 @@ export default {
//
handleDelete(index, row) {
this.$confirm('此操作将删除此考试结果, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('system.delExamResultIsContinue'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
delPublishExam(row.id).then(response => {
this.$message.success('删除成功');
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},

View File

@ -2,8 +2,8 @@
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave"> </el-button>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
@ -41,12 +41,12 @@ export default {
computed: {
form() {
const form = {
labelWidth: '100px',
labelWidth: '120px',
items: [
{ prop: 'mapId', label: '地图名称', type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange },
{ prop: 'mapPrdCode', label: '产品名称', type: 'select', required: true, options: this.mapPrdList, placeholder: '请选择产品' },
{ prop: 'userName', label: '用户名称', type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
{ prop: 'duration', label: '实训时长', type: 'text', rightWidth: true, required: true, message: 's' }
{ prop: 'mapId', label: this.$t('system.mapName'), type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange, placeholder: this.$t('rules.mapInput') },
{ prop: 'mapPrdCode', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') },
{ prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') },
{ prop: 'duration', label: this.$t('system.trainingUseTime'), type: 'text', rightWidth: true, required: true, message: 's' }
]
};
return form;
@ -54,22 +54,22 @@ export default {
rules() {
const crules = {
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' }
{ required: true, message: this.$t('rules.mapInput'), trigger: 'change' }
],
userName: [
{ required: true, message: '请选择用户', trigger: 'change' }
{ required: true, message: this.$t('rules.chooseUser'), trigger: 'change' }
],
mapPrdCode: [
{ required: true, message: '请选择产品', trigger: 'change' }
{ required: true, message: this.$t('rules.productInput'), trigger: 'change' }
],
duration: [
{ required: true, message: '请输入时长', trigger: 'blur' }
{ required: true, message: this.$t('rules.timeInput'), trigger: 'blur' }
]
};
return crules;
},
title() {
return '创建仿真信息';
return this.$t('system.createSimulationTitle');
}
},
mounted() {
@ -113,7 +113,7 @@ export default {
});
cb(results);
} catch (error) {
console.error(error, '查询用户list');
console.error(error);
cb(results);
}
} else {
@ -148,13 +148,6 @@ export default {
},
show(data) {
this.dialogVisible = true;
// this.formModel = {
// mapId: '',
// mapPrdCode: '',
// userId: '',
// userName: '',
// duration: '',
// };
},
doSave() {
const self = this;
@ -172,14 +165,14 @@ export default {
};
if (params.userId) {
postSimulationStats(params).then(response => {
self.$message.success('新增成功!');
self.$message.success(this.$t('system.addSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error('新增失败!' + error.message);
self.$message.error(this.$t('error.addFailed') + error.message);
});
} else {
this.$message.error('请选择用户');
this.$message.error(this.$t('rules.chooseUser'));
}
},
handleClose(done) {

View File

@ -29,16 +29,16 @@ export default {
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
labelWidth: '120px',
reset: true,
queryObject: {
trainingName: {
type: 'text',
label: '实训名称'
label: this.$t('system.trainingName')
},
userName: {
type: 'text',
label: '用户名'
label: this.$t('system.userName')
}
}
@ -49,41 +49,41 @@ export default {
indexShow: true,
columns: [
{
title: '用户名称',
title: this.$t('system.userName'),
prop: 'userName'
},
{
title: '用户手机号',
title: this.$t('system.mobile'),
prop: 'userMobile'
},
{
title: '地图名称',
title: this.$t('system.mapName'),
prop: 'mapName'
},
{
title: '实训用时',
title: this.$t('system.trainingUseTime'),
prop: 'duration',
type: 'tag',
columnValue: (row) => { return this.computation(row.duration); },
tagType: (row) => { return 'success'; }
},
{
title: '产品名称',
title: this.$t('system.productName'),
prop: 'mapPrdName'
},
{
type: 'button',
title: '操作',
title: this.$t('global.operate'),
width: '250',
hide: (row) => { return !row.fake; },
buttons: [
{
name: '编辑',
name: this.$t('global.edit'),
handleClick: this.edit,
showControl: (row) => { return row.fake; }
},
{
name: '删除',
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger',
showControl: (row) => { return row.fake; }
@ -92,7 +92,7 @@ export default {
}
],
actions: [
{ text: '新增', handler: this.createTraining }
{ text: this.$t('global.add'), handler: this.createTraining }
]
},
currentModel: {}
@ -121,9 +121,9 @@ export default {
const f = parseInt(fieldValue / 60);
const s = fieldValue % 60;
if (f > 0) {
return `${f}${s}`;
return `${f} ${this.$t('system.minute')} ${s} ${this.$t('system.second')}`;
} else {
return `${s}`;
return `${s} ${this.$t('system.second')}`;
}
}
},
@ -135,17 +135,17 @@ export default {
//
handleDelete(index, row) {
this.$confirm('此操作将删除此用户仿真数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('system.delUserSimulationIsContinue'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteSimulationStats(row.id).then(response => {
this.$message.success('删除成功');
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},

View File

@ -3,8 +3,8 @@
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave"> </el-button>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
<add-training ref="addTraining" @selectTrain="selectTrain" />
@ -48,12 +48,12 @@ export default {
form() {
this.type === 'ADD';
const form = {
labelWidth: '100px',
labelWidth: '150px',
items: [
{ prop: 'lessonId', label: '课程名称', type: 'select', required: true, options: this.LessonList },
{ prop: 'trainingName', label: '实训名称', type: 'text', required: true, rightWidth: true, disabled: true, buttontip: '选择实训', buttonClick: this.buttonClick, placeholder: '请选择实训' },
{ prop: 'userName', label: '用户名称', type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
{ prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' }
{ prop: 'lessonId', label: this.$t('system.lessonName'), type: 'select', required: true, options: this.LessonList },
{ prop: 'trainingName', label: this.$t('system.trainingName'), type: 'text', required: true, rightWidth: true, disabled: true, buttontip: this.$t('system.selectTraining'), buttonClick: this.buttonClick, placeholder: this.$t('rules.pleaseSelectTraining') },
{ prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') },
{ prop: 'duration', label: this.$t('system.trainingTime'), type: 'text', required: true, rightWidth: true, message: 's' }
]
};
return form;
@ -61,22 +61,22 @@ export default {
rules() {
const crules = {
lessonId: [
{ required: true, message: '请输入教学名称', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseInputLessonName'), trigger: 'change' }
],
trainingName: [
{ required: true, message: '请选择实训', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseSelectTraining'), trigger: 'change' }
],
userName: [
{ required: true, message: '请输入用户名称', trigger: 'change' }
{ required: true, message: this.$t('rules.userNameInput'), trigger: 'change' }
],
duration: [
{ required: true, message: '请输入时长', trigger: 'blur' }
{ required: true, message: this.$t('rules.timeInput'), trigger: 'blur' }
]
};
return crules;
},
title() {
return '创建用户实训';
return this.$t('system.createUserTraining');
}
},
mounted() {
@ -139,14 +139,6 @@ export default {
},
show(data) {
this.dialogVisible = true;
// this.formModel = {
// lessonId: '',
// trainingId: '',
// trainingName: '',
// userId: '',
// userName: '',
// duration: '',
// };
},
doSave() {
const self = this;
@ -158,14 +150,14 @@ export default {
const self = this;
if (this.formModel.userId) {
addUserTraining(this.formModel).then(response => {
self.$message.success('创建成功!');
self.$message.success(this.$t('system.addSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error('创建失败!' + error.message);
self.$message.error(this.$t('error.addFailed') + error.message);
});
} else {
self.$message.error('请选择用户');
self.$message.error(this.$t('rules.chooseUser'));
}
},
handleClose(done) {

View File

@ -17,8 +17,8 @@
</el-tree>
</el-scrollbar>
<span slot="footer" class="dialog-footer">
<el-button type="primary" :disabled="disabled" @click="doSave"> </el-button>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" :disabled="disabled" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
@ -34,7 +34,7 @@ export default {
data() {
return {
dialogVisibles: false,
title: '选择实训',
title: this.$t('system.selectTraining'),
treeData: [{
children: [],
name: ''

View File

@ -2,8 +2,8 @@
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave"> </el-button>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
@ -37,10 +37,10 @@ export default {
const form = {
labelWidth: '100px',
items: [
{ prop: 'lessonName', label: '教学名称', type: 'text', required: false, disabled: true },
{ prop: 'trainingName', label: '实训名称', type: 'text', required: true, disabled: true },
{ prop: 'userName', label: '用户名称', type: 'text', required: true, disabled: true },
{ prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' }
{ prop: 'lessonName', label: this.$t('system.lessonName'), type: 'text', required: false, disabled: true },
{ prop: 'trainingName', label: this.$t('system.trainingName'), type: 'text', required: true, disabled: true },
{ prop: 'userName', label: this.$t('system.userName'), type: 'text', required: true, disabled: true },
{ prop: 'duration', label: this.$t('system.trainingTime'), type: 'text', required: true, rightWidth: true, message: 's' }
]
};
return form;
@ -48,13 +48,13 @@ export default {
rules() {
const crules = {
duration: [
{ required: true, message: '请输入时长', trigger: 'blur' }
{ required: true, message: this.$t('rules.timeInput'), trigger: 'blur' }
]
};
return crules;
},
title() {
return '编辑实训详情';
return this.$t('system.editTrainingDetail');
}
},
methods: {
@ -67,7 +67,6 @@ export default {
userName: data.userName,
trainingName: data.trainingName,
duration: data.duration
// trainingCount: data.trainingCount
};
}
},
@ -84,11 +83,11 @@ export default {
duration: this.formModel.duration
};
putUserTraining(param).then(response => {
self.$message.success('修改成功!');
self.$message.success(this.$t('system.updateSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error('修改失败!' + error.message);
self.$message.error(`${this.$t('error.updateFailed')}: ${error.message}`);
});
},
handleClose(done) {

View File

@ -24,16 +24,16 @@ export default {
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
labelWidth: '120px',
reset: true,
queryObject: {
trainingName: {
type: 'text',
label: '实训名称'
label: this.$t('system.trainingName')
},
userName: {
type: 'text',
label: '用户名'
label: this.$t('system.userName')
}
}
@ -44,40 +44,40 @@ export default {
indexShow: true,
columns: [
{
title: '用户名称',
title: this.$t('system.userName'),
prop: 'userName'
},
{
title: '用户手机号',
title: this.$t('system.mobile'),
prop: 'userMobile'
},
{
title: '课程名称',
title: this.$t('system.lessonName'),
prop: 'lessonName'
},
{
title: '实训用时',
title: this.$t('system.trainingUseTime'),
prop: 'duration',
type: 'tag',
columnValue: (row) => { return this.computation(row.duration); },
tagType: (row) => { return 'success'; }
},
{
title: '实训名称',
title: this.$t('system.trainingName'),
prop: 'trainingName'
},
{
type: 'button',
title: '操作',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: '编辑',
name: this.$t('global.edit'),
handleClick: this.edit,
showControl: (row) => { return row.fake != '0'; }
},
{
name: '删除',
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger',
showControl: (row) => { return row.fake != '0'; }
@ -86,7 +86,7 @@ export default {
}
],
actions: [
{ text: '新增', handler: this.createTraining }
{ text: this.$t('global.add'), handler: this.createTraining }
]
},
currentModel: {}
@ -107,9 +107,9 @@ export default {
const f = parseInt(fieldValue / 60);
const s = fieldValue % 60;
if (f > 0) {
return `${f}${s}`;
return `${f} ${this.$t('system.minute')} ${s} ${this.$t('system.second')}`;
} else {
return `${s}`;
return `${s} ${this.$t('system.second')}`;
}
}
},
@ -121,17 +121,17 @@ export default {
//
handleDelete(index, row) {
this.$confirm('此操作将删除此考试结果, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('system.delExamResultIsContinue'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteUserTraining(row.id).then(response => {
this.$message.success('删除成功');
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},

View File

@ -1,8 +1,7 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<author-detail ref="authorDetail"></author-detail>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<author-detail ref="authorDetail" />
</div>
</template>
@ -12,7 +11,7 @@
import authorDetail from './detail';
export default {
name: 'author',
name: 'Author',
components: {
authorDetail
},
@ -62,28 +61,28 @@
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName',
prop: 'mapName'
},
{
title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName',
prop: 'mapProductName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName',
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']) },
tagType: (row) => { return '' }
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('orderAuthor.permanenceOrNot'),
prop: 'forever',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether') },
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
@ -95,7 +94,7 @@
title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList') },
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
tagType: (row) => {
switch (row.canDistribute) {
case true: return 'success';
@ -128,7 +127,7 @@
title: this.$t('orderAuthor.courseAuthorityStatus'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
@ -159,24 +158,24 @@
},
{
name: this.$t('orderAuthor.renew'),
type: "warning",
type: 'warning',
handleClick: this.handleRenewAdd,
showControl: (row) => {
return row.origin === '01' && (row.forever || (row.endTime && Date.parse(new Date(row.endTime.replace(/\-/g, "\/"))) > Date.parse(new Date())))
return row.origin === '01' && (row.forever || (row.endTime && Date.parse(new Date(row.endTime.replace(/\-/g, '\/'))) > Date.parse(new Date())));
}
},
{
name: this.$t('orderAuthor.source'),
type: '',
handleClick: this.handleSource,
},
handleClick: this.handleSource
}
]
}
],
actions: [
]
}
}
};
},
mounted() {
@ -199,26 +198,24 @@
});
},
formatterDate(row, porpInfo) {
if (row.hasOwnProperty(porpInfo.property)) {
}
return row[porpInfo.property];
},
queryFunction(params) {
return getLessonPermissonPageList(params);
},
handleSetFailure(index, row) {
this.$confirm(this.$t('tip.updatePrivilegeTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
this.$confirm(this.$t('tip.updatePrivilegeTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
setLessonPermisson({ id: row.id, status: row.status == 1 ? '0' : '1' }).then(res => {
this.$message.success(this.$t('tip.setupSuccessfully'));
this.reloadTable();
}).catch(error => {
}).catch(() => {
this.$messageBox(this.$t('tip.setupFailed'));
})
}).catch(() => { })
});
}).catch(() => { });
},
handleRenewAdd(index, row) {
this.$router.push({ path: `${UrlConfig.orderauthor.authorDraft}/renew/${row.id}` });
@ -228,17 +225,17 @@
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload()
this.queryList.reload();
}
},
async handleSource(index, row) {
try {
let res = await getDistribute(row.distributeId);
const res = await getDistribute(row.distributeId);
this.$refs.authorDetail.show(res.data);
} catch (error) {
this.$messageBox(this.$t('tip.requestFailed'));
}
}
}
}
};
</script>

View File

@ -1,7 +1,6 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
@ -64,20 +63,20 @@
title: this.$t('orderAuthor.productType'),
prop: 'productType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']) },
tagType: (row) => { return 'success' }
columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName',
prop: 'mapName'
},
{
title: this.$t('orderAuthor.productName'),
prop: 'prdName',
prop: 'prdName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName',
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.price'),
@ -87,7 +86,7 @@
title: this.$t('orderAuthor.state'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
@ -106,7 +105,7 @@
{
type: 'button',
title: this.$t('global.operate'),
width: '270',
width: this.$i18n.locale == 'en' ? '300': '250',
buttons: [
{
name: this.$t('global.edit'),
@ -132,18 +131,18 @@
{
name: this.$t('global.delete'),
type: 'danger',
handleClick: this.handleDelete,
},
handleClick: this.handleDelete
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd },
{ text: this.$t('global.add'), handler: this.handleAdd }
]
},
currentModel: {}
}
};
},
mounted() {
this.loadInitData();
@ -166,7 +165,7 @@
});
try {
//
let res = await listPublishMap();
const res = await listPublishMap();
res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
});
@ -183,39 +182,39 @@
},
//
handleEfficacy(index, row) {
this.$confirm(this.$t('tip.updateProductTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
this.$confirm(this.$t('tip.updateProductTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
setCommodityStatus(row.id).then(res => {
this.$message.success(this.$t('tip.operationSuccessfully'));
this.reloadTable()
}).catch(err => {
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('tip.operationFailed'));
this.reloadTable()
})
}).catch(() => { })
this.reloadTable();
});
}).catch(() => { });
},
handleDelete(index, row) {
this.$confirm(this.$t('tip.deleteProductTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
this.$confirm(this.$t('tip.deleteProductTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
delCommodity(row.id).then(response => {
this.$message.success(this.$t('tip.successfullyDelete'));
this.reloadTable()
}).catch(error => {
this.reloadTable();
this.$messageBox(this.$t('tip.failDelete'))
})
}).catch(() => { })
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('tip.failDelete'));
});
}).catch(() => { });
},
reloadTable() {
this.queryList.reload()
}
this.queryList.reload();
}
}
};
</script>

View File

@ -1,28 +1,34 @@
<template>
<el-dialog :title="this.$t('orderAuthor.trainingList')" :visible.sync="show" top="20px" width="90%" :before-doClose="doClose"
:close-on-click-modal="false">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<el-dialog
:title="this.$t('orderAuthor.trainingList')"
:visible.sync="show"
top="20px"
width="90%"
:before-do-close="doClose"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { putMapProductOnLine, putMapProductOffLine } from '@/api/jmap/mapdraft';
import { getCommodityList, delCommodity, setCommodityStatus } from '@/api/management/goods';
import { getProductList } from '@/api/management/mapprd';
import { pageQueryTraining } from '@/api/jmap/training';
import { getSkinCodeList } from '@/api/management/mapskin'
import localStore from 'storejs';
import { getCommodityList } from '@/api/management/goods';
import { listPublishMap } from '@/api/jmap/map';
export default {
name: 'addGoods',
name: 'AddGoods',
props: {
trainings: {
type: Array,
default() {
return [];
}
},
detail: {
type: Object,
default() {
return null;
}
}
},
data() {
@ -78,20 +84,20 @@
title: this.$t('orderAuthor.productType'),
prop: 'productType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']) },
tagType: (row) => { return 'success' }
columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName',
prop: 'mapName'
},
{
title: this.$t('orderAuthor.productName'),
prop: 'prdName',
prop: 'prdName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName',
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.price'),
@ -101,7 +107,7 @@
title: this.$t('orderAuthor.state'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
@ -123,10 +129,10 @@
width: '250',
buttons: [
{
name: '选择',
name: this.$t('orderAuthor.select'),
type: 'primary',
handleClick: this.handleAdd
},
}
]
}
],
@ -135,7 +141,7 @@
},
currentModel: {}
}
};
},
created() {
this.loadInitData();
@ -165,7 +171,7 @@
});
try {
//
let res = await listPublishMap();
const res = await listPublishMap();
res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
});
@ -183,7 +189,7 @@
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
}
}
};
</script>

View File

@ -1,6 +1,14 @@
<template>
<el-dialog :title="title" :visible.sync="show" width="360px" :before-close="doClose" :zIndex="2000" :modal="false"
:close-on-click-modal="false" v-dialogDrag>
<el-dialog
v-dialogDrag
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="text-align:center">
<el-radio-group v-model="formModel.canDistribute">
<el-radio :label="true">{{ $t('orderAuthor.publicAuthority') }}</el-radio>
@ -20,11 +28,11 @@
return {
dialogShow: false,
formModel: {
canDistribute: true,
canDistribute: true
},
data: {},
data: {}
}
};
},
computed: {
show() {
@ -50,5 +58,5 @@
this.doClose();
}
}
}
};
</script>

View File

@ -3,46 +3,47 @@
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline"></el-step>
<el-step title="" icon="el-icon-upload"></el-step>
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height -70 + 'px'}"
style="padding-top: 40px">
<data-form class="card-form" ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
<el-scrollbar
wrap-class="scrollbar-wrapper"
:style="{height:height -70 + 'px'}"
style="padding-top: 40px"
>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button type="primary" @click="create" v-if="isAdd" v-loading="loading">{{$t('global.create')}}</el-button>
<el-button type="primary" @click="update" v-if="isEdit" v-loading="loading">{{$t('global.update')}}</el-button>
<el-button type="primary" @click="create" v-if="isReNew" v-loading="loading">{{$t('orderAuthor.renew')}}</el-button>
<el-button v-if="isAdd" v-loading="loading" type="primary" @click="create">{{ $t('global.create') }}</el-button>
<el-button v-if="isEdit" v-loading="loading" type="primary" @click="update">{{ $t('global.update') }}</el-button>
<el-button v-if="isReNew" v-loading="loading" type="primary" @click="create">{{ $t('orderAuthor.renew') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.return') }}</el-button>
</el-button-group>
</div>
</div>
<add-goods ref="addGoods" @selectGoods="selectGoods"></add-goods>
<add-goods ref="addGoods" @selectGoods="selectGoods" />
</div>
</template>
<script>
import { getOrderDetail, createOrder, updateOrder, getOrderCharge } from '@/api/management/order';
import { createOrder, updateOrder, getOrderCharge } from '@/api/management/order';
import { addOrganization, getOrganizationList } from '@/api/management/organization';
import { getGoodsList } from '@/api/management/goods';
import { getSellerList } from '@/api/management/user';
import { validateCharCode } from '@/utils/validate';
import { UrlConfig } from '@/router/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import addGoods from './addGoods';
export default {
name: 'DictionaryDetailEdit',
mixins: [
WindowResizeHandler
],
components: {
addGoods
},
mixins: [
WindowResizeHandler
],
data() {
return {
type: '',
@ -75,7 +76,7 @@
payWays: '01',
payStatus: '02',
startTime: '',
sellerId: '',
sellerId: ''
},
DatePicker: {
shortcuts: [{
@ -99,7 +100,7 @@
}
}]
}
}
};
},
computed: {
// turnbackBarTitle() {
@ -109,7 +110,7 @@
return this.type === 'ADD';
},
isEdit() {
return (this.type === 'EDIT') && !isNaN(Number(this.$route.params.orderId));;
return (this.type === 'EDIT') && !isNaN(Number(this.$route.params.orderId));
},
isReNew() {
return (this.type === 'RENEW') && !isNaN(Number(this.$route.params.orderId));
@ -127,7 +128,7 @@
return !this.formModel.forever && (this.formModel.bizType !== '02'); //
},
isShowMonths() {
return !this.formModel.forever //
return !this.formModel.forever; //
},
isShowContractNo() {
return this.formModel.orderType === '02'; //
@ -145,51 +146,47 @@
return this.formModel.orderType !== '04'; //
},
isDisabled() {
return this.isEdit || this.isReNew
return this.isEdit || this.isReNew;
},
foreverIsDisabled() {
return this.foreverInitData
return this.foreverInitData;
},
payTypeIsDisabled() {
return this.isEdit
return this.isEdit;
},
payStatusDisabled() {
return this.isEdit
return this.isEdit;
},
form() {
let form = {
labelWidth: 'auto',
const form = {
labelWidth: this.$i18n.locale == 'en' ? '200px': '145px',
items: [
{ prop: 'organizationId', label: this.$t('orderAuthor.organizationOrEnterprise'), type: 'select', required: false, disabled: this.isDisabled, options: this.OrganizationList, allowCreate: true, onChange: this.onChange },
// { prop: 'goodsId', label: '', type: 'select', required: false, disabled: this.isDisabled, options: this.goodsList, change: true, onChange: this.selectCommodity },
{ prop: 'goodsName', label: this.$t('orderAuthor.commodityName'), type: 'text', required: false, rightWidth: true, disabled: true, buttontip: this.$t('orderAuthor.chooseGoods'), buttonClick: this.buttonClick },
{ prop: 'price', label: this.$t('orderAuthor.itemPricing'), type: 'number', required: false, disabled: true, min: 0, message: this.$t('global.yuan') },
{ prop: 'goodsName', label: this.$t('orderAuthor.commodityName'), type: 'text', required: false, disabled: true, rightWidth: true, buttontip: '选择商品', buttonClick: this.buttonClick },
{ prop: 'price', label: this.$t('orderAuthor.itemPricing'), type: 'number', required: false, disabled: true, min: 0, message: '元' },
{ prop: 'orderType', label: this.$t('orderAuthor.orderType'), type: 'select', required: false, disabled: this.isDisabled, options: this.OrderTypeList },
{ prop: 'sellerId', label: this.$t('orderAuthor.salesman'), type: 'select', required: false, show: this.isShowSeller, disabled: this.isDisabled, options: this.SellerList },
{ prop: 'contractNo', label: this.$t('orderAuthor.contractNumber'), type: 'text',rightWidth: true, required: false, show: this.isShowContractNo },
{ prop: 'contractNo', label: this.$t('orderAuthor.contractNumber'), type: 'text', required: false, show: this.isShowContractNo },
{ prop: 'amount', label: this.totalTitle, type: 'number', required: false, show: true, min: 0 },
{ prop: 'forever', label: this.$t('orderAuthor.permanenceOrNot'), type: 'radio', required: false, options: this.$ConstSelect.Whether, disabled: this.foreverIsDisabled },
{ prop: 'startTime', label: this.$t('orderAuthor.startDate'), type: 'date', required: false, show: this.isShowStartDate, viewFormat: "yyyy-MM-dd", valueFormat: "yyyy-MM-dd", picker: this.DatePicker },
{ prop: 'monthAmount', label: this.monthsTitle, type: 'number', required: false, show: this.isShowMonths, min: 0, message: this.$t('global.month') },
{ prop: 'totalPrice', label: this.$t('orderAuthor.totalPrice'), type: 'number', required: false, show: this.isShowPrice, min: 0, message: this.$t('global.yuan') },
{ prop: 'startTime', label: this.$t('orderAuthor.startDate'), type: 'date', required: false, show: this.isShowStartDate, viewFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd', picker: this.DatePicker },
{ prop: 'monthAmount', label: this.monthsTitle, type: 'number', required: false, show: this.isShowMonths, min: 0, message: '月' },
{ prop: 'totalPrice', label: this.$t('orderAuthor.totalPrice'), type: 'number', required: false, show: this.isShowPrice, min: 0, message: '元' },
{ prop: 'bizType', label: this.$t('orderAuthor.businessType'), type: 'select', required: false, disabled: true, options: this.BizTypeList },
{ prop: 'payWays', label: this.$t('orderAuthor.paymentMethod'), type: 'select', required: false, disabled: this.payTypeIsDisabled, show: this.isShowPayType, options: this.PayTypeList },
{ prop: 'payStatus', label: this.$t('orderAuthor.paymentStatus'), type: 'select', required: false, disabled: this.payStatusDisabled, show: this.isShowPayStatus, options: this.PayStatusTypeList },
{ prop: 'payStatus', label: this.$t('orderAuthor.paymentStatus'), type: 'select', required: false, disabled: this.payStatusDisabled, show: this.isShowPayStatus, options: this.PayStatusTypeList }
]
};
return form
return form;
},
rules() {
const _this = this;
let baseRules = {
const baseRules = {
organizationId: [
{ required: true, message: this.$t('rules.organizationInput'), trigger: 'blur' }
],
// goodsId: [
// { required: true, message: '', trigger: 'change' }
// ],
goodsName: [
{ required: true, message: this.$t('rules.productSelect'), trigger: 'change' }
],
@ -219,7 +216,7 @@
callback(new Error(_this.$t('rules.authorAmountInputError')));
}
},
trigger: 'blur',
trigger: 'blur'
}
],
totalPrice: [
@ -236,7 +233,7 @@
callback(new Error(_this.$t('rules.totalPriceInputError2')));
}
},
trigger: 'blur',
trigger: 'blur'
}
],
monthAmount: [
@ -249,7 +246,7 @@
callback(new Error(_this.$t('rules.monthAmountInputError')));
}
},
trigger: 'blur',
trigger: 'blur'
}
],
startTime: [
@ -264,7 +261,7 @@
payStatus: [
{ required: true && this.isShowPayStatus, message: this.$t('rules.payStatusSelect'), trigger: 'change' }
]
}
};
//
this.$nextTick(function () {
@ -294,29 +291,29 @@
this.loading = false;
this.goodsList.length = 0;
getGoodsList().then(response => {
let data = response.data;
const data = response.data;
if (data && data.length) {
data.forEach(elem => {
this.goodsList.push({ value: elem.id, label: elem.name, price: elem.price });
})
});
}
});
//
this.OrganizationList.length = 0;
getOrganizationList().then(response => {
let data = response.data;
const data = response.data;
data.forEach(elem => {
this.OrganizationList.push({ value: '' + elem.id, label: elem.name });
});
});
getSellerList().then(response => {
let data = response.data;
const data = response.data;
data.forEach(elem => {
this.SellerList.push({ value: '' + elem.id, label: elem.name });
})
})
});
});
this.$Dictionary.permissionType().then(list => {
this.$convertList(list, this.PermissionTypeList, elem => {
@ -326,19 +323,19 @@
this.$Dictionary.orderType().then(list => {
this.$convertList(list, this.OrderTypeList, elem => {
return elem.code !== '01' //
return elem.code !== '01'; //
});
});
this.$Dictionary.payStatus().then(list => {
this.$convertList(list, this.PayStatusTypeList, elem => {
return elem.code !== '03' //
return elem.code !== '03'; //
});
});
this.$Dictionary.payType().then(list => {
this.$convertList(list, this.PayTypeList, elem => {
return true
return true;
});
});
@ -372,7 +369,7 @@
this.formModel.monthAmount = 0;
this.formModel.contractNo = '';
});
}).catch(error => {
}).catch(() => {
this.$messageBox(this.$t('error.loadingDataFailed'));
});
}
@ -384,7 +381,7 @@
},
loadModelData(data, callback) {
// model
for (let field in this.formModel) {
for (const field in this.formModel) {
if (data && data.hasOwnProperty(field)) {
this.formModel[field] = data[field];
if (field === 'forever') {
@ -398,12 +395,12 @@
},
onChange(input) {
// List,,
let list = this.OrganizationList
for (let i in list) {
const list = this.OrganizationList;
for (const i in list) {
if (list[i].value === input) {
return;
}
};
}
// ,List,,
this.$confirm(this.$t('tip.addOrganizationPrefix') + input + this.$t('tip.addOrganizationSuffix'), this.$t('tip.hint'), {
@ -413,9 +410,9 @@
}).then(() => {
addOrganization({ name: input }).then(response => {
this.OrgzList.push(response.data);
}).catch(error => {
}).catch(() => {
this.$messageBox(this.$t('error.addingFailure'));
})
});
}).catch(() => {
this.formModel.organizationId = '';
this.$message.info(this.$t('error.cancelled'));
@ -426,7 +423,7 @@
if (v.value == data) {
this.formModel.price = v.price;
}
})
});
},
buildModel() {
// ,
@ -441,7 +438,7 @@
}
//
let model = {
const model = {
organizationId: orgzId,
goodsId: this.formModel.goodsId,
orderType: this.formModel.orderType,
@ -449,11 +446,11 @@
// permissionType: this.formModel.permissionType,
forever: this.formModel.forever,
bizType: this.formModel.bizType,
price: this.formModel.price,
price: this.formModel.price
// monthAmount: this.formModel.monthAmount,
// startTime: this.formModel.startTime,
// payWays: this.formModel.payWays,
}
};
// ,model
if (this.isShowContractNo) { model.contractNo = this.formModel.contractNo; }
@ -482,7 +479,7 @@
this.turnback();
this.loading = false;
this.$message.success(this.$t('tip.creatingSuccessful'));
}).catch(error => {
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('tip.creatingFailed'));
});
@ -495,17 +492,17 @@
this.turnback();
this.loading = false;
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(error => {
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('tip.updateFailed'))
this.$messageBox(this.$t('tip.updateFailed'));
});
});
})
},
turnback() {
this.$router.go(-1)
}
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@ -534,7 +531,7 @@
/deep/ {
.el-select {
float: left;
width: calc(600px);
width: calc(500px);
}
.el-input-number {

View File

@ -1,14 +1,13 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<can-distribute ref="canDistribute" @distribute="distribute"></can-distribute>
<qr-code ref="qrCode"></qr-code>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<can-distribute ref="canDistribute" @distribute="distribute" />
<qr-code ref="qrCode" />
</div>
</template>
<script>
import { getOrderPageList, giveOrder } from '@/api/management/order';
import { getOrderPageList } from '@/api/management/order';
import { getSellerList } from '@/api/management/user';
import { getOrganizationList } from '@/api/management/organization';
import { giveLessons } from '@/api/management/distribute';
@ -51,7 +50,7 @@
},
'userName': {
type: 'text',
label: this.$t('orderAuthor.userName'),
label: this.$t('orderAuthor.userName')
},
'permissionType': {
type: 'select',
@ -71,8 +70,8 @@
title: this.$t('orderAuthor.organizationOrEnterprise'),
prop: 'organizationName',
type: 'tag',
columnValue: (row) => { return row.organizationName },
tagType: (row) => { return '' }
columnValue: (row) => { return row.organizationName; },
tagType: (row) => { return ''; }
},
{
title: this.$t('orderAuthor.userName'),
@ -80,14 +79,14 @@
},
{
title: this.$t('orderAuthor.commodityName'),
prop: 'goodsName',
prop: 'goodsName'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
tagType: (row) => { return '' }
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('orderAuthor.permissionNumber'),
@ -97,7 +96,7 @@
title: this.$t('orderAuthor.permanenceOrNot'),
prop: 'forever',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether') },
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
return row.forever ? 'success' : 'danger';
}
@ -120,8 +119,8 @@
title: this.$t('orderAuthor.paymentMethod'),
prop: 'payWays',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.payWays, this.PayTypeList, ['value', 'label']) },
tagType: (row) => { return 'success' }
columnValue: (row) => { return this.$convertField(row.payWays, this.PayTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('orderAuthor.creationDate'),
@ -131,8 +130,8 @@
title: this.$t('orderAuthor.orderType'),
prop: 'orderType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.orderType, this.OrderTypeList, ['value', 'label']) },
tagType: (row) => { return 'success' }
columnValue: (row) => { return this.$convertField(row.orderType, this.OrderTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('orderAuthor.contractNumber'),
@ -142,14 +141,14 @@
title: this.$t('orderAuthor.businessType'),
prop: 'bizType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.bizType, this.BizTypeList, ['value', 'label']) },
tagType: (row) => { return 'success' }
columnValue: (row) => { return this.$convertField(row.bizType, this.BizTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('orderAuthor.paymentStatus'),
prop: 'payStatus',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.payStatus, this.PayStatusList, ['value', 'label']) },
columnValue: (row) => { return this.$convertField(row.payStatus, this.PayStatusList, ['value', 'label']); },
tagType: (row) => {
switch (row.payStatus) {
case '01': return 'danger';
@ -162,8 +161,8 @@
title: this.$t('orderAuthor.salesman'),
prop: 'sellerName',
type: 'tag',
columnValue: (row) => { return row.sellerName },
tagType: (row) => { return 'success' }
columnValue: (row) => { return row.sellerName; },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
@ -176,24 +175,24 @@
},
{
name: this.$t('orderAuthor.obtainQrCode'),
type: "warning",
type: 'warning',
handleClick: this.handleCanDistribute,
showControl: (row) => { return row.bizType !== '02' && row.orderType !== '01' && row.qrCodeGenerated }
showControl: (row) => { return row.bizType !== '02' && row.orderType !== '01' && row.qrCodeGenerated; }
},
{
name: this.$t('orderAuthor.generatingQRCode'),
type: "warning",
type: 'warning',
handleClick: this.handleCanDistribute,
showControl: (row) => { return row.bizType !== '02' && row.orderType !== '01' && !row.qrCodeGenerated }
},
showControl: (row) => { return row.bizType !== '02' && row.orderType !== '01' && !row.qrCodeGenerated; }
}
]
},
}
],
actions: [
{ text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleNormalAdd },
{ text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleNormalAdd }
]
}
}
};
},
created() {
this.loadInitData();
@ -210,38 +209,37 @@
getSellerList().then(response => {
this.SellerList = response.data;
})
});
this.$Dictionary.bizType().then(list => {
this.$convertList(list, this.BizTypeList, elem => {
return true;
});
})
});
this.$Dictionary.orderType().then(list => {
this.$convertList(list, this.OrderTypeList, elem => {
return true;
});
})
});
this.$Dictionary.payType().then(list => {
this.$convertList(list, this.PayTypeList, elem => {
return true;
});
})
});
this.$Dictionary.payStatus().then(list => {
this.$convertList(list, this.PayStatusList, elem => {
return true;
});
})
});
this.$Dictionary.effectiveType().then(list => {
this.$convertList(list, this.EffectiveTypeList, elem => {
return true;
});
})
});
this.$Dictionary.permissionType().then(list => {
list.forEach(elem => {
@ -250,13 +248,13 @@
this.$convertList(list, this.PermissionTypeList, elem => {
return true;
});
})
});
},
queryFunction(params) {
return getOrderPageList(params);
},
handleNormalAdd() {
this.$router.push({ path: `${UrlConfig.orderauthor.orderDraft}/add/0` })
this.$router.push({ path: `${UrlConfig.orderauthor.orderDraft}/add/0` });
},
handleEdit(index, data) {
this.$alert('功能待开发', this.$t('tip.hint'), {
@ -274,11 +272,11 @@
}
},
distribute(data) {
let model = {
const model = {
amount: data.amount,
forever: data.forever,
orderCode: data.code,
startTime: data.startTime + " 00:00:00",
startTime: data.startTime + ' 00:00:00',
monthAmount: data.monthAmount,
canDistribute: data.canDistribute,
operator: OperatorModel.TRANSFER,
@ -287,7 +285,7 @@
mapProductCode: data.mapProductCode || '',
permissionType: data.permissionType,
organizationId: data.organizationId
}
};
giveLessons(model).then(response => {
this.reloadTable();
@ -298,15 +296,15 @@
});
}
}).catch(error => {
}).catch(() => {
this.$messageBox(this.$t('error.transferredQRCodeFailed'));
});
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload()
}
this.queryList.reload();
}
}
}
};
</script>

View File

@ -1,7 +1,6 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.return') }}</el-button>
@ -11,9 +10,7 @@
</template>
<script>
import { superAdmin } from '@/router';
import { listPackagePermission, restorePackagePermission, getPermissionPackageDetail } from '@/api/management/distribute';
import { UrlConfig } from '@/router/index';
import { getPermissionPackageDetail } from '@/api/management/distribute';
export default {
name: 'TrainsferDetail',
@ -60,28 +57,28 @@
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName',
prop: 'mapName'
},
{
title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName',
prop: 'mapProductName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName',
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
tagType: (row) => { return '' }
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList') },
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
tagType: (row) => {
switch (row.canDistribute) {
case true: return 'success';
@ -93,7 +90,7 @@
title: this.$t('orderAuthor.permanenceOrNot'),
prop: 'forever',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether') },
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
@ -118,7 +115,7 @@
title: this.$t('orderAuthor.courseAuthorityStatus'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
@ -128,7 +125,7 @@
}
]
}
}
};
},
mounted() {
this.loadInitData();
@ -150,25 +147,23 @@
});
},
formatterDate(row, porpInfo) {
if (row.hasOwnProperty(porpInfo.property)) {
}
return row[porpInfo.property];
},
queryFunction(params) {
// if (params.permissionType) {
return getPermissionPackageDetail(this.$route.params.permissionId, params)
return getPermissionPackageDetail(this.$route.params.permissionId, params);
// }
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload()
this.queryList.reload();
}
},
turnback() {
this.$router.go(-1)
}
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {

View File

@ -1,27 +1,40 @@
<template>
<el-dialog :title="title" :visible.sync="show" top="20px" width="90%" :before-close="doClose"
:close-on-click-modal="false">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<el-dialog
:title="title"
:visible.sync="show"
top="20px"
width="90%"
:before-close="doClose"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { listCanPackagePermission } from '@/api/management/distribute';
import { UrlConfig } from '@/router/index';
export default {
name: 'author',
name: 'Author',
props: {
ruleList: {
type: Array
},
EffectiveTypeList: {
type: Array,
default() {
return [];
}
},
PermissionTypeList: {
type: Array
effectiveTypeList: {
type: Array,
default() {
return [];
}
},
permissionTypeList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
@ -70,28 +83,28 @@
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName',
prop: 'mapName'
},
{
title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName',
prop: 'mapProductName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName',
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
tagType: (row) => { return '' }
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList') },
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
tagType: (row) => {
switch (row.canDistribute) {
case true: return 'success';
@ -103,7 +116,7 @@
title: this.$t('orderAuthor.permanenceOrNot'),
prop: 'forever',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether') },
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
@ -141,18 +154,23 @@
name: this.$t('global.add'),
handleClick: this.handlePut,
type: '',
showControl: (row) => { return !row.isPut && row.permissionType }
showControl: (row) => { return !row.isPut && row.permissionType; }
},
{
name: this.$t('global.delete'),
handleClick: this.handlePop,
type: 'warning',
showControl: (row) => { return row.isPut && row.permissionType }
showControl: (row) => { return row.isPut && row.permissionType; }
}
]
}
]
}
};
},
]
}
]
}
computed: {
title() {
return this.$t('orderAuthor.editPermissionRules');
}
},
watch: {
@ -162,11 +180,6 @@
}
}
},
computed: {
title() {
return this.$t('orderAuthor.editPermissionRules');
}
},
mounted() {
this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList;
},
@ -175,24 +188,24 @@
return String(row[porpInfo.property] || '').split(' ')[0];
},
async queryFunction(params) {
let resp = await listCanPackagePermission(params);
const resp = await listCanPackagePermission(params);
this.ruleList.forEach(elem => {
resp.data.list.forEach(item => {
if (item.id == elem.id) {
item.isPut = true;
}
})
});
});
return resp;
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload()
this.queryList.reload();
}
},
doShow() {
this.show = true
this.show = true;
},
doClose() {
this.show = false;
@ -204,5 +217,5 @@
this.$emit('deleteForm', index, row);
}
}
}
};
</script>

View File

@ -1,8 +1,7 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<qr-code ref="qrCode"></qr-code>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<qr-code ref="qrCode" />
</div>
</template>
@ -10,10 +9,10 @@
import { superAdmin } from '@/router';
import { listPackagePermission, restorePackagePermission, getPackageQrCode, permissionDistributeUnPackage } from '@/api/management/distribute';
import { UrlConfig } from '@/router/index';
import QrCode from "@/components/QrCode";
import QrCode from '@/components/QrCode';
export default {
name: 'author',
name: 'Author',
components: {
QrCode
},
@ -73,28 +72,28 @@
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName',
prop: 'mapName'
},
{
title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName',
prop: 'mapProductName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName',
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
tagType: (row) => { return '' }
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList') },
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
tagType: (row) => {
switch (row.canDistribute) {
case true: return 'success';
@ -106,7 +105,7 @@
title: this.$t('orderAuthor.permanenceOrNot'),
prop: 'forever',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether') },
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
@ -131,7 +130,7 @@
title: this.$t('orderAuthor.authorityStatus'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
@ -142,41 +141,41 @@
{
type: 'button',
title: this.$t('global.operate'),
width: '300',
width: this.$i18n.locale == 'en' ? '370': '300',
hide: (row) => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [
{
name: this.$t('orderAuthor.obtainQrCode'),
handleClick: this.handleRtCodeShow,
type: '',
showControl: (row) => { return true }
showControl: (row) => { return true; }
},
{
name: this.$t('orderAuthor.authorityDetails'),
handleClick: this.handlePermissionDetail,
type: '',
showControl: (row) => { return row.status == '1' && (row.source == '02' || row.source == '04') }
showControl: (row) => { return row.status == '1' && (row.source == '02' || row.source == '04'); }
},
{
name: this.$t('orderAuthor.recovery'),
handleClick: this.handleRestore,
type: 'danger',
showControl: (row) => { return row.status == '1' && row.source == '04' }
showControl: (row) => { return row.status == '1' && row.source == '04'; }
},
{
name: this.$t('orderAuthor.unpacking'),
handleClick: this.handleUnPackage,
type: 'danger',
showControl: (row) => { return row.status == '1' && row.source == '02' }
showControl: (row) => { return row.status == '1' && row.source == '02'; }
}
]
}
],
actions: [
{ text: this.$t('orderAuthor.privilegePackaging'), btnCode: 'employee_insert', handler: this.handlePackage },
{ text: this.$t('orderAuthor.privilegePackaging'), btnCode: 'employee_insert', handler: this.handlePackage }
]
}
}
};
},
mounted() {
@ -187,7 +186,7 @@
this.$Dictionary.effectiveType().then(list => {
list.forEach(elem => {
this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name });
})
});
this.$convertList(list, this.EffectiveTypeList, elem => {
return true;
});
@ -203,8 +202,6 @@
});
},
formatterDate(row, porpInfo) {
if (row.hasOwnProperty(porpInfo.property)) {
}
return row[porpInfo.property];
},
queryFunction(params) {
@ -212,11 +209,11 @@
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload()
this.queryList.reload();
}
},
handlePermissionDetail(index, row) {
this.$router.push({ path: `${UrlConfig.orderauthor.transferDetail}/${row.id}` })
this.$router.push({ path: `${UrlConfig.orderauthor.transferDetail}/${row.id}` });
},
handleRtCodeShow(index, row) {
getPackageQrCode({ id: row.id }).then(resp => {
@ -224,41 +221,41 @@
url: resp.data,
title: this.$t('orderAuthor.privilegeTransferQRCode')
});
}).catch(error => {
}).catch(() => {
this.$messageBox(this.$t('tip.getQRCodeFailure'));
})
});
},
handleRestore(index, row) {
this.$confirm(this.$t('tip.recoveryPrivilegeTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
this.$confirm(this.$t('tip.recoveryPrivilegeTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
restorePackagePermission(row.id).then(resp => {
this.reloadTable();
this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
}).catch(error => {
}).catch(() => {
this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
})
});
}).catch(() => { });
},
handleUnPackage(index, row) {
this.$confirm(this.$t('tip.unpackingTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
this.$confirm(this.$t('tip.unpackingTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
permissionDistributeUnPackage(row.id).then(resp => {
this.reloadTable();
this.$message.success(this.$t('tip.unpackingSuccessful'));
}).catch(error => {
}).catch(() => {
this.$messageBox(this.$t('tip.unpackingFailed'));
})
});
}).catch(() => { });
},
handlePackage() {
this.$router.push({ path: `${UrlConfig.orderauthor.trainferPackage}` })
}
this.$router.push({ path: `${UrlConfig.orderauthor.trainferPackage}` });
}
}
};
</script>