hyingbo
5 天以前 57ec2038f86f47a87db6b73c0c6eb27c1c25b08e
我的已办、仓库管理相关调整
已添加1个文件
已修改2个文件
510 ■■■■■ 文件已修改
src/views/flowable/workflow/FlowCompleted.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/inboundOrder/InboundOrderHandleXq.vue 479 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/WarehouseList.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowCompleted.vue
@@ -170,11 +170,11 @@
      ref='equipmentReturnApprovalModelRef'
      @searchReset='searchReset'
    />
    <inbound-order-handle
    <inbound-order-handle-xq
      ref='inboundOrderApprovalModal'
      :selectInboundOrderData='selectInboundOrderData'
      @searchReset='searchReset'
    ></inbound-order-handle>
    ></inbound-order-handle-xq>
    <second-maintenance-approval-modal
      ref='secondMaintenanceApprovalModal'
      :selectShenpiData='selectSecondMaintenanceData'
@@ -216,7 +216,7 @@
import GuideCardBatchXq from '@views/flowable/workflow/guideCardBatch/GuideCardBatchXq.vue'
import SecondMaintenanceApprovalModal from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue'
import ThirdMaintenanceApprovalModal from '@views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue'
import InboundOrderHandle from '@views/flowable/workflow/inboundOrder/InboundOrderHandle.vue'
import InboundOrderHandleXq from '@views/flowable/workflow/inboundOrder/InboundOrderHandleXq.vue'
export default {
  name: 'NcDeviceCharactersList',
@@ -239,7 +239,7 @@
    EquipmentReturnApprovalModal,
    SecondMaintenanceApprovalModal,
    ThirdMaintenanceApprovalModal,
    InboundOrderHandle,
    InboundOrderHandleXq,
    GuideCardBatchXq
  },
@@ -418,11 +418,11 @@
      this.$refs.equipmentReturnApprovalModelRef.disableSubmit = true
    },
    handleToolInStorage(item) {
      if (item && item.dataId) {
        this.selectInboundOrderData = Object.assign({}, item)
        this.$refs.inboundOrderApprovalModal.auditVisible = true
      console.log('item----->', item)
      this.selectInboundOrderData = item
      this.selectGuideCardData.title = item.description
      this.$refs.inboundOrderApprovalModal.clearTableSource()
        this.$refs.inboundOrderApprovalModal.getAllApproveData(item)
      }
    },
    handleSecondMaintenance(item) {
      if (item && item.dataId) {
src/views/flowable/workflow/inboundOrder/InboundOrderHandleXq.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,479 @@
<template>
  <a-modal
    :title="title"
    :width="width"
    :visible="visible"
    :footer="null"
    @cancel="handCancel"
  >
    <a-card :bordered="false">
      <div>
        <b>{{ selectInboundOrderData.description }}</b>
        <br>
        <br>
        <a-tag color="blue">
          å¤„理人 {{ selectInboundOrderData.assignee_dictText }}
        </a-tag>
        <a-tag color="blue">
          åˆ›å»ºæ—¶é—´ {{ selectInboundOrderData.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'>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label='入库单编号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='inboundNum'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.inboundNum'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='入库类型' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='inStorehouseType'>
                        <j-dict-select-tag :disabled="coldisabled" type="list" v-model="tableRowRecord.inStorehouseType" dictCode="in_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='inboundTime'>
                        <j-date :disabled="coldisabled" v-model="tableRowRecord.inboundTime" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" style="width: 100%"/>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='申请原因' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='applicationReason'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.applicationReason'></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'>
                        <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='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>
    </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: {
    selectInboundOrderData: {
      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: {},
      imageSrc: null,
      drawerVisible: true,
      auditVisible: 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:"center",
          dataIndex: 'toolCode'
        },
        {
          title:'工具类型',
          align:"center",
          dataIndex: 'applicationType'
        },
        {
          title:'中文名称',
          align:"center",
          dataIndex: 'chineseName'
        },
        {
          title:'型号/图号',
          align:"center",
          dataIndex: 'toolModel'
        },
        {
          title:'库位号',
          align:"center",
          dataIndex: 'goodsShelvesId'
        },
        {
          title:'申请入库数量',
          align:"center",
          dataIndex: 'inStorageQuantity'
        },
      ],
      validatorRules: {
        status: {
          rules: [
            { required: true, message: '请选择审批状态!'},
          ]
        },
      },
      approveData: {},
      flowData: {},
      title: '审批页面',
      width: 1200,
      visible: false,
      // è¡¨å¤´
      url: {
        queryInboundOrder: '/tms/inboundOrder/list',
        queryInboundDetailList: 'tms/inboundDetail/list',
        diagramView: '/assign/flow/diagramView',
        queryHisTaskList:'/assign/flow/queryHisTaskList',
        approve:"/tms/inboundOrder/approval",
      },
      dictOptions: {},
      superFieldList: [],
      workflowSource: [],
      isSubmitting: false,
    }
  },
  created() {
  },
  computed: {},
  methods: {
    callback() {
    },
    handCancel() {
      this.visible = false
    },
    clearTableSource() {
      this.tableDataSource = []
      this.usageDataSource = []
    },
    fetchAndShowBmp() {
      try {
        let parm = {
          processDefinitionId: this.flowData.processDefinitionId,
          processInstanceId:this.flowData.processInstanceId,
          TaskDefinitionKey:this.flowData.processDefinitionKey
        }
        downFile(this.url.diagramView,parm,'get').then((res=>{
          const urlObject = window.URL.createObjectURL(new Blob([res]))
          this.imageSrc = urlObject
        }))
      } catch (error) {
        console.error('Error fetching image blob:', error)
        alert('无法加载图片,请稍后再试。')
      }
    },
    handleQueXiaoTask() {
      // å¦‚果正在提交,阻止取消操作
      if (this.isSubmitting) return;
      this.visible = false;
      this.routeReload();
    },
    submitForm () {
      // å¦‚果正在提交,阻止重复点击
      if (this.isSubmitting) return;
      // å¼€å¯å…¨å±€ç¦é€‰
      this.isSubmitting = true;
      document.body.classList.add('submitting');
      const that = this;
      // å®šä¹‰ä¸€ä¸ªæ¢å¤çŠ¶æ€çš„å‡½æ•°
      const resetState = () => {
        that.isSubmitting = false;
        document.body.classList.remove('submitting');
      };
      if (!that.assignFileStream.status==null || that.assignFileStream.status===undefined){
        this.$message.warning('请选择审批状态!')
        return false;
      }
      if (!that.assignFileStream.approvalOpinion==null || that.assignFileStream.approvalOpinion===undefined) {
        this.$message.warning('请输入审批意见!')
        return false;
      }
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (err) {
          resetState(); // éªŒè¯å¤±è´¥ï¼Œæ¢å¤çŠ¶æ€
          return;
        }
        if (!err) {
          that.confirmLoading = true;
          let url=this.url.approve
          let method = 'post';
          let flowTaskVo = {}
          flowTaskVo.status=that.assignFileStream.status;
          flowTaskVo.approvalOpinion =that.assignFileStream.approvalOpinion;
          flowTaskVo.comment =that.assignFileStream.approvalOpinion;
          flowTaskVo.dataId = this.selectInboundOrderData.dataId
          flowTaskVo.taskId = this.selectInboundOrderData.id
          flowTaskVo.userId = this.selectInboundOrderData.assignee
          flowTaskVo.instanceId = this.selectInboundOrderData.procInstId
          flowTaskVo.targetKey = this.selectInboundOrderData.taskDefKey
          flowTaskVo.values = this.selectInboundOrderData.variables
          flowTaskVo.assignee = this.selectInboundOrderData.assignee
          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);
            }
          })
            .catch((error) => {
              console.error(error);
              that.$message.error('提交失败');
            })
            .finally(() => {
              that.confirmLoading = false;
              resetState(); // è¯·æ±‚结束,恢复状态
            });
        }
      })
    },
    getAllApproveData(item) {
      this.visible = true
      this.loading = true
      this.flowData = item
      getAction(this.url.queryHisTaskList, {procInstId: item.procInsId}).then(res=>{
        if(res.success){
          this.hitaskDataSource = res.result
        }
      })
      getAction(this.url.queryInboundOrder, {id: item.dataId}).then((res => {
        if (res.success) {
          this.tableRowRecord = res.result.records[0]
        }
      }))
      getAction(this.url.queryInboundDetailList, {inboundOrderId: 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>
/* å…¨å±€ç¦é€‰æ ·å¼ - ä½œç”¨äºŽæ•´ä¸ªé¡µé¢ */
html.submitting,
html.submitting body {
  pointer-events: none !important;
  cursor: wait !important;
}
/* è’™å±‚效果增强 */
html.submitting::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.5);
  z-index: 9998;
}
/* åŠ è½½æŒ‡ç¤ºå™¨ - æ›´æ˜Žæ˜¾çš„视觉反馈 */
html.submitting::after {
  content: '提交中...';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1890ff;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 9999;
}
/* ç¦ç”¨çŠ¶æ€æŒ‰é’®æ ·å¼ */
.disabled-btn {
  opacity: 0.6;
  cursor: not-allowed !important;
}
.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/WarehouseList.vue
@@ -268,7 +268,20 @@
    },
    methods: {
      handleAdd: function () {
        const nextSeq = Number(this.dataSource[this.dataSource.length - 1].seq) + 1
        let nextSeq = 0;
        // å®‰å…¨çš„写法
        if (this.dataSource && this.dataSource.length > 0) {
          const lastItem = this.dataSource[this.dataSource.length - 1];
          if (lastItem && lastItem.seq !== undefined) {
            nextSeq = Number(lastItem.seq) + 1;
          } else {
            // å¤„理最后一个元素不存在seq的情况
            nextSeq = 0; // æˆ–其他默认值
          }
        } else {
          // å¤„理数组为空的情况
          nextSeq = 0; // æˆ–其他默认值
        }
        this.$refs.modalForm.add(nextSeq);
        this.$refs.modalForm.title = "新增";
        this.$refs.modalForm.disableSubmit = false;