Browse Source

时间判断,隐藏顺序,表单校验

dev
0.0 2 years ago
parent
commit
40eda191f6
  1. 5
      src/components/jeecg/JDate.vue
  2. 2
      src/components/jeecgbiz/JSelectCompany.vue
  3. 2
      src/components/jeecgbiz/JSelectDepart.vue
  4. 9
      src/views/activiti/form/ProcessMaterialBorrowingForm.vue
  5. 16
      src/views/activiti/form/ProcessMaterialWarehousingForm.vue
  6. 8
      src/views/activiti/form/ProcessMaterialsAllotForm.vue
  7. 14
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue
  8. 10
      src/views/activiti/form/ProcessMaterialsReturnForm.vue
  9. 9
      src/views/activiti/form/ProcessSmaterialsScrapForm.vue
  10. 8
      src/views/activiti/form/ProcessSpecialMaterialsForm.vue
  11. 50
      src/views/activiti/form/ProcessUdgetPlanForm.vue

5
src/components/jeecg/JDate.vue

@ -29,6 +29,11 @@
default: 'YYYY-MM-DD',
required: false
},
createTime :{
type: String,
default: 'YYYY-MM-DD',
required: false
},
//
triggerChange:{
type: Boolean,

2
src/components/jeecgbiz/JSelectCompany.vue

@ -3,7 +3,7 @@
<!---->
<a-input @click="openModal" placeholder="请点击选择公司" v-model="departNames" readOnly :disabled="disabled">
<a-icon slot="prefix" type="cluster" title="公司选择控件"/>
<a-icon v-if="departIds" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
<!-- <a-icon v-if="departIds" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>-->
</a-input>
<j-select-company-modal

2
src/components/jeecgbiz/JSelectDepart.vue

@ -3,7 +3,7 @@
<!---->
<a-input @click="openModal" placeholder="请点击选择部门" v-model="departNames" readOnly :disabled="disabled">
<a-icon slot="prefix" type="cluster" title="部门选择控件"/>
<a-icon v-if="departIds" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
<!-- <a-icon v-if="departIds" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>-->
</a-input>
<j-select-depart-modal

9
src/views/activiti/form/ProcessMaterialBorrowingForm.vue

@ -398,7 +398,14 @@
throw this.throwNotFunction('classifyIntoFormData')
}
let formData = this.classifyIntoFormData(allValues)
if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
this.$message.error("物资类型不能为空")
return;
}
if (formData.borrowedDepartments === null || formData.borrowedDepartments ==='' || formData.borrowedDepartments === undefined){
this.$message.error("被借用部门不能为空")
return;
}
this.form.validateFields((err, values) => {
if (!err) {
formData.procDefId = this.processData.id;

16
src/views/activiti/form/ProcessMaterialWarehousingForm.vue

@ -425,6 +425,22 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
throw this.throwNotFunction('classifyIntoFormData')
}
let formData = this.classifyIntoFormData(allValues)
if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
this.$message.error("物资类型不能为空")
return;
}
if (formData.targetLibrary === null || formData.targetLibrary ==='' || formData.targetLibrary === undefined){
this.$message.error("入库目标库不能为空")
return;
}
if (formData.processUdgetPlanId === null || formData.processUdgetPlanId ==='' || formData.processUdgetPlanId === undefined){
this.$message.error("关联预算流程不能为空")
return;
}
if (formData.warehousingBatch === null || formData.warehousingBatch ==='' || formData.warehousingBatch === undefined){
this.$message.error("入库总批次不能为空")
return;
}
this.form.validateFields((err, values) => {
if (!err) {
formData.procDefId = this.processData.id;

8
src/views/activiti/form/ProcessMaterialsAllotForm.vue

@ -343,6 +343,14 @@
}
let formData = this.classifyIntoFormData(allValues)
if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
this.$message.error("物资类型不能为空")
return;
}
if (formData.beAllotDepartment === null || formData.beAllotDepartment ==='' || formData.beAllotDepartment === undefined){
this.$message.error("被调拨部门不能为空")
return;
}
this.form.validateFields((err, values) => {
if (!err) {
formData.procDefId = this.processData.id;

14
src/views/activiti/form/ProcessMaterialsDeliveryForm.vue

@ -36,7 +36,7 @@
</a-col>
<a-col :span="8" >
<a-form-item label="出库时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择出库时间" v-decorator="['deliveryTime']" :trigger-change="true" style="width: 100%" />
<j-date placeholder="请选择出库时间" v-decorator="['deliveryTime']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="8" >
@ -349,6 +349,18 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
throw this.throwNotFunction('classifyIntoFormData')
}
let formData = this.classifyIntoFormData(allValues)
if (new Date(formData.createTime).getTime()/100>new Date(formData.deliveryTime).getTime()/100){
this.$message.error("出库时间不能小于当前流程发起时间")
return;
}
if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
this.$message.error("物资类型不能为空")
return;
}
if (formData.deliveryTime === null || formData.deliveryTime ==='' || formData.deliveryTime === undefined){
this.$message.error("出库时间不能为空")
return;
}
this.form.validateFields((err, values) => {
if (!err) {

10
src/views/activiti/form/ProcessMaterialsReturnForm.vue

@ -26,7 +26,7 @@
</a-col>
<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" >
@ -342,6 +342,14 @@
throw this.throwNotFunction('classifyIntoFormData')
}
let formData = this.classifyIntoFormData(allValues)
if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
this.$message.error("物资类型不能为空")
return;
}
if (formData.processBorrowId === null || formData.processBorrowId ==='' || formData.processBorrowId === undefined){
this.$message.error("关联借用流程不能为空")
return;
}
this.form.validateFields((err, values) => {
if (!err) {

9
src/views/activiti/form/ProcessSmaterialsScrapForm.vue

@ -340,7 +340,14 @@
throw this.throwNotFunction('classifyIntoFormData')
}
let formData = this.classifyIntoFormData(allValues)
if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
this.$message.error("物资类型不能为空")
return;
}
if (formData.processOutflowId === null || formData.processOutflowId ==='' || formData.processOutflowId === undefined){
this.$message.error("关联的出库流程不能为空")
return;
}
this.form.validateFields((err, values) => {
if (!err) {
formData.procDefId = this.processData.id;

8
src/views/activiti/form/ProcessSpecialMaterialsForm.vue

@ -336,6 +336,14 @@
}
let formData = this.classifyIntoFormData(allValues)
if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
this.$message.error("物资类型不能为空")
return;
}
if (formData.processReturnId === null || formData.processReturnId ==='' || formData.processReturnId === undefined){
this.$message.error("关联的归还流程不能为空")
return;
}
this.form.validateFields((err, values) => {
if (!err) {
formData.procDefId = this.processData.id;

50
src/views/activiti/form/ProcessUdgetPlanForm.vue

@ -1,9 +1,9 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<j-form-container :disabled="formDisabled">
<!-- 主表单区域 -->
<a-form :form="form" slot="detail">
<a-form :form="form" :rules="rules" slot="detail" >
<a-row>
<a-col :span="8" v-show="false">
<a-form-item label="ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
@ -32,9 +32,10 @@
</a-form-item>
</a-col>
<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="请选择物资类型"/>
<a-form-item label="物资类型" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<j-dict-select-tag type="list" v-decorator="['materialType']" :trigger-change="true" dictCode="material_type"
placeholder="请选择物资类型" />
</a-form-item>
</a-col>
<a-col :span="8">
@ -44,15 +45,15 @@
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="需求时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择需求时间" v-decorator="['needTime']" :trigger-change="true" style="width: 100%"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="顺序号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-decorator="['orderNumber']" placeholder="请输入顺序号" style="width: 100%"/>
<a-form-item label="需求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<j-date placeholder="请选择需求时间" v-decorator="['needTime']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
</a-form-item>
</a-col>
<!-- <a-col :span="8">-->
<!-- <a-form-item label="顺序号" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input-number v-decorator="['orderNumber']" placeholder="请输入顺序号" style="width: 100%"/>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="8">
<a-form-item label="文件" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-upload v-decorator="['fileId']" :trigger-change="true"></j-upload>
@ -326,7 +327,14 @@
list: '/hy/processUdgetPlan/queryProcessUdgetPlanMaterialByMainId'
}
},
btndisabled: false
btndisabled: false,
//
rules: {
// 'blur'
materialType: [ { required: true, message: '请输入标题名称' ,trigger: 'blur'}],
needTime: [ { required: true, message: '请输入内容' ,trigger: 'blur'}],
processPlan: [ { required: true, message: '请选择协议类型', trigger: 'blur' }]
},
}
},
props: {
@ -556,6 +564,22 @@
}
let formData = this.classifyIntoFormData(allValues)
if (new Date(formData.createTime).getTime()/100>new Date(formData.needTime).getTime()/100){
this.$message.error("需求时间不能小于当前流程发起时间")
return;
}
if (formData.needTime === null || formData.needTime ==='' || formData.needTime === undefined){
this.$message.error("需求时间不能为空")
return;
}
if (formData.processPlan === null || formData.processPlan ==='' || formData.processPlan === undefined){
this.$message.error("流程计划不能为空")
return;
}
if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
this.$message.error("物资类型不能为空")
return;
}
this.form.validateFields((err, values) => {
if (!err) {
formData.procDefId = this.processData.id;

Loading…
Cancel
Save