已添加1个文件
已修改8个文件
1417 ■■■■■ 文件已修改
src/views/cms/CuttingReceiveDetailList.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingReceiveList.vue 328 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingReceiveModal.vue 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/JSelectInventoryModal.vue 256 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMaterialInboundList.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/MesMaterialLoadingList.vue 335 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/modules/MesMaterialLoadingForm.vue 263 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/modules/MesProductionWorkOrderEquipmentInspectionModal.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/modules/MesProductionWorkOrderProcessCheckModal.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingReceiveDetailList.vue
@@ -119,7 +119,7 @@
          deleteBatch: "/cms/cuttingReceiveDetail/deleteBatch",
          exportXlsUrl: "/cms/cuttingReceiveDetail/exportXls",
          importExcelUrl: "cms/cuttingReceiveDetail/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
@@ -141,6 +141,8 @@
        let fieldList=[];
        fieldList.push({type:'string',value:'orderId',text:'领用单ID'})
        fieldList.push({type:'string',value:'cuttingId',text:'刀具ID'})
        fieldList.push({type:'string',value:'cuttingCode',text:'刀具编码'})  // æ·»åŠ è¿™ä¸€è¡Œ
        fieldList.push({type:'string',value:'cuttingName',text:'刀具名称'})  // æ·»åŠ è¿™ä¸€è¡Œ
        fieldList.push({type:'string',value:'inventoryId',text:'库存ID'})
        fieldList.push({type:'string',value:'workpieceMaterial',text:'工件材质'})
        fieldList.push({type:'int',value:'usedLife',text:'使用寿命'})
src/views/cms/CuttingReceiveList.vue
@@ -7,22 +7,22 @@
          <a-col :md="6" :sm="8">
            <a-form-item label="领用单状态">
              <j-search-select-tag
                  placeholder="请选择领用单状态"
                  v-model="queryParam.orderStatus"
                  dict="order_status"
                />
                placeholder="请选择领用单状态"
                v-model="queryParam.orderStatus"
                dict="order_status"
              />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="领用人">
                <j-search-select-tag
                  placeholder="请选择领用人"
                  v-model="queryParam.receiver"
                  dict="sys_user,realname,id,del_flag!=1"
                />
              </a-form-item>
            </a-col>
            <a-col
            <a-form-item label="领用人">
              <j-search-select-tag
                placeholder="请选择领用人"
                v-model="queryParam.receiver"
                dict="sys_user,realname,id,del_flag!=1"
              />
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
@@ -60,11 +60,12 @@
    <!-- 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>
     <a-table
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
@@ -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>
@@ -119,7 +121,7 @@
      </a-table>
    </div>
<a-tabs defaultActiveKey="1">
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="刀具领用明细" key="1">
        <cutting-receive-detail-list ref="cuttingReceiveDetailList"></cutting-receive-detail-list>
      </a-tab-pane>
@@ -130,162 +132,162 @@
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingReceiveModal from './modules/CuttingReceiveModal'
  import CuttingReceiveDetailList from './CuttingReceiveDetailList'
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CuttingReceiveModal from './modules/CuttingReceiveModal'
import CuttingReceiveDetailList from './CuttingReceiveDetailList'
  export default {
    name: 'CuttingReceiveList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingReceiveModal,
      CuttingReceiveDetailList
    },
    data () {
      return {
        description: '刀具领用单管理页面',
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'领用人',
            align:"center",
            dataIndex: 'receiver_dictText'
          },
          {
            title:'领用时间',
            align:"center",
            dataIndex: 'receiveTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'领用说明',
            align:"center",
            dataIndex: 'receiveComment'
          },
          {
            title:'确认人',
            align:"center",
            dataIndex: 'confirmer_dictText'
          },
          {
            title:'确认时间',
            align:"center",
            dataIndex: 'confirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'确认意见',
            align:"center",
            dataIndex: 'confirmComment'
          },
          {
            title:'是否会归还',
            align:"center",
            dataIndex: 'returnFlag'
          },
          {
            title:'归还时间',
            align:"center",
            dataIndex: 'returnTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'归还说明',
            align:"center",
            dataIndex: 'returnComment'
          },
          {
            title:'归还确认人',
            align:"center",
            dataIndex: 'returnConfirmer_dictText'
          },
          {
            title:'归还确认时间',
            align:"center",
            dataIndex: 'returnConfirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'归还确认意见',
            align:"center",
            dataIndex: 'returnConfirmComment'
          },
          {
            title:'领用单状态',
            align:"center",
            dataIndex: 'orderStatus'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
export default {
  name: 'CuttingReceiveList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    CuttingReceiveModal,
    CuttingReceiveDetailList
  },
  data() {
    return {
      description: '刀具领用单管理页面',
      // è¡¨å¤´
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        ],
        url: {
          list: "/cms/cuttingReceive/list",
          delete: "/cms/cuttingReceive/delete",
          deleteBatch: "/cms/cuttingReceive/deleteBatch",
          exportXlsUrl: "/cms/cuttingReceive/exportXls",
          importExcelUrl: "cms/cuttingReceive/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
        {
          title: '领用人',
          align: 'center',
          dataIndex: 'receiver_dictText'
        },
        {
          title: '领用时间',
          align: 'center',
          dataIndex: 'receiveTime',
          customRender: function(text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '领用说明',
          align: 'center',
          dataIndex: 'receiveComment'
        },
        {
          title: '确认人',
          align: 'center',
          dataIndex: 'confirmer_dictText'
        },
        {
          title: '确认时间',
          align: 'center',
          dataIndex: 'confirmTime',
          customRender: function(text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '确认意见',
          align: 'center',
          dataIndex: 'confirmComment'
        },
        {
          title: '是否会归还',
          align: 'center',
          dataIndex: 'returnFlag'
        },
        {
          title: '归还时间',
          align: 'center',
          dataIndex: 'returnTime',
          customRender: function(text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '归还说明',
          align: 'center',
          dataIndex: 'returnComment'
        },
        {
          title: '归还确认人',
          align: 'center',
          dataIndex: 'returnConfirmer_dictText'
        },
        {
          title: '归还确认时间',
          align: 'center',
          dataIndex: 'returnConfirmTime',
          customRender: function(text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '归还确认意见',
          align: 'center',
          dataIndex: 'returnConfirmComment'
        },
        {
          title: '领用单状态',
          align: 'center',
          dataIndex: 'orderStatus'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/cms/cuttingReceive/list',
        delete: '/cms/cuttingReceive/delete',
        deleteBatch: '/cms/cuttingReceive/deleteBatch',
        exportXlsUrl: '/cms/cuttingReceive/exportXls',
        importExcelUrl: 'cms/cuttingReceive/importExcel'
      },
    },
    methods: {
     searchReset() {
      dictOptions: {},
      superFieldList: []
    }
  },
  created() {
    this.getSuperFieldList()
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {
    searchReset() {
      this.queryParam = {}
      this.$refs.cuttingReceiveDetailList.dataSource = []
      this.loadData(1);
      this.loadData(1)
    },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
    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
    },
    handleDetail:function(record){
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title="详情";
      this.$refs.modalForm.disableSubmit = true;
    handleDetail: function(record) {
      this.$refs.modalForm.edit(record)
      this.$refs.modalForm.title = '详情'
      this.$refs.modalForm.disableSubmit = true
    },
     customRow(record) {
    customRow(record) {
      return {
        on: {
          click: (e) => {
@@ -302,13 +304,13 @@
            for (let i = 0; i < children.length; i++) {
              children[i].classList.add('checked-td-of-add-table')
            }
          },
        },
          }
        }
      }
    },
    }
  }
}
</script>
<style scoped>
  @import '~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>
src/views/cms/modules/CuttingReceiveModal.vue
@@ -3,7 +3,7 @@
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
          <a-col :span="24 / 2">
            <a-form-item label="领用人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
@@ -26,12 +26,13 @@
        <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="['receiveComment', validatorRules.receiveComment]" />
              <a-textarea :disabled="disableSubmit" placeholder="请输入领用说明"
                          v-decorator="['receiveComment', validatorRules.receiveComment]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
          <a-col :span="24 / 2">
            <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
@@ -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-row style="width: 100%">
           <a-col :span="24 / 2">
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item label="是否会归还" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit"  placeholder="请输入是否会归还" v-decorator="['returnFlag', validatorRules.returnFlag]" ></a-input>
              <a-input :disabled="disableSubmit" placeholder="请输入是否会归还"
                       v-decorator="['returnFlag', validatorRules.returnFlag]"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
@@ -77,12 +80,13 @@
        <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="['returnComment', validatorRules.returnComment]" />
              <a-textarea :disabled="disableSubmit" placeholder="请输入归还说明"
                          v-decorator="['returnComment', validatorRules.returnComment]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
           <a-col :span="24 / 2">
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item label="归还确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
@@ -102,18 +106,17 @@
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
        <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="['returnConfirmComment', validatorRules.returnConfirmComment]" />
              <a-textarea :disabled="disableSubmit" placeholder="请输入归还确认意见"
                          v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()"
      >选择刀具</a-button
    >
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()">选择刀具</a-button>
    <a-table
      ref="table"
      bordered
@@ -124,16 +127,16 @@
      :pagination="ipagination"
      :loading="loading"
    >
      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index" >
        <div :key="col.dataIndex">
         <a-input
                    :value="text"
                    :disabled="disableSubmit"
                    v-if="col.dataIndex == 'workpieceMaterial'"
                    @change="(e)=>handleChange(e.target.value, record.key, col, index)"
                  />
                  <a-input-number
            v-if="col.dataIndex == 'usedLife'"
          <a-input
            :value="text"
            :disabled="disableSubmit"
            v-if="col.dataIndex === 'workpieceMaterial'"
            @change="(e)=>handleChange(e.target.value, record.key, col, index)"
          />
          <a-input-number
            v-if="col.dataIndex === 'usedLife'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
@@ -154,33 +157,37 @@
    <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-inventory-modal ref="inventoryModalForm" @ok="modalFormOk"></j-select-inventory-modal>
<!--    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>-->
  </a-modal>
</template>
<script>
  import pick from 'lodash.pick'
  import JSelectToolingModal from './JSelectToolingModal'
  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 store from '@/store/'
  export default {
    name: 'CuttingInboundModal',
    components: {
import pick from 'lodash.pick'
import JSelectToolingModal from './JSelectToolingModal'
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 store from '@/store/'
import JSelectInventoryModal from '@views/cms/modules/JSelectInventoryModal.vue'
export default {
  name: 'CuttingInboundModal',
  components: {
    JSelectToolingModal,
    JSelectInventoryModal,
    JMultiSelectTag,
    JDictSelectTag,
    store,
    moment,
    moment
  },
    data () {
      return {
         /* åˆ†é¡µå‚æ•° */
  data() {
    return {
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
@@ -190,27 +197,26 @@
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
        total: 0
      },
      title:'新增',
         visible: false,
         selectedRowKeys: {},
      title: '新增',
      visible: false,
      selectedRowKeys: {},
      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: '#',
@@ -218,59 +224,58 @@
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
          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: '工件材质',
          align: 'center',
          dataIndex: 'workpieceMaterial',
          scopedSlots: { customRender: 'workpieceMaterial' },
          scopedSlots: { customRender: 'workpieceMaterial' }
        },
        {
          title: '使用寿命',
          align: 'center',
          dataIndex: 'usedLife',
          scopedSlots: { customRender: 'usedLife' },
          scopedSlots: { customRender: 'usedLife' }
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        add: '/cms/cuttingReceive/add',
        detailList: '/cms/cuttingReceive/detailList',
        detailList: '/cms/cuttingReceive/detailList'
      },
      orderId:'',
      disableSubmit:false
      }
    },
    methods: {
      modalFormOk(){
      orderId: '',
      disableSubmit: false
    }
  },
  methods: {
    modalFormOk() {
      },
       getQueryParams() {
    },
    getQueryParams() {
      this.param.pageNo = this.ipagination.current
      this.param.pageSize = this.ipagination.pageSize
      return filterObj(this.param)
    },
      add() {
    add() {
      let receiver = store.getters.userInfo.id
      let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.edit({ receiver: receiver, receiveTime: receiveTime })
@@ -293,7 +298,7 @@
        )
      })
    },
     handleDelete(record, index) {
    handleDelete(record, index) {
      this.dataSource.splice(index, 1)
    },
    handleChange(value, key, column, index) {
@@ -305,14 +310,20 @@
        this.dataSource = temp
      }
    },
    selectTooling: function () {
    selectTooling: function() {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].cuttingId)
        ids.push(this.dataSource[i].inventoryId)
        console.log('当前数据源:', this.dataSource)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择刀具'
      this.$refs.toolingModalForm.disableSubmit = false
      // this.$refs.toolingModalForm.showModal(ids)
      // this.$refs.toolingModalForm.title = '选择刀具'
      // this.$refs.toolingModalForm.disableSubmit = false
      this.$refs.inventoryModalForm.showModal(ids)
      this.$refs.inventoryModalForm.title = '选择刀具'
      this.$refs.inventoryModalForm.disableSubmit = false
    },
    detailList(orderId) {
      this.param.orderId = orderId
@@ -337,19 +348,30 @@
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          postAction(that.url.add, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success('领用成功')
                that.$emit('ok', new Date())
              } else {
                that.$message.warning(res.message)
              }
            })
            .finally(() => {
              that.confirmLoading = false
              that.close()
            })
          // æ·»åŠ æ›´æ–°åº“å­˜çŠ¶æ€çš„é€»è¾‘
          const inventoryIds = this.dataSource.map(item => item.inventoryId)
          const updateInventoryStatus = inventoryIds.length > 0 ?
            //需要写一个更新库存状态的接口在后端(还没写25/9/9)
            postAction('/cms/inventory/updateStatus', {
              ids: inventoryIds,
              status: '待出库' //设为待出库
            }) : Promise.resolve()
          updateInventoryStatus.then(() => {
            return postAction(that.url.add, formData)
          }).then((res) => {
                if (res.success) {
                  that.$message.success('领用成功')
                  that.$emit('ok', new Date())
                } else {
                  that.$message.warning(res.message)
                }
              }).catch((error) => {
                that.$message.error('操作失败: ' + error.message)
              }).finally(() => {
                that.confirmLoading = false
                that.close()
              })
        }
      })
    },
@@ -361,19 +383,22 @@
      this.dataSource = []
      this.visible = false
      this.disableSubmit = false
    },
    },
    mounted() {
    }
  },
  mounted() {
    this.$bus.$on('selectionRows', (data) => {
      console.log('接收到的选择数据:', data)
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          cuttingId: data[i].id,
          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/JSelectInventoryModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,256 @@
<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: 'JSelectInventoryModal',
  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,
        },
      ],
      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) {
      //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/lsw/LswMaterialInboundList.vue
@@ -49,8 +49,8 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd('HEAT_TREATMENT_INBOUND')" type="primary" icon="plus">热处理外协入库</a-button>
      <a-button @click="handleAdd('SMALL_INNER_RING')" type="primary" icon="plus">小内圈外协入库</a-button>
      <a-button @click="handleAdd('HEAT_TREATMENT_INBOUND')" type="primary" icon="plus">热处理外厂入库</a-button>
      <a-button @click="handleAdd('SMALL_INNER_RING')" type="primary" icon="plus">小内圈外厂入库</a-button>
      <a-button @click="handleAdd('MATERIAL_INNER_TRANSFER')" type="primary" icon="plus">内部调拨</a-button>
    </div>
    <!-- table区域-begin -->
src/views/mes/MesMaterialLoadingList.vue
@@ -4,6 +4,44 @@
    <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="产线">
              <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="类型">
              <j-search-select-tag placeholder="请选择类型" v-model="queryParam.category" :dict-options="categoryDictOptions"></j-search-select-tag>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料编码">
              <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></j-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="物料名称">
                <j-input placeholder="请输入物料名称" v-model="queryParam.materialName"></j-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="批次号">
                <j-input placeholder="请输入批次号" v-model="queryParam.batchNumber"></j-input>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
@@ -11,25 +49,14 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <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>
      </a-upload>
      <!-- é«˜çº§æŸ¥è¯¢åŒºåŸŸ -->
      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> æ‰¹é‡æ“ä½œ <a-icon type="down" /></a-button>
      </a-dropdown>
      <a-button @click="handleAdd" type="primary" icon="plus">上料</a-button>
    </div>
    <!-- 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>
@@ -46,46 +73,19 @@
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </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;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        <span slot="categorySlot" slot-scope="text, record">
            <a-tag color="orange" v-if="record.category === 'LOADING'">上料</a-tag>
            <a-tag color="blue" v-else-if="record.category === 'UNLOADING'">下料</a-tag>
        </span>
        <span slot="unloadingFlagSlot" slot-scope="text, record">
            <a-tag color="green" v-if="record.unloadingFlag === '0'">正常</a-tag>
            <a-tag color="red" v-else-if="record.unloadingFlag === '1'">已下料</a-tag>
        </span>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">下料</a>
          <a-divider type="vertical" />
          <a @click="handleDetail(record)">详情</a>
        </span>
      </a-table>
    </div>
@@ -95,131 +95,118 @@
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import MesMaterialLoadingModal from './modules/MesMaterialLoadingModal'
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import MesMaterialLoadingModal from './modules/MesMaterialLoadingModal'
  export default {
    name: 'MesMaterialLoadingList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      MesMaterialLoadingModal
    },
    data () {
      return {
        description: '上料管理页面',
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'删除标记',
            align:"center",
            dataIndex: 'delFlag'
          },
          {
            title:'工单ID',
            align:"center",
            dataIndex: 'workOrderId'
          },
          {
            title:'设备ID',
            align:"center",
            dataIndex: 'equipmentId'
          },
          {
            title:'工序编码',
            align:"center",
            dataIndex: 'processCode'
          },
          {
            title:'工序名称',
            align:"center",
            dataIndex: 'processName'
          },
          {
            title:'物料编码',
            align:"center",
            dataIndex: 'materialNumber'
          },
          {
            title:'物料名称',
            align:"center",
            dataIndex: 'materialName'
          },
          {
            title:'批次号',
            align:"center",
            dataIndex: 'batchNumber'
          },
          {
            title:'数量',
            align:"center",
            dataIndex: 'quantity'
          },
          {
            title:'剩余数量',
            align:"center",
            dataIndex: 'remainingQuantity'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/mes/mesMaterialLoading/list",
          delete: "/mes/mesMaterialLoading/delete",
          deleteBatch: "/mes/mesMaterialLoading/deleteBatch",
          exportXlsUrl: "/mes/mesMaterialLoading/exportXls",
          importExcelUrl: "mes/mesMaterialLoading/importExcel",
export default {
  name: 'MesMaterialLoadingList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    MesMaterialLoadingModal
  },
  data() {
    return {
      description: '上料管理页面',
      categoryDictOptions: [
        {
          value: 'LOADING',
          text: '上料'
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'int',value:'delFlag',text:'删除标记',dictCode:''})
        fieldList.push({type:'string',value:'workOrderId',text:'工单ID',dictCode:''})
        fieldList.push({type:'string',value:'equipmentId',text:'设备ID',dictCode:''})
        fieldList.push({type:'string',value:'processCode',text:'工序编码',dictCode:''})
        fieldList.push({type:'string',value:'processName',text:'工序名称',dictCode:''})
        fieldList.push({type:'string',value:'materialNumber',text:'物料编码',dictCode:''})
        fieldList.push({type:'string',value:'materialName',text:'物料名称',dictCode:''})
        fieldList.push({type:'string',value:'batchNumber',text:'批次号',dictCode:''})
        fieldList.push({type:'double',value:'quantity',text:'数量',dictCode:''})
        fieldList.push({type:'double',value:'remainingQuantity',text:'剩余数量',dictCode:''})
        this.superFieldList = fieldList
        {
          value: 'UNLOADING',
          text: '下料'
        },
      ],
      // è¡¨å¤´
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '产线',
          align: 'center',
          dataIndex: 'factoryId_dictText'
        },
        {
          title: '线边库',
          align: 'center',
          dataIndex: 'warehouseId_dictText'
        },
        {
          title: '物料编码',
          align: 'center',
          dataIndex: 'materialNumber'
        },
        {
          title: '物料名称',
          align: 'center',
          dataIndex: 'materialName'
        },
        {
          title: '批次号',
          align: 'center',
          dataIndex: 'batchNumber'
        },
        {
          title: '数量',
          align: 'center',
          dataIndex: 'quantity'
        },
        {
          title: '剩余数量',
          align: 'center',
          dataIndex: 'remainingQuantity'
        },
        {
          title: '钢球尺寸',
          align: 'center',
          dataIndex: 'steelBallSize_dictText'
        },
        {
          title: '类型',
          align: 'center',
          dataIndex: 'category',
          scopedSlots: {
            customRender: 'categorySlot'
          },
        },
        {
          title: '下料标记',
          align: 'center',
          dataIndex: 'unloadingFlag',
          scopedSlots: {
            customRender: 'unloadingFlagSlot'
          },
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/mes/mesMaterialLoading/list'
      }
    }
  }
  },
  created() {
  },
  computed: {},
  methods: {}
}
</script>
<style scoped>
  @import '~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>
src/views/mes/modules/MesMaterialLoadingForm.vue
@@ -4,43 +4,29 @@
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="删除标记" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工单ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrderId">
              <a-input v-model="model.workOrderId" placeholder="请输入工单ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId">
              <a-input v-model="model.equipmentId" placeholder="请输入设备ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工序编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processCode">
              <a-input v-model="model.processCode" placeholder="请输入工序编码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工序名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processName">
              <a-input v-model="model.processName" placeholder="请输入工序名称"  ></a-input>
            <a-form-model-item label="产线" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">
              <j-search-select-tag placeholder="请选择产线" v-model="model.factoryId"
                                   dict="base_factory,factory_name,id,del_flag=0 and factory_category='3'"
                                   @change="factorySelectChange"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-input v-model="model.materialNumber" placeholder="请输入物料编码"  ></a-input>
              <j-search-select-tag v-model="model.materialNumber" placeholder="请选择物料编码"
                                   :dict-options="materialNumberDictOptions"
                                   @change="materialNumberSelectChange"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
              <a-input v-model="model.materialName" placeholder="请输入物料名称"  ></a-input>
              <a-input v-model="model.materialName" placeholder="请输入物料名称" readOnly></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="批次号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber">
              <a-input v-model="model.batchNumber" placeholder="请输入批次号"  ></a-input>
              <j-search-select-tag v-model="model.batchNumber" placeholder="请选择批次号"
                                   :dict-options="batchNumberDictOptions"
                                   @change="batchNumberSelectChange"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -48,9 +34,10 @@
              <a-input-number v-model="model.quantity" placeholder="请输入数量" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="剩余数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remainingQuantity">
              <a-input-number v-model="model.remainingQuantity" placeholder="请输入剩余数量" style="width: 100%" />
          <a-col :span="12" v-if="materialCategory === 'STEEL_BALL'">
            <a-form-model-item label="钢球尺寸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="steelBallSize">
              <j-search-select-tag v-model="model.steelBallSize" placeholder="请选择钢球尺寸" dict="steel_ball_size"
                                   style="width: 100%" />
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -61,89 +48,159 @@
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: 'MesMaterialLoadingForm',
    components: {
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
export default {
  name: 'MesMaterialLoadingForm',
  components: {},
  props: {
    //表单禁用
    disabled: {
      type: Boolean,
      default: false,
      required: false
    }
  },
  data() {
    return {
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      confirmLoading: false,
      validatorRules: {
        factoryId: [
          { required: true, message: '产线是必选项', trigger: 'change' }
        ],
        materialNumber: [
          { required: true, message: '物料编码是必填项', trigger: 'change' }
        ],
        materialName: [
          { required: true, message: '物料名称是必填项', trigger: 'change' }
        ],
        batchNumber: [
          { required: true, message: '批次号是必选项', trigger: 'change' }
        ],
        quantity: [
          { required: true, message: '数量是必填项', trigger: 'change' }
        ],
        steelBallSize: [
          { required: false, message: '钢球尺寸是必填项', trigger: 'change' }
        ]
      },
      materialCategory: undefined,
      batchNumberDictOptions: [],
      inventoryList: [],
      url: {
        add: '/mes/mesMaterialLoading/add',
        edit: '/mes/mesMaterialLoading/edit',
        queryById: '/mes/mesMaterialLoading/queryById',
        queryMaterialInventory: '/lsw/materialInventory/queryMaterialInventory'
      }
    }
  },
  computed: {
    formDisabled() {
      return this.disabled
    },
    data () {
      return {
        model:{
         },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/mes/mesMaterialLoading/add",
          edit: "/mes/mesMaterialLoading/edit",
          queryById: "/mes/mesMaterialLoading/queryById"
    materialNumberDictOptions() {
      let materialNumberArr = new Set()
      let materialNumberOptions = []
      for (let item of this.inventoryList) {
        if (!materialNumberArr.has(item.materialNumber)) {
          materialNumberOptions.push({
            value: item.materialNumber,
            text: item.materialNumber + '(' + item.materialName + ')',
            materialCategory: item.materialCategory,
            materialName: item.materialName
          })
          materialNumberArr.add(item.materialNumber)
        }
      }
      return materialNumberOptions
    }
  },
  created() {
    //备份model原始值
    this.modelDefault = JSON.parse(JSON.stringify(this.model))
  },
  methods: {
    add() {
      this.edit(this.modelDefault)
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    edit(record) {
      this.model = Object.assign({}, record)
      this.visible = true
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      submitForm () {
        const that = this;
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
    submitForm() {
      const that = this
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
          if (!this.model.id) {
            httpurl += this.url.add
            method = 'post'
          } else {
            httpurl += this.url.edit
            method = 'put'
          }
        })
      },
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
          })
        }
      })
    },
    factorySelectChange(val) {
      getAction(this.url.queryMaterialInventory, { factoryId: val }).then((res) => {
        if (res.success) {
          this.inventoryList = res.result.map(item => ({ ...item }))
        }
      })
    },
    materialNumberSelectChange(val) {
      let option = this.materialNumberDictOptions.find(item => item.value === val)
      if (option) {
        this.model.materialName = option.materialName
        this.materialCategory = option.materialCategory
        let map = this.inventoryList.filter(item => item.materialNumber === val).map(item => ({
          value: item.batchNumber,
          text: item.batchNumber,
          quantity: item.quantity
        }))
        this.batchNumberDictOptions = [...map]
        this.validatorRules.steelBallSize[0].required = true
      } else {
        this.model.materialName = ''
        this.materialCategory = undefined
        this.batchNumberDictOptions = []
        this.validatorRules.steelBallSize[0].required = false
      }
    },
    batchNumberSelectChange(val) {
      let option = this.batchNumberDictOptions.find(item => item.value === val)
      if (option) {
        this.model.quantity = option.quantity
      } else {
        this.model.quantity = null
      }
    }
  }
}
</script>
src/views/mes/modules/MesProductionWorkOrderEquipmentInspectionModal.vue
@@ -172,7 +172,6 @@
    handleEquipmentChange(id) {
      getAction(this.url.queryByEquipmentId, {equipmentId: id}).then(res => {
        if (res.success) {
          console.log(res.result)
          this.model = {
            ...this.model,
            standardId: res.result.id,
@@ -190,6 +189,10 @@
          this.$message.error("请完成所有必填信息后再提交!")
        } else {
          let tableData = this.$refs.table.getTableData().fullData
          if (!tableData || tableData.length === 0) {
            this.$message.error("点检项为空,无法提交!")
            return
          }
          const data = {
            ...this.model,
            workOrderId: this.workOrderId,
@@ -226,7 +229,9 @@
      })
    },
    resetFormData() {
      this.$refs.form.resetFields()
      if (this.$refs.form) {
        this.$refs.form.resetFields()
      }
      this.model = {}
      this.dataSource = []
    },
src/views/mes/modules/MesProductionWorkOrderProcessCheckModal.vue
@@ -71,7 +71,7 @@
  name: 'MesProductionWorkOrderProcessCheckModal',
  data () {
    return {
      title: '设备点检',
      title: '工艺点检',
      width: 1200,
      visible: false,
      loading: false,
@@ -172,12 +172,15 @@
          this.$message.error("请完成所有必填信息后再提交!")
        } else {
          let tableData = this.$refs.table.getTableData().fullData
          if (!tableData || tableData.length === 0) {
            this.$message.error("点检项为空,无法提交!")
            return
          }
          const data = {
            equipmentId: this.model.equipmentId,
            workOrderId: this.workOrderId,
            checkDetailList: tableData
          }
          console.log(data)
          postAction(this.url.addProcessCheck, data).then(res=> {
            if (res.success) {
              this.$message.success(res.message)