现在,有这么一个界面,最后操作一栏有个跟进按钮,点击跟进显示此条信息的跟进信息。
跟进按钮传入这一条数据信息record
<a @click="handleOpinion(record)" v-if="record.status==1"><a-divider type="vertical"/>跟进</a>
<l-intelligence-opinion-list ref="LIntelligenceOpinionList"></l-intelligence-opinion-list>
import LIntelligenceOpinionList from './LIntelligenceOpinionList'
export default {
components: {
LIntelligenceOpinionList,
},
methods: {
handleOpinion(record){
this.$refs.LIntelligenceOpinionList.showList(record);
},
}
显示信息界面的查询条件
data () {
return {
title:"操作",
visible: false,
model: {},
parentId: '',
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
},
url: {
add: "/system/lintelligenceopinion/add",
edit: "/system/lintelligenceopinion/edit",
},
}
},
created () {
},
methods: {
add (record) {
this.parentId = record.id;
this.edit({});
},
edit (record) {
console.log(record)
if (typeof (record.parentId) != 'undefined') {
this.parentId = record.parentId
}
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
if(this.model.userId == null){
this.$nextTick(() => {
this.form.setFieldsValue({userId: this.$store.getters.userInfo.id})
this.form.setFieldsValue({createTime: new Date()? moment(this.model.createTime):null})
});
}else {
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'userId_dictText','opinion','createBy','updateBy'))
this.form.setFieldsValue({createTime: this.model.createTime ? moment(this.model.createTime):null})
this.form.setFieldsValue({updateTime: this.model.updateTime ? moment(this.model.updateTime):null})
});
}
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
let formData = Object.assign(this.model, values);
formData.parentId = this.parentId;
formData.createTime = formData.createTime?formData.createTime.format('YYYY-MM-DD HH:mm:ss'):null;
console.log(formData)
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.error(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}
})
},
handleCancel () {
this.close()
},
}
|