This commit is contained in:
joylink_cuiweidong 2019-11-25 15:57:23 +08:00
commit f04eb49964
6 changed files with 138 additions and 10 deletions

View File

@ -319,10 +319,18 @@ const map = {
return state.map;
},
psdList: (state) => {
return state.map.psdList;
if (state.map) {
return state.map.psdList;
} else {
return [];
}
},
espList: (state) => {
return state.map.espList;
if (state.map) {
return state.map.espList;
} else {
return [];
}
},
lineCode: (state) => {
if (state.map && state.map.skinVO) {

View File

@ -3,8 +3,8 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康

View File

@ -0,0 +1,113 @@
<template>
<el-dialog v-dialogDrag :title="this.$t('orderAuthor.oneClickGenerationPermission')" :visible.sync="dialogShow" width="500px" :before-close="handleClose">
<div>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="saveAs">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { updataCommodityList } from '@/api/management/goods';
export default {
name: 'Edit',
data() {
return {
dialogShow: false,
loading: false,
formModel: {
id: '',
name: '',
price: 0,
remarks: ''
}
};
},
computed: {
form() {
return {
labelWidth: '110px',
items: [
{ prop: 'name', label: this.$t('orderAuthor.commodityName') + ':', type: 'text', required: false },
{ prop: 'price', label: this.$t('orderAuthor.price') + ':', type: 'number', required: false, min: 0.01, message: this.$t('global.yuan') },
{ prop: 'remarks', label: this.$t('orderAuthor.describtion') + ':', type: 'textarea', required: false }
]
};
},
rules() {
return {
name: [
{ required: true, message: this.$t('rules.goodsNameInput'), trigger: 'blur' }
],
price: [
{ required: true, message: this.$t('rules.totalPriceInput'), trigger: 'change' },
{
validator(rule, value, callback) {
if (Number(value) >= 0) {
if (String(value).split('.')[1] && String(value).split('.')[1].length > 2) {
callback(new Error(this.$t('rules.totalPriceInputError1')));
} else {
callback();
}
} else {
callback(new Error(this.$t('rules.totalPriceInputError2')));
}
},
trigger: 'blur'
}
]
};
}
},
methods: {
doShow(data) {
this.dialogShow = true;
this.formModel = {
id: data.id,
name: data.name,
price: data.price,
remarks: data.remarks
};
},
close() {
this.formModel = {
id: '',
name: '',
price: 0,
remarks: ''
};
this.dialogShow = false;
this.loading = false;
},
handleClose() {
this.$emit('reloadTable');
this.close();
},
buildModel() { //
return {
id: this.formModel.id,
name: this.formModel.name,
price: this.formModel.price,
remarks: this.formModel.remarks
};
},
saveAs() {
this.$refs.dataform.validateForm(() => {
this.loading = true;
updataCommodityList(this.buildModel()).then(response => {
this.$message.success(this.$t('tip.updateSuccessfully'));
this.handleClose();
}).catch(() => {
this.$messageBox(this.$t('tip.updateFailed'));
this.handleClose();
});
});
}
}
};
</script>

View File

@ -1,18 +1,24 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit ref="edit" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { getCommodityList, delCommodity, setCommodityStatus } from '@/api/management/goods';
import { UrlConfig } from '@/router/index';
import Edit from './edit';
export default {
name: 'Dictionary',
components: {
Edit
},
data() {
return {
EffectiveTypeList: [],
dataInfo: {},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
@ -125,7 +131,8 @@ export default {
});
},
handleEdit(index, row) {
this.$router.push({ path: `${UrlConfig.orderauthor.commodityDraft}/edit/${row.id}` });
// this.$router.push({ path: `${UrlConfig.orderauthor.commodityDraft}/edit/${row.id}` });
this.$refs.edit.doShow(row);
},
handleAdd() {

View File

@ -254,14 +254,14 @@ export default {
});
return name;
},
deleteForm(index, row) {
deleteForm(index, row) { //
const idx = this.ruleList.findIndex(elem => { return elem.id == row.id; });
if (idx >= 0) {
row['isPut'] = false;
this.ruleList.splice(idx, 1);
}
},
addRuleForm(index, row) {
addRuleForm(index, row) { //
row['isPut'] = true;
getPermissionGoods(row.id).then(res => {
if (res.data.length) {
@ -270,8 +270,8 @@ export default {
row.goods = res.data[0];
}
}
this.ruleList.push(row);
});
this.ruleList.push(row);
},
dialogSelect(row) {
if (this.addModel.mapId) {

View File

@ -20,7 +20,7 @@
<span style="width: 190px; float: left;">{{ $t('publish.allNumberTipOne') }} {{ topicNum }} {{ $t('publish.allNumberTipTwo') }}</span>
</el-form-item>
<el-form-item :label="$t('publish.scorePerQuestion')" prop="mark">
<el-input v-model="form.mark" placeholder="" style="width:240px" />
<el-input-number v-model="form.mark" :precision="0" style="width:200px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -81,7 +81,7 @@ export default {
course: '',
operateType: '',
number: '',
mark: ''
mark: 0
},
topicNum: 0,
dialogShow: false,