Houjie
2025-05-26 599f3bc9e3455f4ed0702e86875cdd9acd15fc87
Merge remote-tracking branch 'origin/master'
已添加7个文件
已修改2个文件
2222 ■■■■■ 文件已修改
src/views/flowable/workflow/FlowTodo.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/inboundOrder/InboundOrderHandle.vue 445 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/InboundOrderList.vue 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/baseTools/BaseToolsListLeft.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/InboundDetailList.vue 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/InboundOrderModel.vue 600 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/JSelectReturnListModal.vue 290 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/JSelectSharpenListModal.vue 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/JSelectToolingModal.vue 254 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowTodo.vue
@@ -136,6 +136,8 @@
    <third-maintenance-approval-modal ref="thirdMaintenanceApprovalModal" :selectShenpiData="selectThirdMaintenanceData"
                                      @searchReset="searchReset"></third-maintenance-approval-modal>
    <equipment-seal-up-approval-modal ref="equipmentSealUpApprovalModelRef" @searchReset="searchReset" />
    <inbound-order-handle ref="inboundOrderApprovalModal" :selectInboundOrderData="selectInboundOrderData"
                                     @searchReset="searchReset"></inbound-order-handle>
  </a-card>
</template>
@@ -163,6 +165,7 @@
import EquipmentSealUpApprovalModal from '@views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue'
import stocktakingBoundHandle from '@views/flowable/workflow/stocktakingBound/stocktakingBoundHandle.vue'
import lossBoundHandle from '@views/flowable/workflow/lossBound/lossBoundHandle.vue'
import InboundOrderHandle from '@views/flowable/workflow/inboundOrder/InboundOrderHandle.vue'
export default {
  name: 'NcDeviceCharactersList',
@@ -183,7 +186,8 @@
    SecondMaintenanceApprovalModal,
    ThirdMaintenanceApprovalModal,
    OutBoundOrderHandle,
    EquipmentSealUpApprovalModal
    EquipmentSealUpApprovalModal,
    InboundOrderHandle
  },
  data() {
    return {
@@ -268,6 +272,7 @@
      selectOutBoundOrderData: {},
      selectLossBoundOrderData: {},
      selectStocktakingBoundOrderData: {},
      selectInboundOrderData:{},
      //业务信息ID
      dataId: undefined
    }
@@ -359,6 +364,9 @@
          break
        case 'equipment_seal_up':
          this.handleEquipmentSealUp(item)
          break
        case 'toolInStorageApproval':
          this.handleToolInStorage(item)
          break
        default:
          alert('没找到该流程')
@@ -495,7 +503,15 @@
      this.$refs.equipmentSealUpApprovalModelRef.title = item.name
      this.$refs.equipmentSealUpApprovalModelRef.handleDetail(item)
      this.$refs.equipmentSealUpApprovalModelRef.disableSubmit = false
    }
    },
    handleToolInStorage(item) {
      if (item && item.dataId) {
          this.selectInboundOrderData = Object.assign({}, item)
          this.$refs.inboundOrderApprovalModal.auditVisible = true
          this.$refs.inboundOrderApprovalModal.clearTableSource()
          this.$refs.inboundOrderApprovalModal.getAllApproveData(item)
      }
    },
  }
}
</script>
src/views/flowable/workflow/inboundOrder/InboundOrderHandle.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,445 @@
<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>
      <div v-if="auditVisible">
        <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">
                <a-select v-model='assignFileStream.status' placeholder="请选择审批结果">
                  <a-select-option value="3">通过</a-select-option>
                  <a-select-option value="4">驳回</a-select-option>
                </a-select>
              </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.approvalOpinion" 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: {
    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: '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: []
    }
  },
  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(){
      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.approvalOpinion==null || that.assignFileStream.approvalOpinion===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.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);
            }
          }).finally(() => {
            that.confirmLoading = false;
          })
        }
      })
    },
    getAllApproveData(item) {
      this.visible = true
      this.loading = true
      this.flowData = item
      getAction(this.url.queryHisTaskList, {procInstId: item.procInstId}).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>
.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/InboundOrderList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,243 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="入库申请单编号">
              <a-input placeholder="请输入入库申请单编号" v-model="queryParam.inboundNum" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="入库类型">
                <j-search-select-tag
                  placeholder="请选择入库类型"
                  v-model="queryParam.inStorehouseType"
                  dict="in_storehouse_type"
                />
              </a-form-item>
            </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="经手人">
                <j-search-select-tag
                  placeholder="请选择经手人"
                  v-model="queryParam.handler"
                  dict="sys_user,realname,id,del_flag!=1"
                />
              </a-form-item>
            </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
      <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>
    <!-- table区域-begin -->
    <a-table
      ref="table"
      size="middle"
      bordered
      rowKey="id"
      :customRow="customRow"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
      <!--状态栏个性展示-->
      <span slot="action" slot-scope="text, record">
        <a href="javascript:;" @click="handleEdit(record)" v-if="record.orderStatus == '1'">编辑</a>
        <a-divider type="vertical" v-if="record.orderStatus == '1'" />
        <a href="javascript:;" @click="handleDetail(record)">详情</a>
        <a-divider type="vertical"  v-if="record.orderStatus == '1'"/>
        <a href="javascript:;" @click="handleSubmit(record)" v-if="record.orderStatus == '1'">提交</a>
      </span>
    </a-table>
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="工具入库明细" key="1">
        <inbound-detail-list ref="inboundDetailList"></inbound-detail-list>
      </a-tab-pane>
    </a-tabs>
    <!-- table区域-end -->
    <inbound-order-model ref="modalForm" @ok="modalFormOk"></inbound-order-model>
  </a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import InboundOrderModel from './modules/inbound/InboundOrderModel'
import InboundDetailList from './modules/inbound/InboundDetailList'
import { requestPut } from '@/api/manage'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
import { postAction,getAction } from '../../api/manage'
export default {
  name: 'InboundOrderList',
  mixins: [JeecgListMixin],
  components: {
    InboundOrderModel,
    InboundDetailList,
    JDictSelectTag,
    JSearchSelectTag,
  },
  data() {
    return {
      description: '入库申请单',
      url: {
        list: '/tms/inboundOrder/list',
        toolingStorageStatus: '/tooling/storage/toolingStorageStatus',
        importExcelUrl: 'tooling/storage/importExcel',
        exportXlsUrl: '/tooling/storage/exportXls',
        takeBack: '/tooling/storage/takeBack',
        edit:'/tms/inboundOrder/edit',
        submit:'/tms/inboundOrder/submit'
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '入库申请单编号',
          align: 'center',
          dataIndex: 'inboundNum',
          sorter: true,
        },
        {
          title: '入库单类型',
          align: 'center',
          dataIndex: 'inStorehouseType_dictText',
        },
        {
          title: '经手人',
          align: 'center',
          dataIndex: 'handler_dictText',
        },
        {
          title: '申请原因',
          align: 'center',
          dataIndex: 'applicationReason',
        },
        {
          title: '入库时间',
          align: 'center',
          dataIndex: 'inboundTime',
          sorter: true,
        },
        {
          title: '审核人',
          align: 'center',
          dataIndex: 'reviewer_dictText',
        },
        {
          title: '审核时间',
          align: 'center',
          dataIndex: 'approvalDate',
          sorter: true,
        },
        {
          title: '审核状态',
          align: 'center',
          dataIndex: 'orderStatus_dictText',
        },
         {
          title: '借用单号',
          align: 'center',
          dataIndex: 'borrowNum',
        },
         {
          title: '审批意见',
          align: 'center',
          dataIndex: 'approvalOpinion',
        },
        {
          width: 150,
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
    }
  },
  computed: {
    /* å¯¼å…¥è·¯å¾„页面重新计算 */
    importExcelUrl: function () {
      //  return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;//开发环境指向
      return `${window._CONFIG['hxFileURL']}/${this.url.importExcelUrl}`
    },
  },
  methods: {
    searchReset() {
      this.queryParam = {}
      this.$refs.inboundDetailList.dataSource = []
      this.loadData(1);
    },
    customRow(record) {
      return {
        on: {
          click: (e) => {
            //将当前选中的记录传到子页面
            this.$bus.$emit('getToolingStorageData', record)
            //点击当前行变色
            let oldList = document.querySelectorAll('.checked-td-of-add-table')
            if (oldList) {
              for (let j = 0; j < oldList.length; j++) {
                oldList[j].classList.remove('checked-td-of-add-table')
              }
            }
            let children = e.target.parentNode.children
            for (let i = 0; i < children.length; i++) {
              children[i].classList.add('checked-td-of-add-table')
            }
          },
        },
      }
    },
    handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
    },
    handleAdd() {
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
    },
    handleSubmit(record) {
        let that = this;
        getAction(that.url.submit, { id:record.id}).then((res) => {
          if (res.success) {
            that.$message.success(res.message);
            that.loadData();
          } else {
            that.$message.warning(res.message);
          }
        })
      },
  },
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
/deep/ .notshow {
  display: none;
}
/deep/ .checked-td-of-add-table {
  background-color: rgba(220, 220, 220, 1);
}
</style>
src/views/tms/modules/baseTools/BaseToolsListLeft.vue
@@ -20,7 +20,7 @@
          >取消</a>
        </div>
      </a-alert>
      <div class="drawer-bootom-button">
      <!-- <div class="drawer-bootom-button">
        <a-dropdown
          :trigger="['click']"
          placement="bottomCenter"
@@ -43,7 +43,7 @@
            <a-icon type="bars" />
          </a-button>
        </a-dropdown>
      </div>
      </div> -->
      <a-input-search
        @search="handleSearch"
@@ -57,11 +57,12 @@
      <!-- showLine -->
      <a-tree
        :checkStrictly="checkStrictly"
        :expandedKeys.sync="expandedKeys"
        :selectedKeys="selectedKeys"
        :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
        :treeData="treeDataSource"
        :autoExpandParent="autoExpandParent"
        :defaultExpandAll="true"
        @select="onSelect"
        @expand="onExpand"
      >
src/views/tms/modules/inbound/InboundDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
    </a-table>
  </a-card>
</template>
<script>
import { requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'InboundDetailList',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      url: {
        list: '/tms/inboundDetail/list',
      },
      queryParam: {},
      nodeType: 0,
      dataSource: [],
      disableMixinCreated:true,
      columns: [
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
          width: '10%',
          key: 'toolCode'
        },
        {
          title: '工具名称',
          dataIndex: 'chineseName',
          align: 'center',
          key: 'toolName'
        },
        {
          title: '型号/图号',
          dataIndex: 'toolModel',
          align: 'center',
          key: 'toolModel'
        },
        {
          title: '工具分类',
          dataIndex: 'applicationType',
          align: 'center',
        },
         {
          title: '入库数量',
          dataIndex: 'inStorageQuantity',
          align: 'center',
        }
      ]
    }
  },
  methods: {
  },
  mounted() {
    this.$bus.$on('getToolingStorageData', (data) => {
      this.queryParam.inboundOrderId = data.id;
      this.searchQuery();
    })
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/tms/modules/inbound/InboundOrderModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,600 @@
<template>
  <a-modal
    :title="title"
    :visible="visible"
    :fullScreen="true"
    :width="1200"
    @ok="handleOk"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="入库申请单编号">
              <a-input :disabled="true" placeholder="系统自动生成" v-decorator="['inboundNum', validatorRules.inboundNum]" />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="入库类型">
              <j-dict-select-tag
                :disabled="disableSubmit"
                type="list"
                v-decorator="['inStorehouseType', validatorRules.inStorehouseType]"
                :triggerChange="true"
                dictCode="in_storehouse_type"
                placeholder="请选择入库类型"
                @change="handleTypeChange"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="入库时间">
              <a-date-picker
                @change="onChange"
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['inboundTime', validatorRules.inboundTime]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item label="申请原因" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input placeholder="请输入申请原因"  :disabled="disableSubmit" v-decorator="['applicationReason', validatorRules.applicationReason]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item label="经手人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="true"
                v-if="!barcodeCurrentType"
                placeholder="请选择经手人"
                v-decorator="['handler', { rules: [{ required: false, message: '请选择经手人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
                @change="selectCurrentUserChange"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item label="审核人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="true"
                placeholder="请选择审核人"
                v-decorator="['reviewer', validatorRules.reviewer]"
                dict="sys_user,realname,id,del_flag=0"
                @change="selectCurrentUserChange"
              />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="审核时间">
              <a-date-picker
                @change="onChange"
                :disabled="true"
                style="width: 100%"
                v-decorator="['approvalDate', validatorRules.approvalDate]"
              />
            </a-form-item>
          </a-col>
           <a-col :span="24 / 2">
            <a-form-item label="审核意见" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input placeholder="请输入审核意见" :disabled="true" v-decorator="['approvalOpinion', validatorRules.approvalOpinion]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }" label="备注">
              <a-textarea
                :disabled="disableSubmit"
                :rows="2"
                placeholder="..."
                v-decorator="['remark', validatorRules.remark]"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectReturnList()" v-show="returnShow && !disableSubmit">选择借用出库单</a-button>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" v-show="toolingShow && !disableSubmit">选择工具</a-button>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectSharpenList()" v-show="sharpenShow && !disableSubmit">选择刃磨出库单</a-button>
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
       @change="handleTableChange"
    >
      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
        <div :key="col.dataIndex">
          <a-input-number
            v-if="col.dataIndex == 'inStorageQuantity'"
            :disabled="quantityDisable"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
          />
        </div>
      </template>
      <span slot="action" slot-scope="text, record, index">
        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record, index)" :disabled="disableSubmit">
          <a>删除</a>
        </a-popconfirm>
      </span>
    </a-table>
    <template slot="footer" v-if="disableSubmit == false">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
      <a-button @click="handleOk" :disabled="isDisabled" type="primary">确定</a-button>
    </template>
    <template slot="footer" v-if="disableSubmit == true">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
    </template>
    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>
    <j-select-return-list-modal ref="returnModalForm" @ok="modalFormOk"></j-select-return-list-modal>
    <j-select-sharpen-list-modal ref="sharpenModalForm" @ok="modalFormOk"></j-select-sharpen-list-modal>
  </a-modal>
</template>
<script>
import pick from 'lodash.pick'
import JSelectToolingModal from './JSelectToolingModal'
import { ajaxGetDictItems } from '@/api/api'
import moment from 'moment'
import { getAction, postAction, requestPut } from '@/api/manage'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
import { filterObj } from '@/utils/util'
import JSelectReturnListModal from './JSelectReturnListModal'
import JSelectSharpenListModal from './JSelectSharpenListModal'
export default {
  name: 'InboundOrderModel',
  components: {
    JSelectToolingModal,
    JMultiSelectTag,
    JDictSelectTag,
    JSelectReturnListModal,
    JSearchSelectTag,
    JSelectSharpenListModal,
  },
  data() {
    return {
     /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      isDisabled: false,
      selectedRowKeys: {},
      state: {
        show: false,
        maintenanceValue: 1,
        checkValue: 1,
        maintenanceState: false,
        checkState: false,
      },
      inboundDate: '',
      applicationDate: '',
      supplierShow: false,
      disableSubmit: false,
      numDisable:false,
      quantityDisable:false,
      onlyCodeDisable:true,
      returnShow:false,
      toolingShow:false,
      sharpenShow:false,
      addDisable:false,
      toolinngOptions:[],
      title: '操作',
      visible: false,
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      toolingTreeData:[],
      warehouseOptions:[],
      locationOptions:[],
      allToolingList:[],
      param: {},
      barcodeCurrentType: false,
      inboundOrderId:'',
      validatorRules: {
        type: {
          rules: [
            {
              required: true,
              message: '请选择入库类型!',
            },
          ],
        },
        inboundDate: {
          rules: [
            {
              required: true,
              message: '请选择申请入库日期!',
            },
          ],
        },
        applicant: {
          rules: [
            {
              required: true,
              message: '请选择申请人!',
            },
          ],
        },
      },
      url: {
        add: '/tms/inboundOrder/add',
        edit: '/tms/inboundOrder/edit',
        queryByUserName: '/sys/user/queryByUserName',
        toolingList:'/tms/baseTools/list',
        queryAccountList:'/tooling/storage/queryAccountList',
        querySharpenList:'/sharpen/sharpenDetail/querySharpenList',
        queryReturnList:'/returnInventory/queryReturnList',
        detailList:'/tms/inboundDetail/list',
      },
      toolingOptions:[],
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
           width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
          width: 150,
        },
        {
          title: '工具类型',
          align: 'center',
          dataIndex: 'applicationType'
        },
        {
          title: '中文名称',
          align: 'center',
          dataIndex: 'chineseName',
        },
        {
          title: '型号/图号',
          align: 'center',
          dataIndex: 'toolModel'
        },
        {
          title: '入库数量',
          align: 'center',
          dataIndex: 'inStorageQuantity',
          scopedSlots: { customRender: 'inStorageQuantity' },
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
    }
  },
  created() {},
  methods: {
    modalFormOk() {
    },
    getQueryParams() {
      this.param.pageNo = this.ipagination.current
      this.param.pageSize = this.ipagination.pageSize
      return filterObj(this.param)
    },
    add() {
      this.edit({})
    },
    edit(record) {
      let that = this
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.visible = true
      this.isDisabled = false
      this.disableSubmit = false
      if (record.id) {
        if(record.inStorehouseType == "1"){
          this.toolingShow = true
        }else if(record.inStorehouseType == "2"){
          this.returnShow = true
        }else if(record.inStorehouseType == "5"){
            this.sharpenShow = true
        }
        this.inboundOrderId = record.id
        this.detailList(this.inboundOrderId)
      }
      this.initOptions()
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'inboundNum', 'inStorehouseType', 'inboundTime', 'applicationReason', 'handler','approvalDate','reviewer','approvalOpinion','remark')
        )
      })
    },
    handleChange(value, key, column, index) {
      //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index
      const temp = [...this.dataSource]
      const target = temp.filter(item => key === item.key)[index];
      if (target) {
        target[column.dataIndex] = value
        this.dataSource = temp
      }
    },
    close() {
      this.$emit('close')
      this.dataSource = []
      this.visible = false
      this.supplierShow = false,
       this.disableSubmit = false,
       this.numDisable = false,
      this.quantityDisable = false,
       this.onlyCodeDisable = true,
       this.returnShow = false,
       this.toolingShow = false,
       this.sharpenShow = false,
       this.addDisable = false
    },
    handleTableChange(pagination, filters, sorter) {
      this.ipagination = pagination
      this.detailList(this.inboundOrderId);
    },
    handleOk() {
      const that = this
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          let http = ''
          if(this.model.id){
            http = this.url.edit
          }else{
            http = this.url.add
          }
          postAction(http, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('ok', new Date())
              } else {
                that.$message.warning(res.message)
              }
            })
            .finally(() => {
              that.confirmLoading = false
              that.close()
            })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    //选择工具
    selectTooling: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].toolCodeId)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择工具'
      this.$refs.toolingModalForm.disableSubmit = false
    },
    //选择归还工具
    selectReturnList: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].id)
      }
      this.$refs.returnModalForm.showModal(ids)
      this.$refs.returnModalForm.title = '选择归还工具'
      this.$refs.returnModalForm.disableSubmit = false
    },
    //选择刃磨工具
    selectSharpenList: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].id)
      }
      this.$refs.sharpenModalForm.showModal(ids)
      this.$refs.sharpenModalForm.title = '选择刃磨工具'
      this.$refs.sharpenModalForm.disableSubmit = false
    },
    handleDelete(record, index) {
      this.dataSource.splice(index, 1)
    },
    onChange() {},
    //控制扫码或手选
    selectCurrentUserType(e) {
      if (e == '0') {
        this.barcodeCurrentType = true
      } else {
        this.barcodeCurrentType = false
      }
    },
    //手选人员值
    selectCurrentUserChange(e) {
      console.log('当前手选', e)
      // this.form.setFieldsValue({
      //   // userName: e,
      //   userNameId: e,
      // })
    },
    //入库类型
    handleTypeChange(value) {
      this.dataSource = []
      if(value == 1){
        this.toolingShow = true
        this.quantityDisable = false
        this.addDisable = true
        this.numDisable = false
      }else{
         this.toolingShow = false
      }
     if(value == 2){
        this.numDisable = true
        this.addDisable = false
        this.returnShow = true
        this.quantityDisable = true
      }else{
        this.returnShow = false
      }
      if (value == 5) {
        this.numDisable = true
        this.addDisable = false
        this.sharpenShow = true
        this.quantityDisable = true
      } else {
        this.sharpenShow = false
      }
    },
    //添加工具按钮
    addTooling() {
      const temp = [...this.dataSource];
      temp.push({ indexId: temp.length + 1 });
      this.dataSource = temp;
    },
    detailList(inboundOrderId) {
      this.param.inboundOrderId = inboundOrderId
      getAction(this.url.detailList, this.getQueryParams()).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total;
        }
      })
    },
    initOptions() {
      ajaxGetDictItems("mes_base_warehouse,name,id,del_flag!='1' order by num asc", null).then((res) => {
        if (res.success) {
          if (res.result) {
            for (let i = 0; i < res.result.length; i++) {
              res.result[i].label = res.result[i].title;
            }
          }
          this.warehouseOptions = res.result;
        }
      })
      ajaxGetDictItems("mes_base_storage_area,name,id,del_flag!='1'", null).then((res) => {
        if (res.success) {
          if (res.result) {
            for (let i = 0; i < res.result.length; i++) {
              res.result[i].label = res.result[i].title;
            }
          }
          this.locationOptions = res.result;
        }
      })
       ajaxGetDictItems("mes_base_tooling,num,id,del_flag!='1'", null).then((res) => {
        if (res.success) {
          if (res.result) {
            for (let i = 0; i < res.result.length; i++) {
              res.result[i].label = res.result[i].title;
              res.result[i].toolingName = res.result[i].name
            }
          }
          this.toolingOptions = res.result;
        }
      })
    },
     filterOption(input, option) {
      return (
        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
      );
    },
  },
  watch: {},
  mounted() {
    this.$bus.$on('selectionRows', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          toolCodeId:data[i].id,
          toolingId: data[i].toolingId || data[i].id,
          toolCode: data[i].toolCode,
          chineseName: data[i].chineseName,
          toolModel: data[i].toolModel,
          applicationType: data[i].applicationTypeName,
          unitName: data[i].unitName || data[i].unitId_dictText,
          onlyCode:data[i].onlyCode,
          noAccountQuantity:data[i].noAccountQuantity,
          inStorageQuantity:data[i].storageQuantity
        })
      }
      //this.ipaginationm.total = this.dataSource.length
    })
  },
}
</script>
<style  lang="less" scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
/deep/ .notshow {
  display: none;
}
</style>
src/views/tms/modules/inbound/JSelectReturnListModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,290 @@
<template>
  <!--支持全屏缩放-->
  <j-modal
    :visible="visible"
    :title="title"
    switchFullscreen
    :width="1200"
    @ok="handleSubmit"
    @cancel="close"
    style="top: 50px"
    cancelText="关闭"
  >
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <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.num"></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.name"></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.model"></a-input>
              </a-form-item>
            </a-col>
            <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-row>
        </a-form>
      </div>
      <!--领料单列表-->
      <a-table
        ref="table"
        :scroll="scrollTrigger"
        size="middle"
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :rowSelection="rowSelection"
        :loading="loading"
        @change="handleTableChange"
      >
      </a-table>
    </a-card>
  </j-modal>
</template>
<script>
import { filterObj } from '@/utils/util'
import { getAction } from '@/api/manage'
export default {
  name: 'JSelectToolingModal',
  components: {},
  props: {},
  data() {
    return {
      queryParam: {},
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolingNum',
          sorter: true,
        },
        {
          title: '工具名称',
          align: 'center',
          dataIndex: 'toolingName',
          sorter: true,
        },
         {
          title: '唯一编码',
          align: 'center',
          dataIndex: 'onlyCode',
          sorter: true,
        },
        {
          title: '入库数量',
          align: 'center',
          dataIndex: 'inStorageQuantity',
          sorter: true,
        },
        {
          title: '工具分类',
          align: 'center',
          dataIndex: 'toolingCategoryName',
          sorter: true,
        },
        {
          title: '规格型号',
          align: 'center',
          dataIndex: 'model',
          sorter: true,
        },
        {
          title: '单位',
          align: 'center',
          dataIndex: 'unitName',
          sorter: true,
        },
      ],
      selectedRowKeys: [],
      oldSlelectRows: [],
      scrollTrigger: {},
      dataSource: [],
      selectionRows: [],
      title: '根据查询结果选择工具',
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '20'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      isorter: {
        column: 'num',
        order: 'desc',
      },
      departTree: [],
      visible: false,
      loading: false,
      url: {
        // list: '/base/tooling/list',
         list: '/returnInventory/queryReturnList',
         queryKnifeBom:'/toolingStorage/mesToolingOutbounds/queryKnifeBom'
      },
    }
  },
  computed: {
    rowSelection() {
      return {
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
        },
        getCheckboxProps: (record) => ({
          props: {
            disabled: record.distable,
          },
        }),
        selectedRowKeys: this.selectedRowKeys,
      }
    },
  },
  watch: {},
  created() {},
  methods: {
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      let that = this
      this.loading = true
      let params = this.getQueryParams() //查询条件
      await getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            if (that.oldSlelectRows.indexOf(res.result.records[i].toolingId) > -1) {
              res.result.records[i].distable = true
            } else {
              res.result.records[i].distable = false
            }
          }
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    showModal(oldSlelectRows) {
      this.oldSlelectRows = oldSlelectRows
      this.visible = true
      this.loadData(1)
    },
    getQueryParams() {
      let param = Object.assign({}, this.queryParam, this.isorter)
      param.field = this.getQueryField()
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    //查询条件处理
    getQueryField() {
      let str = 'id,'
      for (let a = 0; a < this.columns.length; a++) {
        str += ',' + this.columns[a].dataIndex
      }
      return str
    },
    searchReset(num) {
      let that = this
      if (num !== 0) {
        that.loadData(1)
      }
      that.selectborrowIds = []
    },
    close() {
      this.searchReset(0)
      this.selectedRowKeys = []
      this.visible = false
    },
    handleTableChange(pagination, filters, sorter) {
      //TODO ç­›é€‰
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field
        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
      }
      this.ipagination = pagination
      this.loadData()
    },
    handleSubmit() {
      if (this.selectionRows.length > 0) {
         let params = this.getQueryParams() //查询条件
          params['onlyCode'] = this.selectionRows[0].onlyCode;
        getAction(this.url.queryKnifeBom, params).then((res) => {
        if (res.success) {
          this.prepareKnifeDetailList = res.result
          this.$bus.$emit('selectionRows', this.prepareKnifeDetailList)
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
        this.searchReset(0)
        this.close()
      } else {
        this.$message.warning('请选择一条数据')
      }
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    },
    onSearch() {
      this.loadData(1)
    },
     searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = {}
      this.loadData(1)
    },
  },
}
</script>
<style scoped>
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}
</style>
src/views/tms/modules/inbound/JSelectSharpenListModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,273 @@
<template>
  <!--支持全屏缩放-->
  <j-modal
    :visible="visible"
    :title="title"
    switchFullscreen
    :width="1200"
    @ok="handleSubmit"
    @cancel="close"
    style="top: 50px"
    cancelText="关闭"
  >
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <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.num"></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.name"></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.model"></a-input>
              </a-form-item>
            </a-col>
            <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-row>
        </a-form>
      </div>
      <!--领料单列表-->
      <a-table
        ref="table"
        :scroll="scrollTrigger"
        size="middle"
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :rowSelection="rowSelection"
        :loading="loading"
        @change="handleTableChange"
      >
      </a-table>
    </a-card>
  </j-modal>
</template>
<script>
import { filterObj } from '@/utils/util'
import { getAction } from '@/api/manage'
export default {
  name: 'JSelectToolingModal',
  components: {},
  props: {},
  data() {
    return {
      queryParam: {},
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolingNum',
          sorter: true,
        },
        {
          title: '工具名称',
          align: 'center',
          dataIndex: 'toolingName',
          sorter: true,
        },
        {
          title: '唯一编码',
          align: 'center',
          dataIndex: 'onlyCode',
          sorter: true,
        },
        {
          title: '入库数量',
          align: 'center',
          dataIndex: 'inStorageQuantity',
          sorter: true,
        },
        {
          title: '工具分类',
          align: 'center',
          dataIndex: 'toolingCategoryName',
          sorter: true,
        },
        {
          title: '规格型号',
          align: 'center',
          dataIndex: 'model',
          sorter: true,
        },
        {
          title: '单位',
          align: 'center',
          dataIndex: 'unitName',
          sorter: true,
        },
      ],
      selectedRowKeys: [],
      oldSlelectRows: [],
      scrollTrigger: {},
      dataSource: [],
      selectionRows: [],
      title: '根据查询结果选择工具',
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '20'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      isorter: {
        column: 'num',
        order: 'desc',
      },
      departTree: [],
      visible: false,
      loading: false,
      url: {
        // list: '/base/tooling/list',
         list: '/sharpen/sharpenDetail/querySharpenList',
      },
    }
  },
  computed: {
    rowSelection() {
      return {
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
        },
        getCheckboxProps: (record) => ({
          props: {
            disabled: record.distable,
          },
        }),
        selectedRowKeys: this.selectedRowKeys,
      }
    },
  },
  watch: {},
  created() {},
  methods: {
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      let that = this
      this.loading = true
      let params = this.getQueryParams() //查询条件
      params["sharpenStatus"] = 1
      await getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            if (that.oldSlelectRows.indexOf(res.result.records[i].toolingId) > -1) {
              res.result.records[i].distable = true
            } else {
              res.result.records[i].distable = false
            }
          }
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    showModal(oldSlelectRows) {
      this.oldSlelectRows = oldSlelectRows
      this.visible = true
      this.loadData(1)
    },
    getQueryParams() {
      let param = Object.assign({}, this.queryParam, this.isorter)
      param.field = this.getQueryField()
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    //查询条件处理
    getQueryField() {
      let str = 'id,'
      for (let a = 0; a < this.columns.length; a++) {
        str += ',' + this.columns[a].dataIndex
      }
      return str
    },
    searchReset(num) {
      let that = this
      if (num !== 0) {
        that.loadData(1)
      }
      that.selectborrowIds = []
    },
    close() {
      this.searchReset(0)
      this.selectedRowKeys = []
      this.visible = false
    },
    handleTableChange(pagination, filters, sorter) {
      //TODO ç­›é€‰
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field
        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
      }
      this.ipagination = pagination
      this.loadData()
    },
    handleSubmit() {
      this.$bus.$emit('selectionRows', this.selectionRows)
      this.searchReset(0)
      this.close()
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    },
    onSearch() {
      this.loadData(1)
    },
     searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = {}
      this.loadData(1)
    },
  },
}
</script>
<style scoped>
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}
</style>
src/views/tms/modules/inbound/JSelectToolingModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,254 @@
<template>
  <!--支持全屏缩放-->
  <j-modal
    :visible="visible"
    :title="title"
    switchFullscreen
    :width="1200"
    @ok="handleSubmit"
    @cancel="close"
    style="top: 50px"
    cancelText="关闭"
  >
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <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.toolCode"></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.chineseName"></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.toolModel"></a-input>
              </a-form-item>
            </a-col>
            <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-row>
        </a-form>
      </div>
      <!--工具列表-->
      <a-table
        ref="table"
        :scroll="scrollTrigger"
        size="middle"
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :rowSelection="rowSelection"
        :loading="loading"
        @change="handleTableChange"
      >
      </a-table>
    </a-card>
  </j-modal>
</template>
<script>
import { filterObj } from '@/utils/util'
import { getAction } from '@/api/manage'
export default {
  name: 'JSelectToolingModal',
  components: {},
  props: {},
  data() {
    return {
      queryParam: {},
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
          sorter: true,
        },
        {
          title: '工具名称',
          align: 'center',
          dataIndex: 'chineseName',
          sorter: true,
        },
        {
          title: '工具类型',
          align: 'center',
          dataIndex: 'applicationTypeName',
          sorter: true,
        },
        {
          title: '型号/图号',
          align: 'center',
          dataIndex: 'toolModel',
          sorter: true,
        },
      ],
      selectedRowKeys: [],
      oldSlelectRows: [],
      scrollTrigger: {},
      dataSource: [],
      selectionRows: [],
      title: '根据查询结果选择工具',
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '20'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      isorter: {
        column: 'toolCode',
        order: 'desc',
      },
      departTree: [],
      visible: false,
      loading: false,
      url: {
        // list: '/base/tooling/list',
         list: '/tms/baseTools/paraCommonToolList',
      },
    }
  },
  computed: {
    rowSelection() {
      return {
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
        },
        getCheckboxProps: (record) => ({
          props: {
            disabled: record.distable,
          },
        }),
        selectedRowKeys: this.selectedRowKeys,
      }
    },
  },
  watch: {},
  created() {},
  methods: {
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      let that = this
      this.loading = true
      let params = this.getQueryParams() //查询条件
      await getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            if (that.oldSlelectRows.indexOf(res.result.records[i].id) > -1) {
              res.result.records[i].distable = true
            } else {
              res.result.records[i].distable = false
            }
          }
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    showModal(oldSlelectRows) {
      this.oldSlelectRows = oldSlelectRows
      this.visible = true
      this.loadData(1)
    },
    getQueryParams() {
      let param = Object.assign({}, this.queryParam, this.isorter)
      param.field = this.getQueryField()
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    //查询条件处理
    getQueryField() {
      let str = 'id,'
      for (let a = 0; a < this.columns.length; a++) {
        str += ',' + this.columns[a].dataIndex
      }
      return str
    },
    searchReset(num) {
      let that = this
      if (num !== 0) {
        that.loadData(1)
      }
      that.selectborrowIds = []
    },
    close() {
      this.searchReset(0)
      this.selectedRowKeys = []
      this.visible = false
    },
    handleTableChange(pagination, filters, sorter) {
      //TODO ç­›é€‰
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field
        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
      }
      this.ipagination = pagination
      this.loadData()
    },
    handleSubmit() {
      this.$bus.$emit('selectionRows', this.selectionRows)
      this.searchReset(0)
      this.close()
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    },
    onSearch() {
      this.loadData(1)
    },
     searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = {}
      this.loadData(1)
    },
  },
}
</script>
<style scoped>
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}
</style>