lyh
2025-03-19 bab64d0b2147a3e619e53d7417e40b5bd45fcfdb
修改产品结构树 增加流程修改
已添加1个文件
已修改15个文件
已删除2个文件
981 ■■■■ 文件已修改
src/views/dnc/base/ActivitiSingExamineList.vue 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/AssignApproveUserList.vue 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/NcDeviceCharactersList.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Component/ComponentInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Component/ComponentModalForm.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Part/PartInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Part/PartModalForm.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Process/ProcessInfo.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Process/ProcessModalForm.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepInfo.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModalForm.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/modeler/modelerDesign.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowCompleted.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowLedger.vue 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowNcZpi.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowTodo.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowXq.vue 385 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/ActivitiSingExamineList.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/AssignApproveUserList.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/NcDeviceCharactersList.vue
@@ -20,9 +20,11 @@
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="部门分组">
                <j-dict-select-tag v-model="queryParam.departId" placeholder="请选择部门分组" dictCode="sys_department,depart_name,depart_id"/>
            <a-col :md="4" :sm="4">
              <a-form-item label="车间名称">
                <!--<a-input placeholder="请输入车间名称" v-model="queryParam.productionName"></a-input>-->
                <a-tree-select v-model="queryParam.departId" :treeData="workshopTreeData" placeholder="请选择车间"
                               :treeDefaultExpandedKeys="treeDefaultExpandedKeys"></a-tree-select>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -129,6 +131,7 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import NcDeviceCharactersModal from './modules/NcDeviceCharacters/NcDeviceCharactersModal__Style#Drawer.vue'
import { queryProductionTreeList } from '@api/api'
export default {
  name: 'NcDeviceCharactersList',
@@ -199,9 +202,12 @@
        importExcelUrl: "mdc/mdcDriveTypeParamConfig/importExcel",
      },
      dictOptions:{},
      workshopTreeData: [],
      treeDefaultExpandedKeys: []
    }
  },
  created() {
    this.getWorkshopListByApi()
  },
  computed: {
    importExcelUrl: function(){
@@ -210,7 +216,18 @@
  },
  methods: {
    initDictConfig(){
    },
    /**
     * è°ƒç”¨æŽ¥å£èŽ·å–æŸ¥è¯¢åŒºåŸŸè½¦é—´æ ‘åˆ—è¡¨
     */
    getWorkshopListByApi() {
      queryProductionTreeList().then(res => {
        if (res.success) {
          this.workshopTreeData = res.result
          this.treeDefaultExpandedKeys = [...res.result].map(item => item.key)
    }
      })
    },
  }
}
</script>
src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersForm.vue
@@ -15,7 +15,6 @@
          </a-col>
          <a-col :span="24">
            <a-form-item label="所属车间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!--              <j-dict-select-tag type="list" v-decorator="['departId']" :trigger-change="true" dictCode="sys_department,depart_name,depart_id" placeholder="请选择所属部门"/>-->
              <j-select-equipment-production  v-model="model.departId" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>
            </a-form-item>
          </a-col>
@@ -145,7 +144,7 @@
        this.edit({});
      },
      backProductionInfo(info) {
        // console.log(info)
        console.log(info)
        this.model.productionIds = this.model.selectedProduction;
        this.nextProductionOptions = info.map((item,index,arr)=>{
          let c = {label:item.text, value: item.value+""}
src/views/dnc/base/modules/ProductStructure/Component/ComponentInfo.vue
@@ -9,7 +9,7 @@
    <a-descriptions-item label="装配类型">{{currentLevelDetails.assembleType}}</a-descriptions-item>
    <a-descriptions-item label="生产类型">{{currentLevelDetails.produceType}}</a-descriptions-item>
    <a-descriptions-item label="处理类型    ">{{currentLevelDetails.processType}}</a-descriptions-item>
    <a-descriptions-item label="结构类型    ">{{currentLevelDetails.structureType}}</a-descriptions-item>
    <a-descriptions-item label="材质">{{currentLevelDetails.structureType}}</a-descriptions-item>
    <a-descriptions-item label="重量" >{{currentLevelDetails.componentWeight}}</a-descriptions-item>
    <a-descriptions-item label="创建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item>
    <a-descriptions-item label="创建时间">{{currentLevelDetails.createTime}}</a-descriptions-item>
src/views/dnc/base/modules/ProductStructure/Component/ComponentModalForm.vue
@@ -47,8 +47,8 @@
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="结构类型">
            <a-input v-model="model.structureType" placeholder="请输入结构类型"></a-input>
          <a-form-model-item label="材质">
            <a-input v-model="model.structureType" placeholder="请输入材质"></a-input>
          </a-form-model-item>
        </a-col>
      </a-row>
src/views/dnc/base/modules/ProductStructure/Part/PartInfo.vue
@@ -9,7 +9,7 @@
    <a-descriptions-item label="装配类型">{{currentLevelDetails.assembleType}}</a-descriptions-item>
    <a-descriptions-item label="生产类型">{{currentLevelDetails.produceType}}</a-descriptions-item>
    <a-descriptions-item label="处理类型    ">{{currentLevelDetails.processType}}</a-descriptions-item>
    <a-descriptions-item label="结构类型    ">{{currentLevelDetails.structureType}}</a-descriptions-item>
    <a-descriptions-item label="材质">{{currentLevelDetails.structureType}}</a-descriptions-item>
    <a-descriptions-item label="重量">{{currentLevelDetails.partsWeight}}</a-descriptions-item>
    <a-descriptions-item label="创建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item>
    <a-descriptions-item label="创建时间">{{currentLevelDetails.createTime}}</a-descriptions-item>
src/views/dnc/base/modules/ProductStructure/Part/PartModalForm.vue
@@ -47,8 +47,8 @@
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="结构类型">
            <a-input v-model="model.structureType" placeholder="请输入结构类型"></a-input>
          <a-form-model-item label="材质">
            <a-input v-model="model.structureType" placeholder="请输入材质"></a-input>
          </a-form-model-item>
        </a-col>
      </a-row>
src/views/dnc/base/modules/ProductStructure/Process/ProcessInfo.vue
@@ -6,7 +6,6 @@
    <a-descriptions-item label="工序类型">{{currentLevelDetails.processType}}</a-descriptions-item>
    <a-descriptions-item label="加工设备型号">{{currentLevelDetails.processingEquipmentModel}}</a-descriptions-item>
    <a-descriptions-item label="加工设备类型">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item>
    <a-descriptions-item label="加工设备编号">{{currentLevelDetails.processingEquipmentCode}}</a-descriptions-item>
    <a-descriptions-item label="工装编号">{{currentLevelDetails.assembleStep}}</a-descriptions-item>
    <a-descriptions-item label="工装名称">{{currentLevelDetails.assembleName}}</a-descriptions-item>
    <a-descriptions-item label="创建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item>
src/views/dnc/base/modules/ProductStructure/Process/ProcessModalForm.vue
@@ -15,14 +15,6 @@
      </a-row>
      <a-row>
        <a-col :span="24">
          <a-form-model-item label="加工设备编号" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
            <j-dict-select-tag v-model="model.processingEquipmentCode" placeholder="请选择加工设备编号" dictCode="mdc_equipment,equipment_id,equipment_id"/>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :span="12">
          <a-form-model-item label="加工设备型号">
            <a-input v-model="model.processingEquipmentModel" placeholder="请输入加工设备型号"></a-input>
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepInfo.vue
@@ -5,7 +5,6 @@
    <a-descriptions-item label="工步类型">{{currentLevelDetails.stepType}}</a-descriptions-item>
    <a-descriptions-item label="加工设备型号">{{currentLevelDetails.processingEquipmentModel}}</a-descriptions-item>
    <a-descriptions-item label="加工设备类型">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item>
    <a-descriptions-item label="加工设备编号">{{currentLevelDetails.deviceNo}}</a-descriptions-item>
    <a-descriptions-item label="工装编号">{{currentLevelDetails.assembleStep}}</a-descriptions-item>
    <a-descriptions-item label="工装名称">{{currentLevelDetails.assembleName}}</a-descriptions-item>
    <a-descriptions-item label="创建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item>
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModalForm.vue
@@ -15,14 +15,6 @@
      </a-row>
      <a-row>
        <a-col :span="24">
          <a-form-model-item label="加工设备编号" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
            <j-dict-select-tag v-model="model.deviceNo" placeholder="请选择加工设备编号" dictCode="mdc_equipment,equipment_id,equipment_id"/>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :span="12">
          <a-form-model-item label="加工设备型号">
            <a-input v-model="model.processingEquipmentModel" placeholder="请输入加工设备型号"></a-input>
src/views/flowable/modeler/modelerDesign.vue
@@ -274,17 +274,17 @@
          definition.hasChildren = true
        }
      });
      // æ‰€æœ‰
      const param2 = Object.assign({
        isLastVersion:0
      },this.queryParams,{
        pageSize: 9999,
        pageNum:1
      })
      listDefinition(param2).then(response => {
        console.log(response)
        this.allDefinitionList = response.result.records;
      });
      // // æ‰€æœ‰
      // const param2 = Object.assign({
      //   isLastVersion:0
      // },this.queryParams,{
      //   pageSize: 9999,
      //   pageNum:1
      // })
      // listDefinition(param2).then(response => {
      //   console.log(response)
      //   this.allDefinitionList = response.result.records;
      // });
    },
    /** é‡ç½®æŒ‰é’®æ“ä½œ */
    resetQuery() {
src/views/flowable/workflow/FlowCompleted.vue
@@ -10,14 +10,8 @@
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程名称">
              <a-input placeholder="请输入流程名称" v-model="queryParam.deviceNo"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="流程分类">
                <j-dict-select-tag v-model="queryParam.departId" placeholder="请选择流程分类" dictCode="sys_department,depart_name,depart_id"/>
              <j-dict-select-tag placeholder="请选择流程分类" v-model="queryParam.category" dictCode="flow_type"></j-dict-select-tag>
              </a-form-item>
            </a-col>
            <a-col :xl="10" :lg="11" :md="12" :sm="24">
@@ -27,12 +21,10 @@
                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.endTime"></j-date>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">{{ toggleSearchStatus ? '收起' : '展开' }}<a-icon :type="toggleSearchStatus ? 'up' : 'down'" /></a>
            </span>
          </a-col>
        </a-row>
@@ -83,7 +75,7 @@
      </a-table>
    </div>
    <FlowNcZpi ref="modalFormApproval" :selectShenpiData="selectShenpiData"></FlowNcZpi>
    <FlowXq ref="modalFormApproval" :selectShenpiData="selectShenpiData"></FlowXq>
  </a-card>
</template>
@@ -94,13 +86,13 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import FlowNcZpi from '@views/flowable/workflow/FlowNcZpi.vue'
import FlowXq from '@views/flowable/workflow/FlowXq.vue'
export default {
  name: 'NcDeviceCharactersList',
  mixins:[JeecgListMixin, mixinDevice],
  components: {
    FlowNcZpi,
    FlowXq,
    JDictSelectTag,
  },
  data () {
@@ -119,6 +111,12 @@
          }
        },
        {
          title: '流程分类',
          align: "center",
          dataIndex: 'category_dictText',
          width: 200,
        },
        {
          title: '流程名称',
          align: "center",
          dataIndex: 'procDefName',
src/views/flowable/workflow/FlowLedger.vue
@@ -10,24 +10,18 @@
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.deviceNo"></a-input>
          <a-form-item label="流程分类">
            <j-dict-select-tag placeholder="请选择流程分类" v-model="queryParam.category" dictCode="flow_type"></j-dict-select-tag>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="特殊字符">
              <a-input placeholder="请输入特殊字符" v-model="queryParam.characters"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="部门分组">
                <j-dict-select-tag v-model="queryParam.departId" placeholder="请选择部门分组" dictCode="sys_department,depart_name,depart_id"/>
            <a-form-item label="流程名称">
              <a-input placeholder="请输入流程名称" v-model="queryParam.flowName"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="数控系统">
                <a-input placeholder="请输入数控系统" v-model="queryParam.controlSystem"></a-input>
            <a-form-item label="简要描述">
              <a-input placeholder="请输入简要描述" v-model="queryParam.title"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="10" :lg="11" :md="12" :sm="24">
@@ -37,12 +31,10 @@
                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.endTime"></j-date>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">{{ toggleSearchStatus ? '收起' : '展开' }}<a-icon :type="toggleSearchStatus ? 'up' : 'down'" /></a>
            </span>
          </a-col>
        </a-row>
@@ -89,31 +81,13 @@
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
            <a @click="handelDetial(record,text)">详情</a>
        </span>
      </a-table>
    </div>
    <FlowXq ref="modalFormApproval" :selectShenpiData="selectShenpiData"></FlowXq>
  </a-card>
</template>
@@ -124,11 +98,13 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import FlowXq from '@views/flowable/workflow/FlowXq.vue'
export default {
  name: 'NcDeviceCharactersList',
  mixins:[JeecgListMixin, mixinDevice],
  components: {
    FlowXq,
    JDictSelectTag,
  },
  data () {
@@ -145,6 +121,12 @@
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title: '流程分类',
          align: "center",
          dataIndex: 'category_dictText',
          width: 200,
        },
        {
          title:'流程名称',
@@ -209,6 +191,7 @@
        list: "nc/assign/flow/list",
      },
      dictOptions:{},
      selectShenpiData: {},
    }
  },
  created() {
@@ -219,8 +202,31 @@
    },
  },
  methods: {
    initDictConfig(){
    handelDetial(item, index) {
      console.log('点击了详情')
      console.log('item----->', item)
      console.log('index----->', index)
      let approcesstype = this.splitAprocessType(item.title)
      console.log('approcesstype--->', approcesstype)
      switch (approcesstype) {
        case '指派NC文档到设备流程':
          item.description=item.title
          this.handDrDetial(item)
          break
        default:
          alert('没找到该审批')
    }
    },
    splitAprocessType(title) {
      let parts = title.split(':') // æ³¨æ„å†’号是全角字符,使用对应的字进行分割
      let result = parts[0]
      return result
    },
    handDrDetial(item) {
      this.selectShenpiData = item
      this.$refs.modalFormApproval.clearTableSource()
      this.$refs.modalFormApproval.getAllApproveData(item)
    },
  }
}
</script>
src/views/flowable/workflow/FlowNcZpi.vue
@@ -71,6 +71,18 @@
                  </a-row>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label='设备类名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='deviceManagementCode'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.deviceManagementCode'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='设备类名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='deviceManagementName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.deviceManagementName'></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='docName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.docName'></a-input>
                      </a-form-model-item>
@@ -92,7 +104,8 @@
                        <p>结束时间:{{item.endTime}}</p>
                        <p>处理人:{{item.assignee}}</p>
                        <p>办理类型:{{item.bllx_dictText}}</p>
                        <p>处理意见:{{item.cause}}</p>
                        <p v-if="item.name == '提交申请'">指派原因:{{item.cause}}</p>
                        <p v-else >处理意见:{{item.cause}}</p>
                        <div  class="left_qiu"><span>{{item.name}}</span></div>
                      </div>
                    </a-timeline-item>
@@ -253,7 +266,9 @@
      console.log('flowData----->', this.flowData)
      try {
        let parm = {
          taskId: this.flowData.id
          processDefinitionId: this.flowData.processDefinitionId,
          processInstanceId:this.flowData.processInstanceId,
          TaskDefinitionKey:this.flowData.processDefinitionKey
        }
        downFile(this.url.diagramView,parm,'get').then((res=>{
          console.log('Pica------>',res)
src/views/flowable/workflow/FlowTodo.vue
@@ -10,6 +10,11 @@
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程分类">
              <j-dict-select-tag placeholder="请选择流程分类" v-model="queryParam.category" dictCode="flow_type"></j-dict-select-tag>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程名称">
              <a-input placeholder="请输入流程名称" v-model="queryParam.flowName"></a-input>
            </a-form-item>
@@ -121,6 +126,12 @@
          }
        },
        {
          title: '流程分类',
          align: "center",
          dataIndex: 'category_dictText',
          width: 200,
        },
        {
          title: '流程名称',
          align: "center",
          dataIndex: 'flowName',
src/views/flowable/workflow/FlowXq.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,385 @@
<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='productName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.productName'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='部件名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='componentId'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.componentName'></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='partsName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.partsName'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='工序名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='processName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.processName'></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='stepName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.stepName'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='设备名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='deviceName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.deviceName'></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='deviceManagementCode'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.deviceManagementCode'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='设备类名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='deviceManagementName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.deviceManagementName'></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='docName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.docName'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='文档版本' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='version'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.version'></a-input>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </a-form-model>
              </a-tab-pane>
              <a-tab-pane key='2' tab='流程节点'>
                <a-card>
                  <a-timeline style="padding:0 1% 0 12%" >
                    <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1">
                      <div class="bottom">
                        <p>开始时间:{{item.startTime}}</p>
                        <p>结束时间:{{item.endTime}}</p>
                        <p>处理人:{{item.assignee}}</p>
                        <p v-if="item.name !== '提交申请'">办理类型:{{item.status_dictText}}</p>
                        <p v-if="item.name === '提交申请'">指派原因:{{item.cause}}</p>
                        <p v-else >处理意见:{{item.cause}}</p>
                        <div  class="left_qiu"><span>{{item.name}}</span></div>
                      </div>
                    </a-timeline-item>
                  </a-timeline>
                </a-card>
              </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: {
    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:[],
      bomForm: {},
      approveContent:"",
      imageSrc: null,
      drawerVisible: true,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 30 },
        sm: { span: 16 }
      },
      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: 1000,
      visible: false,
      // è¡¨å¤´
      url: {
        queryBomDataById: '/nc/activit/selectVoById',
        diagramView: '/nc/assign/flow/diagramView',
        queryHisTaskList:'/nc/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.$emit('ok');
            }else{
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
          })
        }
      })
    },
    getAllApproveData(item) {
      console.log('selectShenpiData----->', this.selectShenpiData)
      this.flowData = item
      let param = {
        'id': item.dataId
      }
      let parmhis={
        'drapprovedataId': item.dataId
      }
      getAction(this.url.queryHisTaskList,parmhis).then(res=>{
        this.hitaskDataSource=res.result
        getAction(this.url.queryBomDataById, param).then((res => {
          if (res.success) {
            this.tableRowRecord = res.result
            console.log('this.tableRowRecord----->', this.tableRowRecord)
          }
        }))
      }).finally(
        this.visible = true,
        console.log('this.approveData---->', this.approveData)
      )
    }
  }
}
</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>