Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
caoyizhong 2 years ago
parent
commit
848a957e3d
  1. 4
      src/views/accessrecords/statement/ProcessMaterialWarehousingStatement.vue
  2. 5
      src/views/accessrecords/statement/ProcessMaterialsPlanStatement.vue
  3. 4
      src/views/accessrecords/statement/ProcessMaterialsPlanStatement2.vue
  4. 1
      src/views/activiti/form/ProcessPermissionAuthorization.vue
  5. 134
      src/views/activiti/form/ProcessPermissionAuthorizationForm.vue

4
src/views/accessrecords/statement/ProcessMaterialWarehousingStatement.vue

@ -99,7 +99,7 @@
// //
downWord() { downWord() {
downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => { downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => {
if (!data) { if (!data.size>0) {
this.$message.warning("文件下载失败") this.$message.warning("文件下载失败")
return return
} }
@ -116,7 +116,7 @@
}, },
previewWord() { previewWord() {
downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => { downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => {
if (!data) { if (!data.size>0) {
this.$message.warning("文件预览失败") this.$message.warning("文件预览失败")
return return
} }

5
src/views/accessrecords/statement/ProcessMaterialsPlanStatement.vue

@ -97,7 +97,7 @@
// //
downWord() { downWord() {
downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => { downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => {
if (!data) { if (!data.size>0) {
this.$message.warning("文件下载失败") this.$message.warning("文件下载失败")
return return
} }
@ -114,14 +114,13 @@
}, },
previewWord() { previewWord() {
downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => { downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => {
if (!data) { if (!data.size>0) {
this.$message.warning("文件预览失败") this.$message.warning("文件预览失败")
return return
} }
console.log(data) console.log(data)
const blob = new Blob([data], { type: 'application/pdf' }) const blob = new Blob([data], { type: 'application/pdf' })
this.pdfSrc = window.URL.createObjectURL(blob) this.pdfSrc = window.URL.createObjectURL(blob)
console.log(this.pdfSrc)
window.open(this.pdfSrc)// window.open(this.pdfSrc)//
}) })
}, },

4
src/views/accessrecords/statement/ProcessMaterialsPlanStatement2.vue

@ -99,7 +99,7 @@
// //
downWord() { downWord() {
downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => { downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => {
if (!data) { if (!data.size>0) {
this.$message.warning("文件下载失败") this.$message.warning("文件下载失败")
return return
} }
@ -116,7 +116,7 @@
}, },
previewWord() { previewWord() {
downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => { downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => {
if (!data) { if (!data.size>0) {
this.$message.warning("文件预览失败") this.$message.warning("文件预览失败")
return return
} }

1
src/views/activiti/form/ProcessPermissionAuthorization.vue

@ -28,7 +28,6 @@
components: { ProcessPermissionAuthorizationForm, historicPictrue, historicDetail }, components: { ProcessPermissionAuthorizationForm, historicPictrue, historicDetail },
data() { data() {
return { return {
isNew: ''
} }
}, },
props: { props: {

134
src/views/activiti/form/ProcessPermissionAuthorizationForm.vue

@ -218,6 +218,7 @@
let company = sessionStorage.getItem("PARENT_ID"); let company = sessionStorage.getItem("PARENT_ID");
let userInfo=sessionStorage.getItem("USER_INFORMATION"); let userInfo=sessionStorage.getItem("USER_INFORMATION");
console.log(this.isNew,"++++++++++++++++++")
if (!this.isNew){ if (!this.isNew){
this.init(); this.init();
}else { }else {
@ -240,7 +241,7 @@
let formData = res.result; let formData = res.result;
formData.tableName = r.tableName; formData.tableName = r.tableName;
this.data = formData; this.data = formData;
console.log("表单回显数据",this.data) console.log("表单回显数据-----------",this.data)
this.editAfter(); this.editAfter();
this.btndisabled = false; this.btndisabled = false;
}else { }else {
@ -251,7 +252,7 @@
add () { add () {
this.edit({}); this.edit({});
}, },
edit (record) { editAfter (record) {
this.form.resetFields(); this.form.resetFields();
this.model = Object.assign({}, record); this.model = Object.assign({}, record);
this.visible = true; this.visible = true;
@ -260,8 +261,9 @@
this.data = getRecord(this.data) this.data = getRecord(this.data)
} }
console.log(this.data,"89898989")
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.data,'company','createTime','departId','createBy','authorizationPerson','authorizedPerson','privilegedTimeStart','privilegedTimeEnd','continueAuthorize','privilegedAffirmedTime','authorizationNumberDays','fileId','opinion')) this.form.setFieldsValue(pick(this.data,'id','company','createTime','departId','createBy','authorizationPerson','authorizedPerson','privilegedTimeStart','privilegedTimeEnd','continueAuthorize','privilegedAffirmedTime','authorizationNumberDays','fileId','opinion'))
}) })
}, },
close() { close() {
@ -289,74 +291,51 @@
}, },
/*提交申请*/ /*提交申请*/
applySubmit(e) { applySubmit(e) {
this.getAllTable().then(tables => { const that = this;
return validateFormAndTables(this.form, tables) //
}).then(allValues=>{ this.form.validateFields((err, values) => {
if (typeof this.classifyIntoFormData !== 'function') { if (!err) {
throw this.throwNotFunction('classifyIntoFormData') let httpurl = '';
} let method = '';
let formData = this.classifyIntoFormData(allValues) let formData = Object.assign(this.model, values);
// formData.procDefId = this.processData.id;
for (let i = 0; i < formData.processUdgetPlanMaterialList.length; i++) { formData.procDeTitle = this.processData.name;
this.materialAmount=this.materialAmount+ formData.processUdgetPlanMaterialList[i].materialAmount; formData.title=this.processData.description;
if (i==0){ formData.fileId = getStringArry(formData.fileId)
this.describes=formData.processUdgetPlanMaterialList[i].materialName if (!formData.tableName)formData.tableName = this.processData.businessTable;
}else { if(!formData.id){
this.describes=this.describes+"---"+formData.processUdgetPlanMaterialList[i].materialName httpurl+=this.url.addAuthorizationApply;
method = 'post';
}else{
httpurl+=this.url.editAuthorizationApply;
method = 'put';
formData.assignees = this.assignees
formData.tableName = this.processData.tableName
formData.procDefId = this.processData.procDefId
formData.procDeTitle = this.processData.processName
formData.title = this.processData.title
formData.processInstanceId = this.processData.id
} }
console.log('格式化后的数据---',method)
} console.log("表单提交数据",formData)
formData.fileId = getStringArry(formData.fileId) if (new Date(formData.privilegedTimeStart).getTime()/100>=new Date(formData.privilegedTimeEnd).getTime()/100){
formData.materialPrice=this.materialPrice; this.$message.error("授权开始时间不能大于授权结束时间")
formData.materialAmount=this.materialAmount; return;
formData.describes=this.describes; }
if (new Date(formData.createTime).getTime()/100>new Date(formData.needTime).getTime()/100){ this.btndisabled = true;
this.$message.error("需求时间不能小于当前流程发起时间") httpAction(httpurl,formData,method).then((res)=>{
return; if(res.success){
this.$emit('loadData')
this.close();
}else{
that.$message.warning(res.message);
}
}).finally(() => {
this.btndisabled = false;
})
} }
console.log(this.materialAmount,'采购总价')
console.log(this.opinion,'流程说明')
this.form.validateFields((err, values) => {
if (!err) {
formData.procDefId = this.processData.id;
formData.procDeTitle = this.processData.name;
formData.title=this.processData.description;
if (!formData.tableName)formData.tableName = this.processData.businessTable;
var url = this.url.addAuthorizationApply;
let method='post';
if (!this.isNew){
url = this.url.editAuthorizationApply;
method='put';
formData.assignees=this.assignees
formData.tableName = this.processData.tableName;
formData.procDefId = this.processData.procDefId;
formData.procDeTitle = this.processData.processName;
formData.title=this.processData.title;
formData.processInstanceId=this.processData.id;
if (!this.assignees){
this.$message.error('审批节点未分配候选审批人员,请联系管理员!')
return;
}
}
this.btndisabled = true;
console.log(formData,'表单数据')
httpAction(url,formData,method).then((res)=>{
if (res.success){
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close();
}else {
this.$message.error(res.message)
}
}).finally(()=>{
this.btndisabled = false;
})
}
})
}) })
}, },
handleSubmit () { handleSubmit () {
const that = this; const that = this;
@ -365,20 +344,22 @@
if (!err) { if (!err) {
let httpurl = ''; let httpurl = '';
let method = ''; 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); let formData = Object.assign(this.model, values);
formData.procDefId = this.processData.id; formData.procDefId = this.processData.id;
formData.procDeTitle = this.processData.name; formData.procDeTitle = this.processData.name;
formData.title=this.processData.description; formData.title=this.processData.description;
formData.fileId = getStringArry(formData.fileId) formData.fileId = getStringArry(formData.fileId)
if (!formData.tableName)formData.tableName = this.processData.businessTable; if (!formData.tableName)formData.tableName = this.processData.businessTable;
console.log('格式化后的数据',formData) if(!formData.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
console.log('格式化后的数据---',method)
console.log("表单提交数据",formData) console.log("表单提交数据",formData)
if (new Date(formData.privilegedTimeStart).getTime()/100>=new Date(formData.privilegedTimeEnd).getTime()/100){ if (new Date(formData.privilegedTimeStart).getTime()/100>=new Date(formData.privilegedTimeEnd).getTime()/100){
this.$message.error("授权开始时间不能大于授权结束时间") this.$message.error("授权开始时间不能大于授权结束时间")
@ -387,8 +368,7 @@
this.btndisabled = true; this.btndisabled = true;
httpAction(httpurl,formData,method).then((res)=>{ httpAction(httpurl,formData,method).then((res)=>{
if(res.success){ if(res.success){
that.$message.success(res.message); this.$emit('afterSubmit',formData)
that.$emit('afterSubmit',formData);
}else{ }else{
that.$message.warning(res.message); that.$message.warning(res.message);
} }

Loading…
Cancel
Save