cuilei
2 天以前 7207ef22748a8fecfde5e7ded828dc9b6bcfefe7
Merge remote-tracking branch 'origin/master'
已添加1个文件
已修改12个文件
662 ■■■■ 文件已修改
src/utils/util.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/ShiftGroupManager.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/group/GroupModal.vue 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingReceiveDetailList.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingReceiveList.vue 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingScrapDetailList.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingScrapList.vue 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingReceiveModal.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingScrapModal.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/JSelectScrapModal.vue 261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/modules/EamEquipmentModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/modules/MesMaterialTransferRequestForm.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/modules/WorkOrderSelectModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/util.js
@@ -512,7 +512,31 @@
  }
  return [target].concat(getParents(target), window)
}
/**
 * é‡å¤å€¼éªŒè¯å·¥å…·æ–¹æ³•
 *
 * ä½¿ç”¨ç¤ºä¾‹ï¼š
 * { validator: (rule, value, callback) => validateDuplicateValue('sys_fill_rule', 'rule_code', value, this.model.id, callback) }
 *
 * @param tableName è¢«éªŒè¯çš„表名
 * @param fieldName è¢«éªŒè¯çš„字段名
 * @param fieldVal è¢«éªŒè¯çš„值
 * @param dataId æ•°æ®ID,可空
 * @param delFlag åˆ é™¤æ ‡è®°
 * @param callback
 */
export function validateDuplicateValueInDelFlag(tableName, fieldName, fieldVal, dataId, delFlag, callback) {
  if (fieldVal) {
    let params = { tableName, fieldName, fieldVal, dataId, delFlag }
    api.duplicateCheck(params).then(res => {
      res['success'] ? callback() : callback(res['message'])
    }).catch(err => {
      callback(err.message || err)
    })
  } else {
    callback()
  }
}
/**
 * æ ¹æ®ç»„件名获取父级
 * @param vm
src/views/base/ShiftGroupManager.vue
@@ -7,7 +7,13 @@
          <!-- æœç´¢åŒºåŸŸ -->
          <a-form layout="inline" @keyup.enter.native="searchQuery">
            <a-row :gutter="24">
              <a-col :md="6" :sm="8">
              <a-col :xl="6" :lg="7" :md="8" :sm="24">
                <a-form-item label="产线">
                  <j-dict-select-tag placeholder="请选择产线" v-model="queryParam.factoryId"
                                     dictCode="base_factory,factory_name,id,del_flag=0 and factory_category='3'"></j-dict-select-tag>
                </a-form-item>
              </a-col>
              <a-col :xl="6" :lg="7" :md="8" :sm="24">
                <a-form-item label="班组名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
                  <a-input placeholder="" v-model="queryParam.groupName"></a-input>
                </a-form-item>
@@ -89,7 +95,7 @@
              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
            <a-col :md="9" :sm="24">
             <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
              <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
              <a-button type="info" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
            </a-col>
          </span>
@@ -170,7 +176,7 @@
        queryParam2: {},
        dataSource1: [],
        dataSource2: [],
        ipagination1: {
        ipagination: {
          current: 1,
          pageSize: 10,
          pageSizeOptions: ['10', '20', '30'],
@@ -192,9 +198,9 @@
          showSizeChanger: true,
          total: 0
        },
        isorter1: {
          column: 'createTime',
          order: 'desc'
        isorter: {
          column: 'groupCode',
          order: 'asc'
        },
        isorter2: {
          column: 'createTime',
src/views/base/modules/group/GroupModal.vue
@@ -12,7 +12,7 @@
    style="top:5%;height: 85%;overflow-y: hidden">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form"  v-bind="layout"  :model="model" :rules="validatorRules">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-form-model-item label="班组编码" required prop="groupCode" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-model="model.groupCode" :disabled="roleDisabled"  placeholder="请输入班组编码"/>
        </a-form-model-item>
@@ -20,22 +20,17 @@
          <a-input v-model="model.groupName" placeholder="请输入班组名称"/>
        </a-form-model-item>
         <a-form-model-item label="班组长" prop="groupManager" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag
          <j-search-select-tag
                type="list"
                v-model="model.groupManager"
                :trigger-change="true"
                dictCode="sys_user,realname,id"
            dict="sys_user,realname,id, del_flag='0' and status='1'"
                placeholder="请选择班组长"
              />
        </a-form-model-item>
         <a-form-model-item label="产线" prop="factoryId" :labelCol="labelCol" :wrapperCol="wrapperCol">
         <j-select-factory
            v-model="model.factoryId"
            :multi="true"
            @back="backFactoryInfo"
            :backProduction="true"
            :treeProductOpera="true"
          ></j-select-factory>
          <j-dict-select-tag placeholder="请选择产线" v-model="model.factoryId"
                             dictCode="base_factory,factory_name,id,del_flag=0 and factory_category='3'"></j-dict-select-tag>
        </a-form-model-item>
         <a-form-model-item label="班次" prop="shiftId" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag
@@ -58,26 +53,25 @@
  import {duplicateCheck } from '@/api/api'
  import {postAction,requestPut} from '@/api/manage'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import JSelectFactory from '../../../../components/jeecgbiz/JSelectFactory'
  export default {
    name: "GroupModal",
  name: 'GroupModal',
    components: {
    JDictSelectTag,
    JSelectFactory
    JDictSelectTag
  },
    data () {
      return {
        title:"操作",
      title: '操作',
        visible: false,
        roleDisabled: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        sm: { span: 16 }
        },
        confirmLoading: false,
        validatorRules:{
@@ -90,41 +84,50 @@
            { min: 0, max: 64, message: '长度不超过 64 ä¸ªå­—符', trigger: 'blur' },
            { validator: this.validategroupCode}
          ],
        factoryId: [
          { required: true, message: '请选择产线!' },
        ],
        groupManager: [
          { required: true, message: '请选择班组长!' },
        ],
        shiftId: [
          { required: true, message: '请选择班班次!' },
        ],
          remark: [
            { min: 0, max: 126, message: '长度不超过 126 ä¸ªå­—符', trigger: 'blur' }
          ]
        },
        url: {
          add: "/base/shiftGroup/add",
          edit: "/base/shiftGroup/edit",
        add: '/base/shiftGroup/add',
        edit: '/base/shiftGroup/edit'
        },
        nextFactoryOptions: [],
      nextFactoryOptions: []
      }
    },
    created () {
      //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    this.modelDefault = JSON.parse(JSON.stringify(this.model))
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      this.edit(this.modelDefault)
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      this.model = Object.assign({}, record)
      this.visible = true
      },
      close () {
        this.$refs.form.clearValidate();
        this.$emit('close');
        this.visible = false;
      this.$refs.form.clearValidate()
      this.$emit('close')
      this.visible = false
      },
      handleOk () {
        const that = this;
      const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let obj;
          that.confirmLoading = true
          let obj
            if(!this.model.id){
              obj=postAction(this.url.add, this.model)
            }else{
@@ -134,17 +137,17 @@
            }
            obj.then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              that.$message.success(res.message)
              that.$emit('ok')
              }else{
                that.$message.warning(res.message);
              that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = false;
              that.close();
            that.confirmLoading = false
            that.close()
            })
          }else{
            return false;
          return false
          }
        })
      },
@@ -153,21 +156,21 @@
      },
      validategroupCode(rule, value, callback){
        if(/[\u4E00-\u9FA5]/g.test(value)){
          callback("班组编码不可输入汉字!");
        callback('班组编码不可输入汉字!')
        }else{
          let params = {
            tableName: "base_shift_group",
            fieldName: "group_code",
          tableName: 'base_shift_group',
          fieldName: 'group_code',
            fieldVal: value,
            dataId: this.model.id,
          };
          dataId: this.model.id
        }
          duplicateCheck(params).then((res)=>{
            if(res.success){
              callback();
            callback()
            }else{
              callback(res.message);
            callback(res.message)
            }
          });
        })
        }
      },
      backFactoryInfo(info) {
@@ -176,7 +179,7 @@
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
    }
    }
  }
</script>
src/views/cms/CuttingReceiveDetailList.vue
src/views/cms/CuttingReceiveList.vue
@@ -120,7 +120,7 @@
            <!--        </span>-->
            <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)" :disabled="record.orderStatus === '2'">编辑</a>
          <a @click="handleEdit(record)" :disabled="record.orderStatus === '2' || record.orderStatus === '3'">编辑</a>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
@@ -128,15 +128,10 @@
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
               <!--              <a-menu-item v-if="record.orderStatus != '2'">-->
               <!--                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
               <!--                  <a>删除</a>-->
               <!--                </a-popconfirm>-->
               <!--              </a-menu-item>-->
              <a-menu-item v-if="record.orderStatus !== '2'">
              <a-menu-item v-if="record.orderStatus === '1'">
                  <a @click="handleSubmit(record.id)" :disabled="record.orderStatus === '3'">提交</a>
              </a-menu-item>
              <a-menu-item v-if="record.orderStatus !== '2'">
              <a-menu-item v-if="record.orderStatus === '1'">
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
@@ -282,7 +277,8 @@
            deleteBatch: '/cms/cuttingReceive/deleteBatch',
            exportXlsUrl: '/cms/cuttingReceive/exportXls',
            importExcelUrl: 'cms/cuttingReceive/importExcel',
            submit: '/cms/cuttingReceive/submit'
        submit: '/cms/cuttingReceive/submit',
        returnBack: '/cms/cuttingReceive/handleBack'
         },
         dictOptions: {},
         superFieldList: []
@@ -393,7 +389,62 @@
            }
         })
      },
      //TODO:刀具归还 handleBack
    /**
     *  å•据领用
     */
    handleBack: function(id) {
      if (!this.url.returnBack) {
        this.$message.error('请设置url.return属性!')
        return
      }
      let targetId = id // ä»Žå‚数获取ID
      // å¦‚果没有通过参数传递ID,则检查选中的记录
      if (!targetId) {
        if (this.selectedRowKeys.length != 1) {
          this.$message.warning('请选择一条记录!')
          return
        } else {
          targetId = this.selectedRowKeys[0]
        }
      }
      // å°†å‚数作为查询参数附加到URL上
      let httpurl = this.url.returnBack + '?orderId=' + encodeURIComponent(targetId)
      let method = 'get'
      var params = {}  // æ¸…空params,因为参数已经在URL中传递
      const that = this
      this.$confirm({
        title: '确认提交!',
        // content: '正在提交数据,请耐心等待...',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          // æ˜¾ç¤ºåŠ è½½æç¤º
          const hide = that.$message.loading('正在提交数据,请耐心等待...', 0)
          // å‘送请求
          return httpAction(httpurl, params, method).then((res) => {
            hide() // éšè—åŠ è½½æç¤º
            if (res.success) {
              that.$message.success(res.message)
              that.loadData()
            } else {
              that.$message.warning(res.message)
            }
          }).catch(error => {
            hide() // éšè—åŠ è½½æç¤º
            that.$message.error('提交失败: ' + error.message)
          }).finally(() => {
            that.loading = false
          })
        }
      })
    }
   }
}
</script>
src/views/cms/CuttingScrapDetailList.vue
@@ -11,7 +11,7 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!--      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
      <!-- <a-button type="primary" icon="download" @click="handleExportXls('刀具报废明细')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
@@ -76,7 +76,6 @@
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
src/views/cms/CuttingScrapList.vue
@@ -60,7 +60,8 @@
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a
        style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
@@ -83,7 +84,8 @@
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
               style="max-width:80px;font-size: 12px;font-style: italic;" />
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
@@ -153,86 +155,86 @@
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
          align: 'center',
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            return parseInt(index) + 1
            }
          },
          {
            title:'申请人',
            align:"center",
          align: 'center',
            dataIndex: 'applicant_dictText'
          },
          {
            title:'申请时间',
            align:"center",
          align: 'center',
            dataIndex: 'applicationTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
            }
          },
          {
            title:'申请说明',
            align:"center",
          align: 'center',
            dataIndex: 'applicationComment'
          },
          {
            title:'确认人',
            align:"center",
          align: 'center',
            dataIndex: 'confirmer_dictText'
          },
          {
            title:'确认时间',
            align:"center",
          align: 'center',
            dataIndex: 'confirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
            }
          },
          {
            title:'确认意见',
            align:"center",
          align: 'center',
            dataIndex: 'confirmComment'
          },
           {
            title:'报废单状态',
            align:"center",
          align: 'center',
            dataIndex: 'orderStatus'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
          align: 'center',
          fixed: 'right',
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/cuttingScrap/list",
          delete: "/cms/cuttingScrap/delete",
          deleteBatch: "/cms/cuttingScrap/deleteBatch",
          exportXlsUrl: "/cms/cuttingScrap/exportXls",
          importExcelUrl: "cms/cuttingScrap/importExcel",
        list: '/cms/cuttingScrap/list',
        delete: '/cms/cuttingScrap/delete',
        deleteBatch: '/cms/cuttingScrap/deleteBatch',
        exportXlsUrl: '/cms/cuttingScrap/exportXls',
        importExcelUrl: 'cms/cuttingScrap/importExcel'
          
        },
        dictOptions:{},
        superFieldList:[],
      superFieldList: []
      }
    },
    created() {
    this.getSuperFieldList();
    this.getSuperFieldList()
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
    },
    methods: {
     searchReset() {
      this.queryParam = {}
      this.$refs.cuttingScrapDetailList.dataSource = []
      this.loadData(1);
      this.loadData(1)
    },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
@@ -245,9 +247,9 @@
      this.$refs.modalForm.disableSubmit = false
    },
    handleDetail:function(record){
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title="详情";
      this.$refs.modalForm.disableSubmit = true;
      this.$refs.modalForm.edit(record)
      this.$refs.modalForm.title = '详情'
      this.$refs.modalForm.disableSubmit = true
    },
     customRow(record) {
      return {
@@ -266,10 +268,10 @@
            for (let i = 0; i < children.length; i++) {
              children[i].classList.add('checked-td-of-add-table')
            }
          },
        },
      }
    },
        }
      }
    }
    }
  }
</script>
src/views/cms/modules/CuttingReceiveModal.vue
@@ -178,7 +178,6 @@
export default {
   name: 'CuttingInboundModal',
   components: {
      JSelectToolingModal,
      JSelectInventoryModal,
      JMultiSelectTag,
      JDictSelectTag,
src/views/cms/modules/CuttingScrapModal.vue
@@ -26,7 +26,8 @@
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="申请说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入申请说明" v-decorator="['applicationComment', validatorRules.applicationComment]" />
              <a-textarea :disabled="disableSubmit" placeholder="请输入申请说明"
                          v-decorator="['applicationComment', validatorRules.applicationComment]" />
            </a-form-item>
          </a-col>
        </a-row>
@@ -54,14 +55,16 @@
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入确认意见" v-decorator="['confirmComment', validatorRules.confirmComment]" />
              <a-textarea :disabled="disableSubmit" placeholder="请输入确认意见"
                          v-decorator="['confirmComment', validatorRules.confirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()"
      >选择刀具</a-button
    >选择报废刀具
    </a-button
    >
    <a-table
      ref="table"
@@ -98,7 +101,7 @@
    <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-scrap-modal ref="scrapModalForm" @ok="modalFormOk"></j-select-scrap-modal>
  </a-modal>
</template>
@@ -113,14 +116,16 @@
  import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
  import { filterObj } from '@/utils/util'
  import store from '@/store/'
import JSelectScrapModal from '@views/cms/modules/JSelectScrapModal.vue'
  export default {
    name: 'CuttingInboundModal',
    components: {
    JSelectToolingModal,
    JSelectScrapModal,
    JMultiSelectTag,
    JDictSelectTag,
    store,
    moment,
    moment
  },
    data () {
      return {
@@ -134,7 +139,7 @@
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
        total: 0
      },
      title:'新增',
         visible: false,
@@ -142,19 +147,18 @@
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
        sm: { span: 6 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
        sm: { span: 18 }
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      param: {},
      validatorRules: {
      },
      validatorRules: {},
      columns: [
        {
          title: '#',
@@ -164,30 +168,30 @@
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
          }
        },
        {
          title: '刀具编码',
          align: 'center',
          dataIndex: 'cuttingCode',
          width: 150,
          width: 150
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName',
          dataIndex: 'cuttingName'
        },
        
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        add: '/cms/cuttingScrap/add',
        detailList: '/cms/cuttingScrap/detailList',
        detailList: '/cms/cuttingScrap/detailList'
      },
      orderId:'',
      disableSubmit:false
@@ -240,10 +244,11 @@
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].cuttingId)
        ids.push(this.dataSource[i].inventoryId)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择刀具'
      this.$refs.toolingModalForm.disableSubmit = false
      this.$refs.scrapModalForm.showModal(ids)
      this.$refs.scrapModalForm.title = '选择报废刀具'
      this.$refs.scrapModalForm.disableSubmit = false
    },
    detailList(orderId) {
      this.param.orderId = orderId
@@ -262,17 +267,32 @@
        return
      }
      const that = this
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          // ç¡®ä¿ä¼ é€’给后端的数据包含所有必要字段
          formData.detailData = this.dataSource.map(item => {
            return {
              // æ˜Žç¡®æŒ‡å®šæ¯ä¸ªå­—段,确保 inventoryId è¢«æ­£ç¡®ä¼ é€’
              inventoryId: item.inventoryId,
              cuttingId: item.cuttingId,
              cuttingCode: item.cuttingCode,
              cuttingName: item.cuttingName,
              // å¦‚果还有其他字段也需要包含
              ...item // åŒ…含其他可能存在的字段
            }
          })
          postAction(that.url.add, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success('报废成功')
                that.$emit('ok', new Date())
                that.$message.success('报废成功')
              } else {
                that.$message.warning(res.message)
              }
@@ -292,19 +312,24 @@
      this.dataSource = []
      this.visible = false
      this.disableSubmit = false
    },
    }
    },
    mounted() {
    this.$bus.$on('selectionRows', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          cuttingId: data[i].id,
          // cuttingId: data[i].id,
          // cuttingCode: data[i].cuttingCode,
          // cuttingName: data[i].cuttingName
          inventoryId: data[i].id,
          cuttingCode: data[i].cuttingCode,
          cuttingName: data[i].cuttingName
          cuttingName: data[i].cuttingName,
          cuttingId: data[i].cuttingId,
        })
      }
    })
  },
    console.log('更新后的数据源:', this.dataSource)
  }
  }
</script>
src/views/cms/modules/JSelectScrapModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,261 @@
<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.cuttingCode"></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.cuttingName"></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: 'JSelectScrapModal',
  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: 'cuttingCode',
          sorter: true,
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName',
          sorter: true,
        },
        {
          title: '刀具分类',
          align: 'center',
          dataIndex: 'cuttingCategory',
          sorter: true,
        },
        {
          title:'刀具条码',
          align: 'center',
          dataIndex: 'cuttingBarcode',
          sorter: true,
        },
        {
          title:'刀具当前寿命(百分比)',
          align: 'center',
          dataIndex: 'currentLife',
          sorter: true,
        },
        {
          title:'库存id',
          align: 'center',
          dataIndex: 'id',
          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: '/cms/cuttingTool/getCuttingToolList',
        list:'/cms/cuttingReceive/getInventoryToolList'
      },
    }
  },
  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) {
      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/eam/equipment/modules/EamEquipmentModal.vue
@@ -198,7 +198,7 @@
          </a-col>
          <a-col :span="6">
            <a-form-model-item prop="equipmentManager" label="设备管理员">
              <j-search-select-tag  placeholder="请选择设备管理员" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0 and post='PCR0004' and status=1" :disabled="disableSubmit"/>
              <j-search-select-tag  placeholder="请选择设备管理员" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0 and status=1" :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
src/views/mes/modules/MesMaterialTransferRequestForm.vue
@@ -42,11 +42,9 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="拉动物料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-select v-model="model.materialNumber" placeholder="请选择拉动物料" @change="handleMaterialNumberChange">
                <a-select-option v-for="item in materialList" :value="item.materialNumber" :title="item.materialName" :key="item.materialNumber">
                  {{ item.materialName }}
                </a-select-option>
              </a-select>
              <j-search-select-tag v-model="model.materialNumber" placeholder="请选择拉动物料"
                                   :dict-options="materialList" @change="handleMaterialNumberChange">
              </j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -118,7 +116,7 @@
        workOrderQuery: '/mes/mesProductionWorkOrder/queryById'
      },
      materialList: [], //物料列表
      workOrderObj: {}, //工单对象
      workOrderObj: {} //工单对象
    }
  },
  computed: {
@@ -140,17 +138,21 @@
      this.model.workOrderCode = this.model.workOrderId_dictText
      this.visible = true
      if (this.model.workOrderId) {
        this.editable = true;
        this.editable = true
        let workOrderRes = await this.loadProductionWorkOrder(this.model.workOrderId)
        if(!workOrderRes.success || !workOrderRes.result) {
          return;
          return
        }
        //排产工单赋值
        this.workOrderObj = Object.assign({}, workOrderRes.result);
        this.workOrderObj = Object.assign({}, workOrderRes.result)
        //物料列表
        let materialListRes = await this.loadMaterialList(workOrderRes.result.materialNumber)
        if (materialListRes.success && materialListRes.result && materialListRes.result.length > 0) {
          this.materialList = [...materialListRes.result]
          this.materialList = materialListRes.result.map(item => ({
            ...item,
            value: item.materialNumber,
            text: item.materialName
          }))
        } else {
          this.materialList = []
        }
@@ -164,23 +166,27 @@
          this.model.warehouseName = ''
        }
      }else {
        this.editable = false;
        this.editable = false
      }
    },
    async selectConfirm(rows) {
      if (rows && rows.length > 0) {
        //清空关联数据
        this.model.materialNumber = undefined;
        this.model.materialName = '';
        this.model.specifiedQuantity = 0;
        this.model.materialNumber = undefined
        this.model.materialName = ''
        this.model.specifiedQuantity = 0
        //赋值新的数据
        this.model.workOrderId = rows[0].id
        this.model.workOrderCode = rows[0].workOrderCode
        //排产工单赋值
        this.workOrderObj = Object.assign({}, rows[0]);
        this.workOrderObj = Object.assign({}, rows[0])
        let materialListRes = await this.loadMaterialList(rows[0].materialNumber)
        if (materialListRes.success && materialListRes.result && materialListRes.result.length > 0) {
          this.materialList = [...materialListRes.result]
          this.materialList = materialListRes.result.map(item => ({
            ...item,
            value: item.materialNumber,
            text: item.materialName
          }))
        } else {
          this.materialList = []
        }
@@ -194,13 +200,13 @@
        }
      } else {
        //清空关联数据
        this.model.materialNumber = undefined;
        this.model.materialName = '';
        this.model.specifiedQuantity = 0;
        this.model.materialNumber = undefined
        this.model.materialName = ''
        this.model.specifiedQuantity = 0
        this.materialList = []
        this.model.targetWarehouseId = undefined
        this.model.warehouseName = ''
        this.workOrderObj = {};
        this.workOrderObj = {}
      }
    },
    submitForm() {
src/views/mes/modules/WorkOrderSelectModal.vue
@@ -70,7 +70,7 @@
        workOrderStatus: this.orderStatus,
      },
      url: {
        list: "/mes/mesProductionWorkOrder/list"
        list: "/mes/mesProductionWorkOrder/queryWorkOrderByTransfer"
      },
      columns: [
        {