Browse Source

修改编辑进入模板信息页面相关交互

clientSet-zq-1128
zq 4 days ago
parent
commit
583f4a8221
  1. 89
      src/views/super/clientSet/coverInfoPage.vue
  2. 2
      src/views/super/paiban/tpl.vue

89
src/views/super/clientSet/coverInfoPage.vue

@ -4,10 +4,10 @@
<div class="client_flex-common flex-common" id=""> <div class="client_flex-common flex-common" id="">
<div class="before_h_title mb24">基本信息</div> <div class="before_h_title mb24">基本信息</div>
<el-form :model="coverInfo" ref="baseInfoRef"> <el-form :model="coverInfo" ref="baseInfoRef">
<GuipInput v-model="coverInfo.school_name" :client-form-flex="true" label="所属学校" width="356px" /> <GuipInput v-model="coverInfo.school" :client-form-flex="true" label="所属学校" width="356px" />
<GuipRadio :options="collegeList" v-model="coverInfo.college" :client-form-flex="true" label="学院" /> <GuipRadio :options="collegeList" v-model="coverInfo.college" :client-form-flex="true" label="学院" />
<GuipInput v-model="coverInfo.college_name" label="学院名称" :client-form-flex="true" width="356px" /> <GuipInput v-model="coverInfo.college_name" label="学院名称" :client-form-flex="true" width="356px" />
<GuipRadio :options="qualificationList" v-model="coverInfo.qualification" label="学历" :client-form-flex="true" /> <GuipRadio :options="qualificationList" v-model="coverInfo.degree" label="学历" :client-form-flex="true" />
<GroupFormBtns cancelText="重置" @cancel="cancelClick('baseInfoRef')" flex="start" <GroupFormBtns cancelText="重置" @cancel="cancelClick('baseInfoRef')" flex="start"
@confirm="submitCoverInfo" /> @confirm="submitCoverInfo" />
</el-form> </el-form>
@ -68,68 +68,80 @@ export default {
collegeList: [// collegeList: [//
{ {
label: '通用', label: '通用',
value: 1 value: '0'
}, },
{ {
label: '专用', label: '专用',
value: 2 value: '1'
} }
], ],
qualificationList: [// qualificationList: [//
{ {
label: '专科', label: '专科',
value: 1 value: '1'
}, },
{ {
label: '本科', label: '本科',
value: 2 value: '2'
}, },
{ {
label: '硕士', label: '硕士',
value: 3 value: '3'
}, },
{ {
label: '博士', label: '博士',
value: 4 value: '4'
}, },
{ {
label: '继续教育', label: '继续教育',
value: 5 value: '5'
}, },
], ],
formData: new FormData(), formData: new FormData(),
editInfo:{},//
template_id: '',//id
}; };
}, },
mounted() { mounted() {
const editInfo = JSON.parse(localStorage.getItem('curtplInfo')) || '';
this.editInfo = this.coverInfo = editInfo;
this.coverInfo = {
school:editInfo.school_name,
college:editInfo.college_id,
college_name:editInfo.college_name,
degree:editInfo.degree_id,
// qrcode_path:editInfo.cover_img
}
this.template_id = editInfo.id;
this.getCoverInfo(); this.getCoverInfo();
}, },
methods: { methods: {
async getCoverInfo(){ async getCoverInfo(){
this.$http('POST', '/supernew/ajax_get_paiban_template_list', {}, { // this.$http('POST', '/supernew/ajax_get_paiban_template_list', {}, {
}).then(response => { // }).then(response => {
console.log(response,'=======999'); // console.log(response,'=======999');
this.$nextTick(() => { // this.$nextTick(() => {
if (response.status) { // if (response.status) {
this.$Message.success(response.info); // this.$Message.success(response.info);
} else { // } else {
this.$Message.error(response.info); // this.$Message.error(response.info);
} // }
}) // })
}).catch(error => { // }).catch(error => {
console.error(error, 'error') // console.error(error, 'error')
}) // })
}, },
cancelClick(formName) { cancelClick(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
}, },
// //
submitCoverInfo() { submitCoverInfo() {
console.log(this.coverInfo,'coverInfo信息'); console.log(this.coverInfo,'coverInfo信息');
this.$refs['baseInfoRef'].validate((valid) => { this.$refs['baseInfoRef'].validate((valid) => {
if (valid) { if (valid) {
console.log('submit!'); console.log('submit!');
this.handleConfirmRefuse() this.handleConfirmConfirm()
} else { } else {
return false; return false;
@ -137,9 +149,15 @@ export default {
}); });
}, },
handleQQkfChange(file, fileList) {
console.log(file, fileList)
let fileObj = file.raw
this.formData.set('file', fileObj)
},
// //
uploadCoverTpl() { uploadCoverTpl() {
this.formData.set('template_id', '1') this.formData.set('template_id',this.template_id)
this.$http('POST', '/supernew/upload_paiban_template_cover', this.formData).then(response => { this.$http('POST', '/supernew/upload_paiban_template_cover', this.formData).then(response => {
this.$nextTick(() => { this.$nextTick(() => {
if (response.status) { if (response.status) {
@ -154,15 +172,16 @@ export default {
}, },
// //
handleConfirmConfirm(){ handleConfirmConfirm(){
// let props={ let props={
// template_id, school: this.coverInfo.school,
// school, college: this.coverInfo.college,
// college, degree: this.coverInfo.degree,
// degree //
// } }
try { try {
this.$http('POST', '/supernew/ajax_update_paiban_template_info', { this.$http('POST', '/supernew/ajax_update_paiban_template_info', {
...this.coverInfo ...props,
template_id: this.template_id
}).then(response => { }).then(response => {
this.$nextTick(() => { this.$nextTick(() => {
if (response.status) { if (response.status) {
@ -179,12 +198,6 @@ export default {
console.error('数据加载失败:', error) console.error('数据加载失败:', error)
} }
}, },
handleQQkfChange(file, fileList) {
console.log(file, fileList)
let fileObj = file.raw
this.formData.set('file', fileObj)
},
submitFun() { submitFun() {
// let props = { // let props = {
// configdata, // configdata,

2
src/views/super/paiban/tpl.vue

@ -142,7 +142,7 @@ export default {
jumpEdit(item){ jumpEdit(item){
// localStorage // localStorage
// localStorage.setItem('tpl_id', item.id) // localStorage.setItem('tpl_id', item.id)
localStorage.setItem('tplInfo', item) localStorage.setItem('curtplInfo', JSON.stringify(item))
// //
this.$router.push({ this.$router.push({
path: '/super/clientSet/coverInfoPage', path: '/super/clientSet/coverInfoPage',

Loading…
Cancel
Save