cuilei
2025-05-22 0f8473285bcbbe7f8cf07f952bb7017640a6144e
工具管理-工具出库申请流程审批页面
已添加1个文件
已修改4个文件
563 ■■■■■ 文件已修改
src/views/flowable/workflow/FlowTodo.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue 513 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/OutboundDetailList.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/OutboundOrderList.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/outBound/OutboundOrderModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowTodo.vue
@@ -111,6 +111,8 @@
                                     @searchReset="searchReset"></week-maintenance-approval-modal>
    <repair-order-approval-modal ref="repairOrderApprovalModal" @searchReset="searchReset"
                                 :selectShenpiData="selectRepairOrderData"></repair-order-approval-modal>
    <out-bound-order-handle ref="outBoundOrderHandle" :selectShenpiData="selectOutBoundOrderData"
                              @searchReset="searchReset"></out-bound-order-handle>
    <!--批量处理-->
    <inspection-order-batch-handle ref="inspectionOrderBatchHandleRef" @searchReset="searchReset"
@@ -143,7 +145,7 @@
  import AssignFileStreamHandle from '@views/flowable/workflow/assignFileStream/AssignFileStreamHandle.vue'
  import DispatchFileHandle from '@views/flowable/workflow/dispatchFile/DispatchFileHandle.vue'
  import DispatchFileBachHandleStyle from '@views/flowable/workflow/dispatchFile/DispatchFileBachHandleStyle#Drawer.vue'
  import OutBoundOrderHandle from '@views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue'
  import EquipmentLeanOutApprovalModal from '@views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue'
  import SecondMaintenanceApprovalModal from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue'
  import ThirdMaintenanceApprovalModal from '@views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue'
@@ -163,7 +165,8 @@
      InspectionOrderHandle,
      EquipmentLeanOutApprovalModal,
      SecondMaintenanceApprovalModal,
      ThirdMaintenanceApprovalModal
      ThirdMaintenanceApprovalModal,
      OutBoundOrderHandle
    },
    data() {
      return {
@@ -245,6 +248,7 @@
        selectThirdMaintenanceData: {},
        selectBachData: {},
        selectRepairOrderData: {},
        selectOutBoundOrderData: {},
        //业务信息ID
        dataId: undefined
      }
@@ -324,6 +328,9 @@
            break
          case 'third_maintenance':
            this.handleThirdMaintenance(item)
            break
          case 'toolOutStorageApproval':
            this.handleToolOutStorageApproval(item)
            break
          default:
            alert('没找到该流程')
@@ -431,6 +438,13 @@
          this.$refs.thirdMaintenanceApprovalModal.disableSubmit = false
        }
      },
      handleToolOutStorageApproval(item) {
        if (item && item.dataId) {
          this.selectOutBoundOrderData = Object.assign({}, item)
          this.$refs.outBoundOrderHandle.clearTableSource()
          this.$refs.outBoundOrderHandle.getAllApproveData(item)
        }
      }
    }
  }
</script>
src/views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,513 @@
<!--
 Description: å·¥ä½œæµ-出库申请单审批处理页面 List
 Author: ä½œè€… liuyh
 Date:   2025-02-27
-->
<template>
  <a-modal
    :title="title"
    :width="width"
    :visible="visible"
    :footer="null"
    @cancel="handCancel"
  >
    <a-card :bordered="false">
      <div>
        <b>{{ selectShenpiData.description }}</b>
        <br>
        <br>
        <a-tag color="blue">
          å¤„理人 {{ selectShenpiData.assignee }}
        </a-tag>
        <a-tag color="blue">
          åˆ›å»ºæ—¶é—´ {{ selectShenpiData.createTime }}
        </a-tag>
        <br>
        <br>
        <button @click="fetchAndShowBmp" class="btn-custom">打开流程图</button>
        <div v-if="imageSrc">
          <img :src="imageSrc" alt="Fetched Image" />
        </div>
        <hr class="shallow-hr">
      </div>
      <div>
        <b>申请详情</b>
        <br>
        <a-form :form='form'>
          <a-spin :spinning="spinning">
            <a-tabs default-active-key='1' @change='callback'>
              <a-tab-pane key='1' tab='申请基本信息'>
                <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label='出库单编号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='outNum'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.outNum'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='出库类型' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='outStorehouseType'>
                        <j-dict-select-tag :disabled="coldisabled" type="list" v-model="tableRowRecord.outStorehouseType" dictCode="out_storehouse_type" />
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label='出库时间' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='outboundTime'>
                        <j-date :disabled="coldisabled" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" v-model="tableRowRecord.outboundTime"/>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='领用事由' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='subjectMatter'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.subjectMatter'></a-input>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label='经手人' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='handler'>
                        <j-select-user-by-dep :disabled='coldisabled' v-model="tableRowRecord.handler" :store="'id'" :text="'realname'" :multi="false"/>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='备注' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='remark'>
                        <a-textarea :disabled="coldisabled" v-model="tableRowRecord.remark" rows="4" />
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </a-form-model>
              </a-tab-pane>
              <a-tab-pane key='2' tab='申请明细信息'>
                <a-table
                  ref="table"
                  size="middle"
                  bordered
                  rowKey="id"
                  :scroll="{x:'max-content'}"
                  :columns="columns"
                  :dataSource="dataSource"
                  :pagination="ipagination"
                  :loading="loading"
                  :rowSelection="null">
                </a-table>
              </a-tab-pane>
              <a-tab-pane key='3' tab='流程节点'>
                <a-timeline>
                  <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index">
                    <div>
                      <h3 style="font-weight: bold;">{{item.taskName}}</h3>
                      <div>处理人:{{item.assignee_dictText}}</div>
                      <div v-if="index !==0">处理时长:{{item.duration}}</div>
                      <div v-if="item.name !== '提交申请'">处理类型:{{item.sequenceFlowName}}</div>
                      <div v-if="item.description">处理意见:{{item.description}}</div>
                    </div>
                  </a-timeline-item>
                </a-timeline>
              </a-tab-pane>
            </a-tabs>
          </a-spin>
        </a-form>
      </div>
      <div>
        <hr class="shallow-hr">
        <br>
        <b>审批详情</b>
        <br>
        <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail">
          <a-row>
            <a-col ::span='span'>
              <a-form-model-item  label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop='handler_dictText'>
                <a-input :disabled='coldisabled' v-model='tableRowRecord.handler_dictText'></a-input>
              </a-form-model-item >
            </a-col>
            <a-col ::span='span'>
              <a-form-model-item  label="申请时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createTime">
                <a-input :disabled='coldisabled' v-model='tableRowRecord.createTime'></a-input>
              </a-form-model-item >
            </a-col>
            <a-col :span="24" class="btxx">
              <a-form-item label="审批状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <j-dict-select-tag  type='list' v-model='assignFileStream.status' dictCode='dnc_assign_stream_status' placeholder="请选择审批状态"  />
              </a-form-item>
            </a-col>
            <a-col :span="24" class="btxx">
              <a-form-model-item  label="审批意见" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-textarea v-model="assignFileStream.approveContent" rows="4" placeholder="请输入审批意见"/>
              </a-form-model-item >
            </a-col>
          </a-row>
          <div class="table-operator" style="text-align: right;">
            <a-button  @click="handleQueXiaoTask" type="primary" icon="close">取消</a-button>
            <a-button @click="submitForm">提 äº¤</a-button>
          </div>
        </a-form-model>
      </div>
    </a-card>
  </a-modal>
</template>
<script>
import '@assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
export default {
  name: 'FlowShenPi',
  mixins: [mixinDevice],
  props: {
    selectShenpiData: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      form: this.$form.createForm(this),
      span: 12,
      span1: 8,
      coldisabled: true,
      spinning: false,
      tableRowRecord: {},
      assignFileStream:{},
      tableDataSource: [],
      usageDataSource: [],
      hitaskDataSource:[],
      dataSource: [],
      bomForm: {},
      approveContent:"",
      imageSrc: null,
      drawerVisible: true,
      loading: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 30 },
        sm: { span: 16 }
      },
      /* åˆ†é¡µå‚æ•° */
      ipagination:{
        current: 1,
        pageSize: 5,
        pageSizeOptions: ['5', '10', '50'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key:'rowIndex',
          width:60,
          align:"center",
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title:'工具编码',
          align:"left",
          dataIndex: 'toolNum'
        },
        {
          title:'工具编号',
          align:"left",
          dataIndex: 'toolId'
        },
        {
          title:'工具类型',
          align:"center",
          dataIndex: 'applicationType_dictText'
        },
        {
          title:'中文名称',
          align:"center",
          dataIndex: 'chineseName'
        },
        {
          title:'型号/图号',
          align:"left",
          dataIndex: 'toolModel'
        },
        {
          title:'刀具材料',
          align:"center",
          dataIndex: 'toolMaterial'
        },
        {
          title:'零件材料',
          align:"center",
          dataIndex: 'partMaterial'
        },
        {
          title:'厂家',
          align:"center",
          dataIndex: 'supplierId'
        },
        {
          title:'仓库',
          align:"center",
          dataIndex: 'warehouseName'
        },
        {
          title:'出库库位',
          align:"center",
          dataIndex: 'outboundLocation'
        },
        {
          title:'可用库存数量',
          align:"left",
          dataIndex: 'quantity'
        },
        {
          title:'申请出库数量',
          align:"left",
          dataIndex: 'outboundQuantity'
        },
        {
          title:'创建时间',
          align:"left",
          dataIndex: 'createTime'
        }
      ],
      validatorRules: {
        version: {
          rules: [
            { required: true, message: '请输入文档版本!'},
          ]
        },
        applyUser: {
          rules: [
            { required: true, message: '请选择申请人!'},
          ]
        },
        approveContent: {
          rules: [
            { required: true, message: '请输入审批意见!'},
          ]
        },
        docName: {
          rules: [
            { required: true, message: '请输入文档名称!'},
          ]
        },
        status: {
          rules: [
            { required: true, message: '请选择审批状态!'},
          ]
        },
      },
      approveData: {},
      flowData: {},
      title: '审批页面',
      width: 1200,
      visible: false,
      // è¡¨å¤´
      url: {
        queryOutBoundOrder: '/tms/outboundOrder/queryById',
        queryOutBoundDetailList: '/tms/outboundOrder/listOutboundDetailByMainId',
        queryBomDataById: '/nc/activit/selectVoById',
        diagramView: '/assign/flow/diagramView',
        queryHisTaskList:'/assign/flow/queryHisTaskList',
        approve:"/nc/activit/assign/file/approve",
      },
      dictOptions: {},
      superFieldList: [],
      workflowSource: []
    }
  },
  created() {
  },
  computed: {},
  methods: {
    callback() {
    },
    handCancel() {
      this.visible = false
    },
    clearTableSource() {
      this.tableDataSource = []
      this.usageDataSource = []
    },
    fetchAndShowBmp() {
      console.log('flowData----->', this.flowData)
      try {
        let parm = {
          processDefinitionId: this.flowData.processDefinitionId,
          processInstanceId:this.flowData.processInstanceId,
          TaskDefinitionKey:this.flowData.processDefinitionKey
        }
        downFile(this.url.diagramView,parm,'get').then((res=>{
          console.log('Pica------>',res)
          const urlObject = window.URL.createObjectURL(new Blob([res]))
          this.imageSrc = urlObject
        }))
      } catch (error) {
        console.error('Error fetching image blob:', error)
        alert('无法加载图片,请稍后再试。')
      }
    },
    handleQueXiaoTask(){
      this.visible = false
      this.routeReload()
    },
    submitForm () {
      const that = this;
      if (!that.assignFileStream.status==null || that.assignFileStream.status===undefined){
        this.$message.warning('请选择审批状态!')
        return false;
      }
      if (!that.assignFileStream.approveContent==null || that.assignFileStream.approveContent===undefined) {
        this.$message.warning('请输入审批意见!')
        return false;
      }
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let url=this.url.approve
          let method = 'post';
          let flowTaskVo = {}
          flowTaskVo.status=that.assignFileStream.status;
          flowTaskVo.approveContent =that.assignFileStream.approveContent;
          flowTaskVo.comment =that.assignFileStream.approveContent;
          flowTaskVo.secretLevel = that.assignFileStream.secretLevel;
          flowTaskVo.dataId = this.selectShenpiData.dataId
          flowTaskVo.taskId = this.selectShenpiData.id
          flowTaskVo.userId = this.selectShenpiData.assignee
          flowTaskVo.instanceId = this.selectShenpiData.procInstId
          flowTaskVo.targetKey = this.selectShenpiData.taskDefKey
          flowTaskVo.values = this.selectShenpiData.variables
          flowTaskVo.assignee = this.selectShenpiData.assignee
          flowTaskVo.secretLevel = that.assignFileStream.secretLevel;
          console.log("表单提交数据",flowTaskVo)
          httpAction(url,flowTaskVo,method).then((res)=>{
            if(res.success){
              that.$message.success(res.message);
              that.visible = false
              //刷新表格
              that.$emit('searchReset')
            }else{
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
          })
        }
      })
    },
    getAllApproveData(item) {
      this.visible = true
      this.loading = true
      console.log('selectShenpiData----->', this.selectShenpiData)
      this.flowData = item
      getAction(this.url.queryHisTaskList, {procInstId: item.procInstId}).then(res=>{
        if(res.success){
          this.hitaskDataSource = res.result
        }
      })
      getAction(this.url.queryOutBoundOrder, {id: item.dataId}).then((res => {
        if (res.success) {
          this.tableRowRecord = res.result
        }
      }))
      getAction(this.url.queryOutBoundDetailList, {outStorehouseId: item.dataId}).then(res => {
        if (res.success) {
          this.dataSource = res.result.records
          if (res.result.total) {
            this.ipagination.total = res.result.total
          } else {
            this.ipagination.total = 0
          }
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    }
  }
}
</script>
<style scoped>
.shallow-hr {
  border: 0;
  height: 1px; /* åˆ†ç•Œçº¿çš„高度 */
  background-color: rgba(0, 0, 0, 0.1); /* ä½¿ç”¨ RGBA é¢œè‰²ï¼Œå¹¶è®¾ç½®è¾ƒä½Žçš„透明度 */
  margin: 20px 0; /* åˆ†ç•Œçº¿ä¸Šä¸‹çš„外边距 */
}
.btn-custom {
  background-color: #4CAF50; /* ç»¿è‰²èƒŒæ™¯ */
  color: white; /* ç™½è‰²æ–‡å­— */
  border: none; /* æ— è¾¹æ¡† */
  padding: 5px 15px; /* å†…边距 */
  text-align: center; /* æ–‡å­—居中 */
  text-decoration: none; /* æ— ä¸‹åˆ’线 */
  display: inline-block; /* è¡Œå†…块元素 */
  font-size: 12px; /* å­—体大小 */
  margin: 4px 2px; /* å¤–边距 */
  cursor: pointer; /* é¼ æ ‡æ‚¬åœæ—¶æ˜¾ç¤ºæ‰‹åž‹ */
  border-radius: 4px; /* åœ†è§’边框 */
}
.bold-large-label {
  font-weight: bold;
  font-size: 20px; /* æˆ–你需要的任何大小 */
}
.left_qiu{
  position: absolute;
  left: -74px;
  top: 0;
  width:54px;
  border-radius: 50%;
  height:54px;
  font-size: 13px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  background: #0099ff;
  transform: translate(0, 0);
}
/deep/ .ant-timeline-item-tail{
  left: -29px !important;
}
.left_qiu span{
  width: 3em;
  display: block;
  color: #fff;
  text-align: center;
}
.img{
  width: 75%;
}
.wrap{
  clear: both;
  width: 100%;
  display: flex;
  height: 50px;
  border: 1px solid #ccc;
  /* background-color: aqua; */
}
.box{
  width:21%;
  height:50px;
  border-right: 1px solid #ccc;
  line-height: 50px;
  /* background: red; */
  text-align:center;
  margin: auto;
}
@import '~@assets/less/common.less';
</style>
src/views/tms/OutboundDetailList.vue
@@ -131,9 +131,14 @@
            }
          },
          {
            title:'刀具编码',
            align:"center",
            title:'工具编码',
            align:"left",
            dataIndex: 'toolNum'
          },
          {
            title:'工具编号',
            align:"left",
            dataIndex: 'toolId'
          },
          {
            title:'工具类型',
@@ -147,7 +152,7 @@
          },
          {
            title:'型号/图号',
            align:"center",
            align:"left",
            dataIndex: 'toolModel'
          },
          {
@@ -176,13 +181,18 @@
            dataIndex: 'outboundLocation'
          },
          {
            title:'可用库存数量',
            align:"left",
            dataIndex: 'quantity'
          },
          {
            title:'申请出库数量',
            align:"center",
            align:"left",
            dataIndex: 'outboundQuantity'
          },
          {
            title:'实际出库数量',
            align:"center",
            align:"left",
            dataIndex: 'outActualCount'
          },
          {
@@ -192,7 +202,7 @@
          },
          {
            title:'创建时间',
            align:"center",
            align:"left",
            dataIndex: 'createTime'
          },
          // {
src/views/tms/OutboundOrderList.vue
@@ -154,7 +154,7 @@
          },
          {
            title:'出库单编号',
            align:"center",
            align:"left",
            dataIndex: 'outNum'
          },
          {
@@ -174,7 +174,7 @@
          },
          {
            title:'审核时间',
            align:"center",
            align:"left",
            dataIndex: 'auditDate'
          },
          {
@@ -184,7 +184,7 @@
          },
          {
            title:'申请出库时间',
            align:"center",
            align:"left",
            dataIndex: 'outboundTime'
          },
          {
@@ -209,7 +209,7 @@
          },
          {
            title:'创建时间',
            align:"center",
            align:"left",
            dataIndex: 'createTime'
          },
          {
src/views/tms/modules/outBound/OutboundOrderModal.vue
@@ -37,7 +37,7 @@
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="审核人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="reviewer">
              <j-select-user-by-dep :disabled="disableSubmit" v-model="model.reviewer" :store="'id'" :text="'realname'" :multi="false" />
              <j-select-user-by-dep :disabled="disableSubmit" v-model="model.reviewer" :store="'username'" :text="'realname'" :multi="false" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">