|
|
|
@ -6,68 +6,73 @@
|
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="8" v-show="false"> |
|
|
|
|
<a-form-item label="ID" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['id']" placeholder="" style="width: 100%"/> |
|
|
|
|
<a-input v-decorator="['id']" placeholder="" style="width: 100%" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="流程发起人" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<j-select-user-by-dep v-decorator="['createBy']" disabled/> |
|
|
|
|
<j-select-user-by-dep v-decorator="['createBy']" disabled /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="流程发起公司" :labelCol="labelCol" :wrapperCol="wrapperCol" aria-readonly="true"> |
|
|
|
|
<j-select-company v-decorator="['company']" multi disabled/> |
|
|
|
|
<j-select-company v-decorator="['company']" multi disabled /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="流程发起部门" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<j-select-depart v-decorator="['sysOrgCode']" multi disabled/> |
|
|
|
|
<j-select-depart v-decorator="['sysOrgCode']" multi disabled /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="流程发起时间" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<j-date placeholder="请选择流程发起时间" v-decorator="['createTime']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled/> |
|
|
|
|
<j-date placeholder="请选择流程发起时间" v-decorator="['createTime']" :trigger-change="true" :show-time="true" |
|
|
|
|
date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="关联预算流程" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<!-- <a-input v-decorator="['processUdgetPlanId']" placeholder="请输入关联预算流程" ></a-input>--> |
|
|
|
|
<h-plan v-decorator="['processUdgetPlanId',validatorRules.processUdgetPlanId]" :trigger-change="true" code="demo" field="name" orgFields="name" @mounted="getPlanList" @callType="getcallType" destFields="name" :multi="true"/> |
|
|
|
|
<!-- <j-popup--> |
|
|
|
|
<!-- v-decorator="['one']"--> |
|
|
|
|
<!-- :trigger-change="true"--> |
|
|
|
|
<!-- code="user_msg"--> |
|
|
|
|
<!-- org-fields="username,realname"--> |
|
|
|
|
<!-- dest-fields="one,two"--> |
|
|
|
|
<!-- @callback="popupCallback"/>--> |
|
|
|
|
<!-- <a-input v-decorator="['processUdgetPlanId']" placeholder="请输入关联预算流程" ></a-input>--> |
|
|
|
|
<h-plan v-decorator="['processUdgetPlanId',validatorRules.processUdgetPlanId]" :trigger-change="true" |
|
|
|
|
code="demo" field="name" orgFields="name" @mounted="getPlanList" @callType="getcallType" |
|
|
|
|
destFields="name" :multi="true" /> |
|
|
|
|
<!-- <j-popup--> |
|
|
|
|
<!-- v-decorator="['one']"--> |
|
|
|
|
<!-- :trigger-change="true"--> |
|
|
|
|
<!-- code="user_msg"--> |
|
|
|
|
<!-- org-fields="username,realname"--> |
|
|
|
|
<!-- dest-fields="one,two"--> |
|
|
|
|
<!-- @callback="popupCallback"/>--> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="物资类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<j-dict-select-tag type="list" v-decorator="['materialType']" :trigger-change="true" dictCode="material_type" |
|
|
|
|
placeholder="物资类型" disabled/> |
|
|
|
|
<j-dict-select-tag type="list" v-decorator="['materialType']" :trigger-change="true" |
|
|
|
|
dictCode="material_type" |
|
|
|
|
placeholder="物资类型" disabled /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="入库目标库" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['targetLibrary']" placeholder="入库目标库" style="width: 100%" disabled/> |
|
|
|
|
<!-- <a-radio v-for="item in puwwOptions" :key="item.id" :label="item.invisibleCode" :value="item.id"></a-radio>--> |
|
|
|
|
<a-input v-decorator="['targetLibrary']" placeholder="入库目标库" style="width: 100%" disabled /> |
|
|
|
|
<!-- <a-radio v-for="item in puwwOptions" :key="item.id" :label="item.invisibleCode" :value="item.id"></a-radio>--> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="入库总批次" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input-number v-decorator="['warehousingBatch',validatorRules.warehousingBatch]" placeholder="请输入入库总批次" style="width: 100%" /> |
|
|
|
|
<a-input-number v-decorator="['warehousingBatch',validatorRules.warehousingBatch]" placeholder="请输入入库总批次" |
|
|
|
|
style="width: 100%" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8" > |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="文件" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<j-upload v-decorator="['fileId']" :trigger-change="true" ></j-upload> |
|
|
|
|
<j-upload v-decorator="['fileId']" :trigger-change="true"></j-upload> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
</a-row> |
|
|
|
|
</a-form> |
|
|
|
|
</j-form-container> |
|
|
|
|
<!-- 子表单区域 --> |
|
|
|
|
<!-- 子表单区域 --> |
|
|
|
|
<a-tabs v-model="activeKey" @change="handleChangeTabs"> |
|
|
|
|
<a-tab-pane tab="物资入库流程清单表" :key="refKeys[0]" :forceRender="true"> |
|
|
|
|
<j-editable-table |
|
|
|
@ -79,7 +84,7 @@
|
|
|
|
|
:disabled="formDisabled" |
|
|
|
|
:rowNumber="true" |
|
|
|
|
:rowSelection="true" |
|
|
|
|
:actionButton="true"/> |
|
|
|
|
:actionButton="true" /> |
|
|
|
|
</a-tab-pane> |
|
|
|
|
</a-tabs> |
|
|
|
|
<div class="div_process"> |
|
|
|
@ -88,8 +93,8 @@
|
|
|
|
|
<a-button style="margin-left: 8px" :disabled="disabled" @click="close">取消</a-button> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item v-if="task" :wrapperCol="{ span: 24 }" style="text-align: center"> |
|
|
|
|
<a-button type="primary" @click="passTask">通过</a-button> |
|
|
|
|
<a-button style="margin-left: 8px" @click="backTask">驳回</a-button> |
|
|
|
|
<a-button type="primary" @click="passTask">通过</a-button> |
|
|
|
|
<a-button style="margin-left: 8px" @click="backTask">驳回</a-button> |
|
|
|
|
</a-form-item> |
|
|
|
|
</div> |
|
|
|
|
</a-spin> |
|
|
|
@ -97,17 +102,17 @@
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
import pick from 'lodash.pick' |
|
|
|
|
import { getAction, getCurrentTime, httpAction,getStringArry,getRecord } from '@/api/manage' |
|
|
|
|
import { FormTypes, getRefPromise,validateFormAndTables } from '@/utils/JEditableTableUtil' |
|
|
|
|
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin' |
|
|
|
|
import { validateDuplicateValue } from '@/utils/util' |
|
|
|
|
import pick from 'lodash.pick' |
|
|
|
|
import { getAction, getCurrentTime, httpAction, getStringArry, getRecord } from '@/api/manage' |
|
|
|
|
import { FormTypes, getRefPromise, validateFormAndTables } from '@/utils/JEditableTableUtil' |
|
|
|
|
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin' |
|
|
|
|
import { validateDuplicateValue } from '@/utils/util' |
|
|
|
|
import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany' |
|
|
|
|
import JFormContainer from '@/components/jeecg/JFormContainer' |
|
|
|
|
import JDate from '@/components/jeecg/JDate' |
|
|
|
|
import JUpload from '@/components/jeecg/JUpload' |
|
|
|
|
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart' |
|
|
|
|
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep' |
|
|
|
|
import JFormContainer from '@/components/jeecg/JFormContainer' |
|
|
|
|
import JDate from '@/components/jeecg/JDate' |
|
|
|
|
import JUpload from '@/components/jeecg/JUpload' |
|
|
|
|
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart' |
|
|
|
|
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: 'ProcessMaterialWarehousingForm', |
|
|
|
@ -280,236 +285,240 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
|
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
props: { |
|
|
|
|
/*流程数据*/ |
|
|
|
|
processData:{ |
|
|
|
|
type:Object, |
|
|
|
|
default:()=>{return {}}, |
|
|
|
|
required:false |
|
|
|
|
}, |
|
|
|
|
/*是否新增*/ |
|
|
|
|
isNew: {type: Boolean, default: false, required: false}, |
|
|
|
|
/*是否处理流程*/ |
|
|
|
|
task: {type: Boolean, default: false, required: false}, |
|
|
|
|
//流程表单data |
|
|
|
|
formData: { |
|
|
|
|
type: Object, |
|
|
|
|
default: ()=>{}, |
|
|
|
|
required: false |
|
|
|
|
|
|
|
|
|
props: { |
|
|
|
|
/*流程数据*/ |
|
|
|
|
processData: { |
|
|
|
|
type: Object, |
|
|
|
|
default: () => { |
|
|
|
|
return {} |
|
|
|
|
}, |
|
|
|
|
//表单模式:false流程表单 true普通表单 |
|
|
|
|
formBpm: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default: false, |
|
|
|
|
required: false |
|
|
|
|
required: false |
|
|
|
|
}, |
|
|
|
|
/*是否新增*/ |
|
|
|
|
isNew: { type: Boolean, default: false, required: false }, |
|
|
|
|
/*是否处理流程*/ |
|
|
|
|
task: { type: Boolean, default: false, required: false }, |
|
|
|
|
//流程表单data |
|
|
|
|
formData: { |
|
|
|
|
type: Object, |
|
|
|
|
default: () => { |
|
|
|
|
}, |
|
|
|
|
//表单禁用 |
|
|
|
|
disabled: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default: false, |
|
|
|
|
required: false |
|
|
|
|
required: false |
|
|
|
|
}, |
|
|
|
|
//表单模式:false流程表单 true普通表单 |
|
|
|
|
formBpm: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default: false, |
|
|
|
|
required: false |
|
|
|
|
}, |
|
|
|
|
//表单禁用 |
|
|
|
|
disabled: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default: false, |
|
|
|
|
required: false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
formDisabled() { |
|
|
|
|
if (this.formBpm === true) { |
|
|
|
|
if (this.formData.disabled === false) { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
return this.disabled |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
formDisabled(){ |
|
|
|
|
if(this.formBpm===true){ |
|
|
|
|
if(this.formData.disabled===false){ |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
showFlowSubmitButton() { |
|
|
|
|
if (this.formBpm === true) { |
|
|
|
|
if (this.formData.disabled === false) { |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
return this.disabled |
|
|
|
|
}, |
|
|
|
|
showFlowSubmitButton(){ |
|
|
|
|
if(this.formBpm===true){ |
|
|
|
|
if(this.formData.disabled===false){ |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
//如果是流程中表单,则需要加载流程表单data |
|
|
|
|
this.showFlowData() |
|
|
|
|
if (!this.isNew) { |
|
|
|
|
this.init() |
|
|
|
|
} |
|
|
|
|
let company = sessionStorage.getItem('PARENT_ID') |
|
|
|
|
let puwwcid = sessionStorage.getItem('PUWWC_Id') |
|
|
|
|
let userInfo = sessionStorage.getItem('USER_INFORMATION') |
|
|
|
|
console.log(userInfo) |
|
|
|
|
// userInfo.company=company; |
|
|
|
|
this.popupCallback(company, userInfo, puwwcid) |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
/*回显数据*/ |
|
|
|
|
init() { |
|
|
|
|
this.btndisabled = true |
|
|
|
|
var r = this.processData |
|
|
|
|
this.getAction(this.url.queryById, { |
|
|
|
|
id: r.tableId |
|
|
|
|
}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
let formData = res.result |
|
|
|
|
formData.tableName = r.tableName |
|
|
|
|
this.data = formData |
|
|
|
|
console.log('表单回显数据', this.data) |
|
|
|
|
this.editAfter() |
|
|
|
|
this.btndisabled = false |
|
|
|
|
} else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
created () { |
|
|
|
|
//如果是流程中表单,则需要加载流程表单data |
|
|
|
|
this.showFlowData(); |
|
|
|
|
if (!this.isNew){ |
|
|
|
|
this.init(); |
|
|
|
|
} |
|
|
|
|
let company = sessionStorage.getItem("PARENT_ID"); |
|
|
|
|
let puwwcid = sessionStorage.getItem("PUWWC_Id"); |
|
|
|
|
let userInfo=sessionStorage.getItem("USER_INFORMATION"); |
|
|
|
|
console.log(userInfo) |
|
|
|
|
// userInfo.company=company; |
|
|
|
|
this.popupCallback(company,userInfo,puwwcid); |
|
|
|
|
close() { |
|
|
|
|
//todo 关闭后的回调 |
|
|
|
|
this.$emit('close') |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
/*回显数据*/ |
|
|
|
|
init(){ |
|
|
|
|
this.btndisabled = true; |
|
|
|
|
var r = this.processData; |
|
|
|
|
this.getAction(this.url.queryById,{ |
|
|
|
|
id:r.tableId |
|
|
|
|
}).then((res)=>{ |
|
|
|
|
if (res.success){ |
|
|
|
|
let formData = res.result; |
|
|
|
|
formData.tableName = r.tableName; |
|
|
|
|
this.data = formData; |
|
|
|
|
console.log("表单回显数据",this.data) |
|
|
|
|
this.editAfter(); |
|
|
|
|
this.btndisabled = false; |
|
|
|
|
}else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
close() { |
|
|
|
|
//todo 关闭后的回调 |
|
|
|
|
this.$emit('close') |
|
|
|
|
}, |
|
|
|
|
/*通过审批*/ |
|
|
|
|
passTask() { |
|
|
|
|
this.$emit('passTask') |
|
|
|
|
}, |
|
|
|
|
/*驳回审批*/ |
|
|
|
|
backTask() { |
|
|
|
|
this.$emit('backTask') |
|
|
|
|
}, |
|
|
|
|
handleSubmit (e) { |
|
|
|
|
this.getAllTable().then(tables => { |
|
|
|
|
return validateFormAndTables(this.form, tables) |
|
|
|
|
}).then(allValues=>{ |
|
|
|
|
if (typeof this.classifyIntoFormData !== 'function') { |
|
|
|
|
throw this.throwNotFunction('classifyIntoFormData') |
|
|
|
|
} |
|
|
|
|
let formData = this.classifyIntoFormData(allValues) |
|
|
|
|
formData.fileId = getStringArry(formData.fileId) |
|
|
|
|
console.log('格式化后的数据',formData) |
|
|
|
|
this.form.validateFields((err, values) => { |
|
|
|
|
if (!err) { |
|
|
|
|
formData.procDefId = this.processData.id; |
|
|
|
|
formData.procDeTitle = this.processData.name; |
|
|
|
|
formData.title=this.processData.description; |
|
|
|
|
formData.targetLibrary = this.libraryAssociationIdInvisible |
|
|
|
|
if (!formData.tableName)formData.tableName = this.processData.businessTable; |
|
|
|
|
var url = this.url.add; |
|
|
|
|
let method='post'; |
|
|
|
|
if (!this.isNew){ |
|
|
|
|
url = this.url.edit; |
|
|
|
|
method='put'; |
|
|
|
|
} |
|
|
|
|
this.btndisabled = true; |
|
|
|
|
httpAction(url,formData,method).then((res)=>{ |
|
|
|
|
if (res.success){ |
|
|
|
|
this.$message.success("保存成功!") |
|
|
|
|
//todo 将表单的数据传给父组件 |
|
|
|
|
this.$emit('afterSubmit',formData) |
|
|
|
|
}else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
} |
|
|
|
|
}).finally(()=>{ |
|
|
|
|
this.btndisabled = false; |
|
|
|
|
}) |
|
|
|
|
/*通过审批*/ |
|
|
|
|
passTask() { |
|
|
|
|
this.$emit('passTask') |
|
|
|
|
}, |
|
|
|
|
/*驳回审批*/ |
|
|
|
|
backTask() { |
|
|
|
|
this.$emit('backTask') |
|
|
|
|
}, |
|
|
|
|
handleSubmit(e) { |
|
|
|
|
this.getAllTable().then(tables => { |
|
|
|
|
return validateFormAndTables(this.form, tables) |
|
|
|
|
}).then(allValues => { |
|
|
|
|
if (typeof this.classifyIntoFormData !== 'function') { |
|
|
|
|
throw this.throwNotFunction('classifyIntoFormData') |
|
|
|
|
} |
|
|
|
|
let formData = this.classifyIntoFormData(allValues) |
|
|
|
|
formData.fileId = getStringArry(formData.fileId) |
|
|
|
|
console.log('格式化后的数据', formData) |
|
|
|
|
this.form.validateFields((err, values) => { |
|
|
|
|
if (!err) { |
|
|
|
|
formData.procDefId = this.processData.id |
|
|
|
|
formData.procDeTitle = this.processData.name |
|
|
|
|
formData.title = this.processData.description |
|
|
|
|
formData.targetLibrary = this.libraryAssociationIdInvisible |
|
|
|
|
if (!formData.tableName) formData.tableName = this.processData.businessTable |
|
|
|
|
var url = this.url.add |
|
|
|
|
let method = 'post' |
|
|
|
|
if (!this.isNew) { |
|
|
|
|
url = this.url.edit |
|
|
|
|
method = 'put' |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.btndisabled = true |
|
|
|
|
httpAction(url, formData, method).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$message.success('保存成功!') |
|
|
|
|
//todo 将表单的数据传给父组件 |
|
|
|
|
this.$emit('afterSubmit', formData) |
|
|
|
|
} else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
this.btndisabled = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
addBefore(){ |
|
|
|
|
this.form.resetFields() |
|
|
|
|
this.processMaterialWarehousingListTable.dataSource=[] |
|
|
|
|
}, |
|
|
|
|
getAllTable() { |
|
|
|
|
let values = this.tableKeys.map(key => getRefPromise(this, key)) |
|
|
|
|
return Promise.all(values) |
|
|
|
|
}, |
|
|
|
|
/** 调用完edit()方法之后会自动调用此方法 */ |
|
|
|
|
editAfter() { |
|
|
|
|
if (this.data.id != null && this.data.id != '' && this.data.id != undefined && this.data.fileId != null && this.data.fileId != '') { |
|
|
|
|
//1、文件回显 |
|
|
|
|
this.data = getRecord(this.data) |
|
|
|
|
} |
|
|
|
|
let fieldval = pick(this.data,'id','company','createTime','sysOrgCode','createBy','processUdgetPlanId','materialType','targetLibrary','warehousingBatch','fileId') |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(fieldval) |
|
|
|
|
}, |
|
|
|
|
addBefore() { |
|
|
|
|
this.form.resetFields() |
|
|
|
|
this.processMaterialWarehousingListTable.dataSource = [] |
|
|
|
|
}, |
|
|
|
|
getAllTable() { |
|
|
|
|
let values = this.tableKeys.map(key => getRefPromise(this, key)) |
|
|
|
|
return Promise.all(values) |
|
|
|
|
}, |
|
|
|
|
/** 调用完edit()方法之后会自动调用此方法 */ |
|
|
|
|
editAfter() { |
|
|
|
|
if (this.data.id != null && this.data.id != '' && this.data.id != undefined && this.data.fileId != null && this.data.fileId != '') { |
|
|
|
|
//1、文件回显 |
|
|
|
|
this.data = getRecord(this.data) |
|
|
|
|
} |
|
|
|
|
let fieldval = pick(this.data, 'id', 'company', 'createTime', 'sysOrgCode', 'createBy', 'processUdgetPlanId', 'materialType', 'targetLibrary', 'warehousingBatch', 'fileId') |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(fieldval) |
|
|
|
|
}) |
|
|
|
|
// 加载子表数据 |
|
|
|
|
if (this.data.id) { |
|
|
|
|
let params = { id: this.data.id } |
|
|
|
|
this.requestSubTableData(this.url.processMaterialWarehousingList.list, params, this.processMaterialWarehousingListTable) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/** 整理成formData */ |
|
|
|
|
classifyIntoFormData(allValues) { |
|
|
|
|
let main = Object.assign(this.model, allValues.formValue) |
|
|
|
|
return { |
|
|
|
|
...main, // 展开 |
|
|
|
|
processMaterialWarehousingListList: allValues.tablesValue[0].values |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//渲染流程表单数据 |
|
|
|
|
showFlowData() { |
|
|
|
|
if (this.formBpm === true) { |
|
|
|
|
let params = { id: this.formData.dataId } |
|
|
|
|
getAction(this.url.queryById, params).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.edit(res.result) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// 加载子表数据 |
|
|
|
|
if (this.data.id) { |
|
|
|
|
let params = { id: this.data.id } |
|
|
|
|
this.requestSubTableData(this.url.processMaterialWarehousingList.list, params, this.processMaterialWarehousingListTable) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/** 整理成formData */ |
|
|
|
|
classifyIntoFormData(allValues) { |
|
|
|
|
let main = Object.assign(this.model, allValues.formValue) |
|
|
|
|
return { |
|
|
|
|
...main, // 展开 |
|
|
|
|
processMaterialWarehousingListList: allValues.tablesValue[0].values, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//渲染流程表单数据 |
|
|
|
|
showFlowData(){ |
|
|
|
|
if(this.formBpm === true){ |
|
|
|
|
let params = {id:this.formData.dataId}; |
|
|
|
|
getAction(this.url.queryById,params).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
this.edit (res.result); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
validateError(msg) { |
|
|
|
|
this.$message.error(msg) |
|
|
|
|
}, |
|
|
|
|
getPlanList(id) { |
|
|
|
|
let params = {} |
|
|
|
|
params.id = id |
|
|
|
|
this.requestSubTableData(this.url.list, params, this.processMaterialWarehousingListTable) |
|
|
|
|
// getAction(this.url.list,params).then((res)=>{ |
|
|
|
|
// if(res.success){ |
|
|
|
|
// console.log('将要回填的数据',res.result) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
getcallType(type) { |
|
|
|
|
this.data.materialType = type.materialType |
|
|
|
|
this.data.processUdgetPlanId = type.id |
|
|
|
|
let fieldval = pick(this.data, 'materialType', 'processUdgetPlanId') |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(fieldval) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
popupCallback(company, row, puwwcid) { |
|
|
|
|
let res = JSON.parse(row) |
|
|
|
|
let params = {} |
|
|
|
|
params.id = puwwcid |
|
|
|
|
let invisibleCode = null |
|
|
|
|
getAction(this.url.puwwlist, params).then((rest) => { |
|
|
|
|
if (rest.success) { |
|
|
|
|
invisibleCode = rest.result.invisibleCode |
|
|
|
|
this.libraryAssociationIdInvisible = rest.result.unit |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
validateError(msg){ |
|
|
|
|
this.$message.error(msg) |
|
|
|
|
}, |
|
|
|
|
getPlanList(id){ |
|
|
|
|
let params={} |
|
|
|
|
params.id=id; |
|
|
|
|
this.requestSubTableData(this.url.list, params, this.processMaterialWarehousingListTable) |
|
|
|
|
// getAction(this.url.list,params).then((res)=>{ |
|
|
|
|
// if(res.success){ |
|
|
|
|
// console.log('将要回填的数据',res.result) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
getcallType(type){ |
|
|
|
|
this.data.materialType = type.materialType; |
|
|
|
|
this.data.processUdgetPlanId=type.id |
|
|
|
|
let fieldval =pick(this.data,'materialType','processUdgetPlanId') |
|
|
|
|
|
|
|
|
|
let param = {} |
|
|
|
|
param.createBy = res.username |
|
|
|
|
param.company = company |
|
|
|
|
param.targetLibrary = invisibleCode == null ? 'ZK' : invisibleCode |
|
|
|
|
param.sysOrgCode = res.departIds |
|
|
|
|
param.createTime = getCurrentTime() |
|
|
|
|
this.data = param |
|
|
|
|
console.log('获取我的数据', this.data) |
|
|
|
|
let fieldval = pick(this.data, 'createBy', 'company', 'sysOrgCode', 'createTime', 'targetLibrary') |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(fieldval) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
popupCallback(company,row,puwwcid) { |
|
|
|
|
let res=JSON.parse(row); |
|
|
|
|
let params={} |
|
|
|
|
params.id=puwwcid; |
|
|
|
|
let invisibleCode=null; |
|
|
|
|
getAction(this.url.puwwlist,params).then((rest)=>{ |
|
|
|
|
if(rest.success){ |
|
|
|
|
invisibleCode =rest.result.invisibleCode |
|
|
|
|
this.libraryAssociationIdInvisible = rest.result.unit |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let param={} |
|
|
|
|
param.createBy=res.username; |
|
|
|
|
param.company=company; |
|
|
|
|
param.targetLibrary =invisibleCode==null?"ZK":invisibleCode; |
|
|
|
|
param.sysOrgCode=res.departIds; |
|
|
|
|
param.createTime= getCurrentTime(); |
|
|
|
|
this.data=param; |
|
|
|
|
console.log('获取我的数据',this.data) |
|
|
|
|
let fieldval =pick(this.data, 'createBy','company','sysOrgCode','createTime','targetLibrary') |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(fieldval) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|
.div_process{ |
|
|
|
|
margin-top: 30px; |
|
|
|
|
} |
|
|
|
|
.div_process { |
|
|
|
|
margin-top: 30px; |
|
|
|
|
} |
|
|
|
|
</style> |