zhangherong
8 天以前 6cd84bf4799d16687c952c3c82f5ee284e098c71
art: 生产订单列表,编辑功能修改
已修改3个文件
380 ■■■■ 文件已修改
src/views/mes/MesProductionOrderList.vue 183 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/modules/MesProductionOrderForm.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/modules/MesProductionOrderModal.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/MesProductionOrderList.vue
@@ -11,7 +11,7 @@
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="订单类型">
              <j-dict-select-tag dictCode="orderCategory" placeholder="请输入订单类型"
              <j-dict-select-tag dictCode="production_order_category" placeholder="请选择订单类型"
                                 v-model="queryParam.orderCategory"></j-dict-select-tag>
            </a-form-item>
          </a-col>
@@ -27,67 +27,20 @@
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="订单状态">
              <j-dict-select-tag dictCode="order_status" placeholder="请输入订单状态"
                                 v-model="queryParam.order_status"></j-dict-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.processRoute"></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.materialListCode"></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.factoryCode"></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.factoryName"></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.customerOrderModel"></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.customer"></j-input>
              <j-dict-select-tag dictCode="production_order_status" placeholder="请选择订单状态"
                                 v-model="queryParam.orderStatus"></j-dict-select-tag>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- 高级查询区域 -->
      <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>
    </div>
    <!-- table区域-begin -->
    <div>
@@ -110,47 +63,11 @@
        :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>
      </a-table>
    </div>
@@ -164,7 +81,6 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import MesProductionOrderModal from './modules/MesProductionOrderModal'
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
export default {
  name: 'MesProductionOrderList',
@@ -185,22 +101,26 @@
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
          },
          fixed: 'left',
        },
        {
          title: '生产订单号',
          align: 'center',
          dataIndex: 'orderCode'
          dataIndex: 'orderCode',
          fixed: 'left',
        },
        {
          title: '订单类型',
          align: 'center',
          dataIndex: 'orderCategory'
          dataIndex: 'orderCategory_dictText',
          fixed: 'left',
        },
        {
          title: '物料编号',
          align: 'center',
          dataIndex: 'materialNumber'
          dataIndex: 'materialNumber',
          fixed: 'left',
        },
        {
          title: '物料名称',
@@ -223,19 +143,24 @@
          dataIndex: 'orderQuantity'
        },
        {
          title: '产品单位',
          title: '基本计量单位',
          align: 'center',
          dataIndex: 'productionUnit_dictText'
          dataIndex: 'productionUnit'
        },
        {
          title: '订单状态',
          align: 'center',
          dataIndex: 'orderStatus_dictText'
          dataIndex: 'orderStatus'
        },
        {
          title: '订单状态描述',
          align: 'center',
          dataIndex: 'orderStatusName'
        },
        {
          title: '优先级',
          align: 'center',
          dataIndex: 'priority_dictText'
          dataIndex: 'priority'
        },
        {
          title: '计划工艺路线',
@@ -256,6 +181,36 @@
          title: '工厂名称',
          align: 'center',
          dataIndex: 'factoryName'
        },
        {
          title: '调度员编号',
          align: 'center',
          dataIndex: 'dispatcherCode'
        },
        {
          title: '调度员名称',
          align: 'center',
          dataIndex: 'dispatcherName'
        },
        {
          title: '订单创建日期',
          align: 'center',
          dataIndex: 'orderCreateDate'
        },
        {
          title: '订单更新日期',
          align: 'center',
          dataIndex: 'orderUpdateDate'
        },
        {
          title: '订单更新时间',
          align: 'center',
          dataIndex: 'orderUpdateTime'
        },
        {
          title: '订单修改人',
          align: 'center',
          dataIndex: 'orderUpdateUser'
        },
        {
          title: '客户型号',
@@ -282,50 +237,16 @@
        }
      ],
      url: {
        list: '/mesproductionwork/mesProductionOrder/list',
        delete: '/mesproductionwork/mesProductionOrder/delete',
        deleteBatch: '/mesproductionwork/mesProductionOrder/deleteBatch',
        exportXlsUrl: '/mesproductionwork/mesProductionOrder/exportXls',
        importExcelUrl: 'mesproductionwork/mesProductionOrder/importExcel'
        list: '/mes/productionOrder/list',
      },
      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: 'orderCode', text: '生产订单号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'orderCategory', text: '订单类型', dictCode: '' })
      fieldList.push({ type: 'string', value: 'materialNumber', text: '物料编号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'materialName', text: '物料名称', dictCode: '' })
      fieldList.push({ type: 'datetime', value: 'planStart', text: '计划开始日期' })
      fieldList.push({ type: 'datetime', value: 'planEnd', text: '计划结束日期' })
      fieldList.push({ type: 'double', value: 'orderQuantity', text: '订单数量', dictCode: '' })
      fieldList.push({ type: 'string', value: 'productionUnit', text: '产品单位', dictCode: 'production_unit' })
      fieldList.push({ type: 'string', value: 'orderStatus', text: '订单状态', dictCode: 'order_status' })
      fieldList.push({ type: 'string', value: 'priority', text: '优先级', dictCode: 'priority' })
      fieldList.push({ type: 'string', value: 'processRoute', text: '计划工艺路线', dictCode: '' })
      fieldList.push({ type: 'string', value: 'materialListCode', text: '计划物料清单', dictCode: '' })
      fieldList.push({ type: 'string', value: 'factoryCode', text: '工厂编码', dictCode: '' })
      fieldList.push({ type: 'string', value: 'factoryName', text: '工厂名称', dictCode: '' })
      fieldList.push({ type: 'string', value: 'customerOrderModel', text: '客户型号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'customer', text: '客户名称', dictCode: '' })
      fieldList.push({ type: 'string', value: 'remark', text: '备注', dictCode: '' })
      this.superFieldList = fieldList
    }
  }
}
</script>
src/views/mes/modules/MesProductionOrderForm.vue
@@ -1,78 +1,122 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
    <j-form-container disabled>
      <a-form-model ref="form1" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="生产订单号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCode">
              <a-input v-model="model.orderCode" placeholder="请输入生产订单号"  ></a-input>
              <a-input v-model="model.orderCode" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="订单类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCategory">
              <j-dict-select-tag v-model="model.orderCategory" dictCode="orderCategory" placeholder="请输入订单类型"  ></j-dict-select-tag>
              <j-dict-select-tag v-model="model.orderCategory" dictCode="production_order_category"></j-dict-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="物料编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-input v-model="model.materialNumber" placeholder="请输入物料编号"  ></a-input>
              <a-input v-model="model.materialNumber"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <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"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="计划开始日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planStart">
              <j-date placeholder="请选择计划开始日期"  v-model="model.planStart" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
              <j-date v-model="model.planStart" :show-time="true"
                      date-format="YYYY-MM-DD" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="计划结束日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planEnd">
              <j-date placeholder="请选择计划结束日期"  v-model="model.planEnd" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
              <j-date v-model="model.planEnd" :show-time="true"
                      date-format="YYYY-MM-DD" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="订单数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderQuantity">
              <a-input-number v-model="model.orderQuantity" placeholder="请输入订单数量" style="width: 100%" />
              <a-input-number v-model="model.orderQuantity" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="产品单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionUnit">
              <j-dict-select-tag type="list" v-model="model.productionUnit" dictCode="production_unit" placeholder="请选择产品单位" />
          <a-col :span="8">
            <a-form-model-item label="基本计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionUnit">
              <a-input v-model="model.productionUnit" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="订单状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus">
              <j-dict-select-tag type="list" v-model="model.orderStatus" dictCode="order_status" placeholder="请选择订单状态" />
              <a-input v-model="model.orderStatus" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="订单状态描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatusName">
              <a-input v-model="model.orderStatusName" />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="优先级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priority">
              <j-dict-select-tag type="list" v-model="model.priority" dictCode="priority" placeholder="请选择优先级" />
              <a-input v-model="model.priority" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="计划工艺路线" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processRoute">
              <a-input v-model="model.processRoute" placeholder="请输入计划工艺路线"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="计划物料清单" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialListCode">
              <a-input v-model="model.materialListCode" placeholder="请输入计划物料清单"  ></a-input>
          <a-col :span="8">
            <a-form-model-item label="计划物料清单" :labelCol="labelCol" :wrapperCol="wrapperCol"
                               prop="materialListCode">
              <a-input v-model="model.materialListCode"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="工厂编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryCode">
              <a-input v-model="model.factoryCode" placeholder="请输入工厂编码"  ></a-input>
              <a-input v-model="model.factoryCode"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
          <a-col :span="8">
            <a-form-model-item label="工厂名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryName">
              <a-input v-model="model.factoryName" placeholder="请输入工厂名称"  ></a-input>
              <a-input v-model="model.factoryName" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="调度员编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispatcherCode">
              <a-input v-model="model.dispatcherCode"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="调度员名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispatcherName">
              <a-input v-model="model.dispatcherName" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="订单创建日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCreateDate">
              <a-input v-model="model.orderCreateDate"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="订单更新日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderUpdateDate">
              <a-input v-model="model.orderUpdateDate" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="订单更新时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderUpdateTime">
              <a-input v-model="model.orderUpdateTime"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="订单修改人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderUpdateUser">
              <a-input v-model="model.orderUpdateUser" ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
    <j-form-container :disabled="formDisabled">
      <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="customerOrderModel">
              <a-input v-model="model.customerOrderModel" placeholder="请输入客户型号"  ></a-input>
@@ -83,9 +127,9 @@
              <a-input v-model="model.customer" placeholder="请输入客户名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
              <a-input v-model="model.remark" placeholder="请输入备注"  ></a-input>
          <a-col :span="24">
            <a-form-model-item label="备注" :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark">
              <a-textarea v-model="model.remark" placeholder="请输入备注"></a-textarea>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -96,13 +140,11 @@
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
import { httpAction } from '@/api/manage'
  export default {
    name: 'MesProductionOrderForm',
    components: {
    },
  components: {},
    props: {
      //表单禁用
      disabled: {
@@ -113,72 +155,77 @@
    },
    data () {
      return {
        model:{
         },
      model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        sm: { span: 6 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        sm: { span: 16 }
      },
      labelColLong: {
        xs: { span: 24 },
        sm: { span: 3 }
      },
      wrapperColLong: {
        xs: { span: 24 },
        sm: { span: 20 }
        },
        confirmLoading: false,
        validatorRules: {
        },
      validatorRules: {},
        url: {
          add: "/mesproductionwork/mesProductionOrder/add",
          edit: "/mesproductionwork/mesProductionOrder/edit",
          queryById: "/mesproductionwork/mesProductionOrder/queryById"
        edit: '/mes/productionOrder/edit',
        queryById: '/mes/productionOrder/queryById'
        }
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    }
    },
    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
      },
      submitForm () {
        const that = this;
      const that = this
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            httpurl += this.url.add
            method = 'post'
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            httpurl += this.url.edit
            method = 'put'
            }
            httpAction(httpurl,this.model,method).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.confirmLoading = false
            })
          }
        })
      },
    }
    }
  }
</script>
src/views/mes/modules/MesProductionOrderModal.vue
@@ -8,13 +8,15 @@
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <mes-production-order-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></mes-production-order-form>
    <mes-production-order-form ref="realForm" @ok="submitCallback"
                               :disabled="disableSubmit"></mes-production-order-form>
  </j-modal>
</template>
<script>
  import MesProductionOrderForm from './MesProductionOrderForm'
  export default {
    name: 'MesProductionOrderModal',
    components: {
@@ -23,7 +25,7 @@
    data () {
      return {
        title:'',
        width:896,
      width: 1200,
        visible: false,
        disableSubmit: false
      }
@@ -32,25 +34,25 @@
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
        this.$refs.realForm.add()
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        this.$refs.realForm.edit(record)
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      this.$emit('close')
      this.visible = false
      },
      handleOk () {
        this.$refs.realForm.submitForm();
      this.$refs.realForm.submitForm()
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      this.$emit('ok')
      this.visible = false
      },
      handleCancel () {
        this.close()