zhaowei
2 天以前 926cbd6186778da6379d1c12ec149f82e5151e20
设备借出归还审批流程调整
已修改3个文件
696 ■■■■ 文件已修改
src/views/flowable/workflow/FlowTodo.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue 330 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue 360 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowTodo.vue
@@ -371,7 +371,7 @@
          title: '流程分类',
          align: 'center',
          dataIndex: 'category_dictText',
          width: 100
          width: 200
        },
        {
          title: '流程名称',
@@ -397,13 +397,13 @@
          title: '前驱节点',
          align: 'center',
          dataIndex: 'preNode',
          width: 300
          width: 250
        },
        {
          title: '当前节点',
          align: 'center',
          dataIndex: 'name',
          width: 300
          width: 250
        },
        {
          title: '当前节点开始时间',
src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue
@@ -18,7 +18,7 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code" label="单据号">
              <a-input v-model="model.code" disabled />
              <a-input v-model="model.code" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -28,216 +28,218 @@
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :guitter="24">
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanDepartId_dictText" label="借入车间">
              <a-input v-model="model.leanDepartId_dictText" disabled />
              <a-input v-model="model.leanDepartId_dictText" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanPerson_dictText" label="借用人">
              <a-input v-model="model.leanPerson_dictText" disabled />
              <a-input v-model="model.leanPerson_dictText" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanReason" label="借用原因">
              <a-textarea v-model="model.leanReason" disabled />
              <a-textarea v-model="model.leanReason" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="备注">
              <a-textarea v-model="model.remark" disabled />
              <a-textarea v-model="model.remark" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <div v-if="approvalDisable">
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 管理员审批
        <div v-if="leanOutApprovalDisable">
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 使用车间出厂审批
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalDealType" label="审批类型">
                <j-dict-select-tag type="radio" v-model="model.approvalDealType" dictCode="approved_rejected"
                                   placeholder="请选择处理类型" :disabled="disableSubmit || initialAcceptanceDisable" />
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useApprovalDealType" label="审批类型">
                <j-dict-select-tag type="radio" v-model="model.useApprovalDealType" dictCode="approved_rejected"
                                   placeholder="请选择处理类型"
                                   :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_OUT'"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalComment" label="确认意见">
                <a-textarea placeholder="请输入确认意见" v-model="model.approvalComment"
                            :disabled="disableSubmit || returnDisable" />
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useApprovalComment" label="确认意见">
                <a-textarea placeholder="请输入确认意见" v-model="model.useApprovalComment"
                            :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_OUT'"/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </div>
<!--        <div v-if="returnDisable">-->
<!--          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 归还信息-->
<!--          </a-divider>-->
<!--          <a-row :gutter="24">-->
<!--            <a-col :span="24">-->
<!--              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnComment"-->
<!--                                 label="归还备注">-->
<!--                <a-textarea placeholder="请输入归还备注" v-model="model.returnComment"-->
<!--                            :disabled="disableSubmit || confirmDisable" />-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--          </a-row>-->
<!--        </div>-->
        <div v-if="leanInApprovalDisable">
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 借用车间出厂审批
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanOutApprovalDealType" label="审批类型">
                <j-dict-select-tag type="radio" v-model="model.leanOutApprovalDealType" dictCode="approved_rejected"
                                   placeholder="请选择处理类型"
                                   :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_IN'"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanOutApprovalComment" label="确认意见">
                <a-textarea placeholder="请输入确认意见" v-model="model.leanOutApprovalComment"
                            :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_IN'"/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </div>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
import { getAction, httpAction } from '@/api/manage'
import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  import { getAction, httpAction } from '@/api/manage'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
export default {
  name: 'EquipmentLeanOutApprovalModal',
  components: {
    LxSearchEquipmentSelect
  },
  props: {
    selectShenpiData: {
      type: Object
    }
  },
  data() {
    return {
      title: '操作',
      visible: false,
      editable: false,
      model: {},
      treeData: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 }
      },
      labelColLong: {
        xs: { span: 24 },
        sm: { span: 2 }
      },
      wrapperColLong: {
        xs: { span: 24 },
        sm: { span: 21 }
      },
      confirmLoading: false,
      spinning: false,
      imageSrc: null,
      validatorRules: {
        approvalDealType: [
          { required: true, message: '请选择通过或驳回!' }
        ],
        approvalComment: [
          { required: true, message: '请输入审批意见!' }
        ],
        returnComment: [
          { required: true, message: '请输入归还备注!' }
        ],
        confirmComment: [
          { required: true, message: '请输入确认意见!' }
        ]
      },
      url: {
        queryById: '/eam/eamEquipmentLeanOut/queryById',
        approval: '/eam/eamEquipmentLeanOut/approval',
        loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions'
      },
      disableSubmit: false
    }
  },
  created() {
    this.loadAllProductionTree()
  },
  computed: {
    approvalDisable: function() {
      return ['WAIT_APPROVAL', 'WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
  export default {
    name: 'EquipmentLeanOutApprovalModal',
    components: {
      LxSearchEquipmentSelect
    },
    returnDisable: function() {
      return ['WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
    props: {
      selectShenpiData: {
        type: Object
      }
    },
    confirmDisable: function() {
      return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
    data() {
      return {
        title: '操作',
        visible: false,
        editable: false,
        model: {},
        treeData: [],
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 18 }
        },
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 2 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 21 }
        },
        confirmLoading: false,
        spinning: false,
        imageSrc: null,
        validatorRules: {
          useApprovalDealType: [
            { required: true, message: '请选择通过或驳回!' }
          ],
          leanOutApprovalDealType: [
            { required: true, message: '请选择通过或驳回!' }
          ],
          useApprovalComment: [
            { required: true, message: '请输入审批意见!' }
          ],
          leanOutApprovalComment: [
            { required: true, message: '请输入审批意见!' }
          ],
        },
        url: {
          queryById: '/eam/eamEquipmentLeanOut/queryById',
          approval: '/eam/eamEquipmentLeanOut/approval',
          loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions'
        },
        disableSubmit: false
      }
    },
    completionDisable: function() {
      return ['COMPLETE'].includes(this.model.leanStatus)
    }
  },
  methods: {
    async handleDetail(item) {
      this.initParams()
      this.model = {}
      let res = await getAction(this.url.queryById, { id: item.dataId })
      this.model = Object.assign({}, res.result)
      this.model.dataId = item.dataId
      this.model.taskId = item.id
      this.model.userId = item.assignee
      this.model.instanceId = item.procInstId
      this.model.values = item.variables
      this.spinning = false;
    created() {
      this.loadAllProductionTree()
    },
    computed: {
      leanOutApprovalDisable: function() {
        return ['WAIT_APPROVAL_OUT', 'WAIT_APPROVAL_IN', 'COMPLETE'].includes(this.model.leanStatus)
      },
      leanInApprovalDisable: function() {
        return ['WAIT_APPROVAL_IN', 'COMPLETE'].includes(this.model.leanStatus)
      }
    },
    methods: {
      async handleDetail(item) {
        this.initParams()
        this.model = {}
        let res = await getAction(this.url.queryById, { id: item.dataId })
        this.model = Object.assign({}, res.result)
        this.model.dataId = item.dataId
        this.model.taskId = item.id
        this.model.userId = item.assignee
        this.model.instanceId = item.procInstId
        this.model.values = item.variables
        this.spinning = false
      },
    recordDetail(record) {
      console.log('record', record)
      this.initParams()
      this.model = Object.assign({}, record)
    },
      recordDetail(record) {
        console.log('record', record)
        this.initParams()
        this.model = Object.assign({}, record)
      },
    initParams() {
      this.visible = true
      this.spinning = true
    },
      initParams() {
        this.visible = true
        this.spinning = true
      },
    async handleOk() {
      const that = this
      // 触发表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = that.spinning = true
          let httpurl = this.url.approval
          let method = 'put'
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('searchReset')
              that.close()
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = that.spinning = false
          })
        } else {
          return false
        }
      })
    },
    handleCancel() {
      this.close()
    },
      async handleOk() {
        const that = this
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = that.spinning = true
            let httpurl = this.url.approval
            let method = 'put'
            httpAction(httpurl, this.model, method).then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('searchReset')
                that.close()
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = that.spinning = false
            })
          } else {
            return false
          }
        })
      },
      handleCancel() {
        this.close()
      },
    close() {
      this.$emit('close')
      this.visible = false
      this.$refs.form.clearValidate()
    },
    loadAllProductionTree() {
      //加载车间选择树
      getAction(this.url.loadProductionOptions).then(res => {
        if (res.success) {
          this.treeData = [...res.result]
        } else {
          that.$message.warning(res.message)
        }
      })
      close() {
        this.$emit('close')
        this.visible = false
        if (this.$refs.form) this.$refs.form.clearValidate()
      },
      loadAllProductionTree() {
        //加载车间选择树
        getAction(this.url.loadProductionOptions).then(res => {
          if (res.success) {
            this.treeData = [...res.result]
          } else {
            this.$message.warning(res.message)
          }
        })
      }
    }
  }
}
</script>
<style lang="less" scoped>
src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue
@@ -18,7 +18,7 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code" label="单据号">
              <a-input v-model="model.code" disabled />
              <a-input v-model="model.code" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -28,39 +28,107 @@
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :guitter="24">
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanDepartId_dictText" label="借入车间">
              <a-input v-model="model.leanDepartId_dictText" disabled />
              <a-input v-model="model.leanDepartId_dictText" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanPerson_dictText" label="借用人">
              <a-input v-model="model.leanPerson_dictText" disabled />
              <a-input v-model="model.leanPerson_dictText" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanReason" label="借用原因">
              <a-textarea v-model="model.leanReason" disabled />
              <a-textarea v-model="model.leanReason" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="备注">
              <a-textarea v-model="model.remark" disabled />
              <a-textarea v-model="model.remark" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <div v-if="confirmDisable">
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 管理员确认
        <div>
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 使用车间出厂审批
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="24">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="审批类型">
                <j-dict-select-tag type="radio" v-model="model.useApprovalDealType" dictCode="approved_rejected"
                                   placeholder="请选择处理类型" disabled/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="确认意见">
                <a-textarea placeholder="请输入确认意见" v-model="model.useApprovalComment" disabled/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </div>
        <div>
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 借用车间出厂审批
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="审批类型">
                <j-dict-select-tag type="radio" v-model="model.leanOutApprovalDealType" dictCode="approved_rejected"
                                   placeholder="请选择处理类型" disabled/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol"
                                 label="确认意见">
                <a-textarea placeholder="请输入意见" v-model="model.confirmComment"
                            :disabled="disableSubmit || completionDisable" />
                <a-textarea placeholder="请输入确认意见" v-model="model.leanOutApprovalComment" disabled/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </div>
        <div v-if="returnConfirmApprovalDisable">
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 借用车间归还确认
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanOutConfirmDealType"
                                 label="审批类型">
                <j-dict-select-tag type="radio" v-model="model.leanOutConfirmDealType" dictCode="approved_rejected"
                                   placeholder="请选择处理类型"
                                   :disabled="disableSubmit||model.leanStatus!=='WAIT_CONFIRM_RETURN'"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanOutConfirmComment"
                                 label="确认意见">
                <a-textarea placeholder="请输入意见" v-model="model.leanOutConfirmComment"
                            :disabled="disableSubmit||model.leanStatus!=='WAIT_CONFIRM_RETURN'"/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </div>
        <div v-if="borrowConfirmApprovalDisable">
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 使用车间归还确认
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useConfirmDealType"
                                 label="审批类型">
                <j-dict-select-tag type="radio" v-model="model.useConfirmDealType" dictCode="approved_rejected"
                                   placeholder="请选择处理类型"
                                   :disabled="disableSubmit||model.leanStatus!=='WAIT_CONFIRM_BORROW'"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useConfirmComment"
                                 label="确认意见">
                <a-textarea placeholder="请输入意见" v-model="model.useConfirmComment"
                            :disabled="disableSubmit||model.leanStatus!=='WAIT_CONFIRM_BORROW'"/>
              </a-form-model-item>
            </a-col>
          </a-row>
@@ -71,154 +139,148 @@
</template>
<script>
import { getAction, httpAction } from '@/api/manage'
import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  import { getAction, httpAction } from '@/api/manage'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
export default {
  name: 'EquipmentLeanOutApprovalModal',
  components: {
    LxSearchEquipmentSelect
  },
  props: {
    selectShenpiData: {
      type: Object
    }
  },
  data() {
    return {
      title: '操作',
      visible: false,
      editable: false,
      model: {},
      treeData: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 }
      },
      labelColLong: {
        xs: { span: 24 },
        sm: { span: 2 }
      },
      wrapperColLong: {
        xs: { span: 24 },
        sm: { span: 21 }
      },
      confirmLoading: false,
      spinning: false,
      imageSrc: null,
      validatorRules: {
        approvalDealType: [
          { required: true, message: '请选择通过或驳回!' }
        ],
        approvalComment: [
          { required: true, message: '请输入审批意见!' }
        ],
        returnComment: [
          { required: true, message: '请输入归还备注!' }
        ],
        confirmComment: [
          { required: true, message: '请输入确认意见!' }
        ]
      },
      url: {
        queryById: '/eam/eamEquipmentLeanOut/queryById',
        approval: '/eam/eamEquipmentLeanOut/approval',
        loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions'
      },
      disableSubmit: false
    }
  },
  created() {
    this.loadAllProductionTree()
  },
  computed: {
    approvalDisable: function() {
      return ['WAIT_APPROVAL', 'WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
  export default {
    name: 'EquipmentLeanOutApprovalModal',
    components: {
      LxSearchEquipmentSelect
    },
    returnDisable: function() {
      return ['WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
    props: {
      selectShenpiData: {
        type: Object
      }
    },
    confirmDisable: function() {
      return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
    data() {
      return {
        title: '操作',
        visible: false,
        editable: false,
        model: {},
        treeData: [],
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 18 }
        },
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 2 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 21 }
        },
        confirmLoading: false,
        spinning: false,
        imageSrc: null,
        validatorRules: {
          leanOutConfirmDealType: [
            { required: true, message: '请选择通过或驳回!' }
          ],
          leanOutConfirmComment: [
            { required: true, message: '请输入确认意见!' }
          ],
          useConfirmDealType: [
            { required: true, message: '请选择通过或驳回!' }
          ],
          useConfirmComment: [
            { required: true, message: '请输入确认意见!' }
          ]
        },
        url: {
          queryById: '/eam/eamEquipmentLeanOut/queryById',
          approval: '/eam/eamEquipmentLeanOut/approval',
          loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions'
        },
        disableSubmit: false
      }
    },
    completionDisable: function() {
      return ['COMPLETE'].includes(this.model.leanStatus)
    }
  },
  methods: {
    async handleDetail(item) {
      this.initParams()
      this.model = {}
      let res = await getAction(this.url.queryById, { id: item.dataId })
      this.model = Object.assign({}, res.result)
      this.model.dataId = item.dataId
      this.model.taskId = item.id
      this.model.userId = item.assignee
      this.model.instanceId = item.procInstId
      this.model.values = item.variables
      this.spinning = false;
    created() {
      this.loadAllProductionTree()
    },
    computed: {
      returnConfirmApprovalDisable: function() {
        return ['WAIT_CONFIRM_RETURN', ' WAIT_CONFIRM_BORROW', 'COMPLETE'].includes(this.model.leanStatus)
      },
      borrowConfirmApprovalDisable: function() {
        return ['WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
      }
    },
    methods: {
      async handleDetail(item) {
        this.initParams()
        this.model = {}
        let res = await getAction(this.url.queryById, { id: item.dataId })
        this.model = Object.assign({}, res.result)
        this.model.dataId = item.dataId
        this.model.taskId = item.id
        this.model.userId = item.assignee
        this.model.instanceId = item.procInstId
        this.model.values = item.variables
        this.spinning = false
      },
    recordDetail(record) {
      console.log('record', record)
      this.initParams()
      this.model = Object.assign({}, record)
    },
      recordDetail(record) {
        console.log('record', record)
        this.initParams()
        this.model = Object.assign({}, record)
      },
    initParams() {
      this.visible = true
      this.spinning = true
    },
      initParams() {
        this.visible = true
        this.spinning = true
      },
    async handleOk() {
      const that = this
      // 触发表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = that.spinning = true
          let httpurl = this.url.approval
          let method = 'put'
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('searchReset')
              that.close()
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = that.spinning = false
          })
        } else {
          return false
        }
      })
    },
    handleCancel() {
      this.close()
    },
      async handleOk() {
        const that = this
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = that.spinning = true
            let httpurl = this.url.approval
            let method = 'put'
            httpAction(httpurl, this.model, method).then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('searchReset')
                that.close()
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = that.spinning = false
            })
          } else {
            return false
          }
        })
      },
      handleCancel() {
        this.close()
      },
    close() {
      this.$emit('close')
      this.visible = false
      this.$refs.form.clearValidate()
    },
    loadAllProductionTree() {
      //加载车间选择树
      getAction(this.url.loadProductionOptions).then(res => {
        if (res.success) {
          this.treeData = [...res.result]
        } else {
          that.$message.warning(res.message)
        }
      })
      close() {
        this.$emit('close')
        this.visible = false
        this.$refs.form.clearValidate()
      },
      loadAllProductionTree() {
        //加载车间选择树
        getAction(this.url.loadProductionOptions).then(res => {
          if (res.success) {
            this.treeData = [...res.result]
          } else {
            that.$message.warning(res.message)
          }
        })
      }
    }
  }
}
</script>
<style lang="less" scoped>