春风项目四线(合箱线、总装线)
hdy
2024-01-15 3d88285811ffb6930d70068d108398ceff08fd53
生产工单代码更新
已修改4个文件
254 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/om/productionOrde/index.vue 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/sc/stationConf/index.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java
@@ -523,6 +523,8 @@
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml
@@ -47,7 +47,7 @@
    </resultMap>
    <sql id="selectOmProductionOrdeInfoVo">
        select id, work_order_no, sales_order_code,type_z, product_code, product_name, workshop_code, line_code, route_code, bom_code, recipe_code, plan_qty, actual_qty, bad_qty, scrap_qty, repair_qty, actual_online_qty, online_completion_mark, demand_date, plan_start_time, plan_end_time, actual_start_time, actual_end_time, serial_number, order_status, create_time, update_time, create_user, update_user, remarks, stream_number, custom, market_area_code, software_version_code, product_company_code, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from om_production_orde_info
        select id, work_order_no, sales_order_code,type_z,product_code, product_name, workshop_code, line_code, route_code, bom_code, recipe_code, plan_qty, actual_qty, bad_qty, scrap_qty, repair_qty, actual_online_qty, online_completion_mark, demand_date, plan_start_time, plan_end_time, actual_start_time, actual_end_time, serial_number, order_status, create_time, update_time, create_user, update_user, remarks, stream_number, custom, market_area_code, software_version_code, product_company_code, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from om_production_orde_info
    </sql>
    <select id="selectOmProductionOrdeInfoList" parameterType="OmProductionOrdeInfo" resultMap="OmProductionOrdeInfoResult">
jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -3,20 +3,10 @@
    <el-card class="box-card">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label-width="80" label="生产工单号" prop="workOrderNo">
        <el-input
          v-model="queryParams.workOrderNo"
          placeholder="请输入生产工单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.workOrderNo" placeholder="请输入生产工单号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="产品名称" prop="productName">
        <el-input
          v-model="queryParams.productName"
          placeholder="请输入产品名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.productName" placeholder="请输入产品名称" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="工单状态" prop="orderStatus">
        <el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable>
@@ -24,8 +14,7 @@
            v-for="dict in dict.type.order_state"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
            :value="dict.value"/>
        </el-select>
      </el-form-item>
      <el-form-item style="float: right">
@@ -36,61 +25,25 @@
    </el-form>
    <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="68px">
      <el-form-item style="margin-left: 14px" label="产品编号" prop="productCode">
        <el-input
          v-model="queryParams.productCode"
          placeholder="请输入产品编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.productCode" placeholder="请输入产品编号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="订单编号" prop="salesOrderCode">
        <el-input
          v-model="queryParams.salesOrderCode"
          placeholder="请输入订单编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.salesOrderCode" placeholder="请输入订单编号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="车间编号" prop="workshopCode">
        <el-input
          v-model="queryParams.workshopCode"
          placeholder="请输入车间编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.workshopCode" placeholder="请输入车间编号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="产线编号" prop="lineCode">
        <el-input
          v-model="queryParams.lineCode"
          placeholder="请输入产线编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.lineCode" placeholder="请输入产线编号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item style="margin-left: 7px" label-width="80" label="产品BOM" prop="bomCode">
        <el-input
          v-model="queryParams.bomCode"
          placeholder="请输入产品BOM"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.bomCode" placeholder="请输入产品BOM" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="工艺流程" prop="routeCode">
        <el-input
          v-model="queryParams.routeCode"
          placeholder="请输入工艺流程"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.routeCode" placeholder="请输入工艺流程" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="工艺配方" prop="recipeCode">
        <el-input
          v-model="queryParams.recipeCode"
          placeholder="请输入工艺配方"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.recipeCode" placeholder="请输入工艺配方" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
    </el-form>
    </el-card>
@@ -159,15 +112,15 @@
          @click="moveUp(val => val, 'down')"
        >下移</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          icon="el-icon-createUpdate"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['om:productionOrde:add']"
          :disabled="single"
          @click="CreatehandleUpdate"
          v-hasPermi="['om:productionOrde:createUpdate']"
        >生成</el-button>
      </el-col>
@@ -190,6 +143,8 @@
        <el-table-column label="产品名称" width="160" align="center" prop="productName">
        </el-table-column>
        <el-table-column label="种类" width="160" align="center" prop="typeZ">
        </el-table-column>
        <el-table-column label="实际数量" width="160" align="center" prop="actualQty">
        </el-table-column>
        <el-table-column label="工单状态" align="center" prop="orderStatus">
          <template slot-scope="scope">
@@ -289,8 +244,11 @@
        <el-form-item label="产品名称" prop="productName">
          <el-input v-model="form.productName" disabled placeholder="请输入产品名称" />
        </el-form-item>
        <el-form-item label="产品名称" prop="productName">
        <el-form-item label="种类" prop="productName">
          <el-input v-model="form.typeZ" disabled placeholder="请输入种类" />
        </el-form-item>
        <el-form-item label="实际数量" prop="actualQty">
          <el-input v-model="form.actualQty"  placeholder="请输入实际数量" />
        </el-form-item>
        <el-form-item label="车间编号" prop="workshopCode">
          <el-select style="width: 93%" @change="handleSelectChange(form.workshopCode)" v-model="form.workshopCode" placeholder="请选择车间编号">
@@ -365,6 +323,52 @@
      </div>
    </el-dialog>
    <el-dialog v-dialogpop-up :title="title" :visible.sync="Createopen" width="400px" append-to-body>
       <span slot="title">
        <i class="el-icon-s-order"></i>
        {{titleName}}
      </span>
      <el-form ref="form" inline  :model="form"  :rules="CreateRules"label-width="80px">
        <el-form-item   label="种类" prop="typeZ">
          <el-input disabled v-model="form.typeZ"  placeholder="请输入种类" />
        </el-form-item>
        <el-form-item label="年份" prop="year">
          <el-select @change="changeYear(form.year)" v-model="form.year"  placeholder="请选择年份" clearable>
            <el-option v-for="dict in dict.type.year"
                       :key="dict.value"
                       :label="dict.label"
                       :value="dict.value"/>
          </el-select>
        </el-form-item>
        <el-form-item label="月份" prop="month">
          <el-select @change="changeMonth(form.month)"  v-model="form.month"  placeholder="请选择月份" clearable>
            <el-option v-for="dict in dict.type.month"
                       :key="dict.value"
                       :label="dict.label"
                       :value="dict.value"/>
          </el-select>
        </el-form-item>
        <el-form-item label="日期" prop="day">
          <el-select @change="changeDay(form.day)" v-model="form.day"  placeholder="请选择日期" clearable>
            <el-option v-for="dict in dict.type.day"
                       :key="dict.value"
                       :label="dict.label"
                       :value="dict.value"/>
          </el-select>
        </el-form-item>
        <el-form-item  label="数量" prop="actualQty">
          <el-input  disabled v-model="form.actualQty" placeholder="请输入数量" />
        </el-form-item>
        <el-form-item  label="编码" prop="adds">
          <el-input  disabled v-model="form.adds"  placeholder="请生成编码" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="CreateSubmitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
@@ -375,10 +379,11 @@
import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute";
import ItemSelect  from "@/components/itemSelect/single.vue";
import { upDownMove, listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde";
import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling,generateNumbers } from "@/api/main/bs/orderScheduling/orderScheduling";
export default {
  name: "ProductionOrde",
  dicts: ['order_state'],
  dicts: ['order_state','year','month','day'],
  components: {
    ItemSelect ,
  },
@@ -387,6 +392,7 @@
      titleName: '',
      options: [],
      lineOptions: [],
      outputArray: [],
      showFlag:false,
      advancedShowSearch: false,
      workOrder: {
@@ -412,6 +418,7 @@
      title: "",
      // 是否显示弹出层
      open: false,
      Createopen: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
@@ -434,8 +441,9 @@
        idNums: null,
        typeZ: null,
        flag: null,
        adds:null,
      },
      // 表单参数
      form: {},
      updateStatusParameter: {
@@ -447,7 +455,23 @@
        id: [
          { required: true, message: "ID不能为空", trigger: "blur" }
        ],
      }
      },
      CreateRules: {
        day: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        month: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        year: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
      },
      change: {
        day: '',
        month: '',
        year: '',
      },
    };
  },
  created() {
@@ -455,6 +479,27 @@
    this.initWorkshop();
  },
  methods: {
    //数组生成
    changeDay(day){
      this.change.day = day;
      let adds =this.form.typeZ+this.change.year+this.change.month+this.change.day+this.form.actualQty;
      this.form.adds = adds
    },
    changeMonth(day){
      this.change.month = day;
      let adds =this.form.typeZ+this.change.year+this.change.month+this.change.day+this.form.actualQty;
      this.form.adds = adds
    },
    changeYear(day){
      this.change.year = day;
      let adds =this.form.typeZ+this.change.year+this.change.month+this.change.day+this.form.actualQty;
      this.form.adds = adds
    },
    moveUp(row, val){
      console.log(val)
      const ids = row.id || this.ids
@@ -474,15 +519,8 @@
      });
    },
    // 在这里编写处理选中事件的逻辑
    handleSelectChange(selectedOption) {
      this.form.lineCode = null;
      let params = {
        workshopCode: selectedOption
      };
      listLineInfo(params).then(response => {
        this.lineOptions = response.rows;
      });
    },
    //物料选择弹出框
    onItemSelected(obj){
      if(obj !== undefined && obj !== null){
@@ -490,6 +528,7 @@
        this.form.productCode = productCode;
        this.form.productName = obj.materialName;
        this.form.typeZ = obj.typeZ;
        this.typeL = obj.typeZ;
        this.queryParams.productCode = productCode;
        this.queryParams.typeZ = typeZ
        listTechnologyRoute(this.queryParams).then(response => {
@@ -528,6 +567,7 @@
    // 取消按钮
    cancel() {
      this.open = false;
      this.Createopen = false;
      this.reset();
    },
    // 表单重置
@@ -571,7 +611,8 @@
        spareField2: null,
        spareField3: null,
        typeZ: null,
        spareField4: null
        spareField4: null,
        adds:null
      };
      this.resetForm("form");
    },
@@ -606,6 +647,22 @@
      this.reset();
      this.open = true;
      this.titleName = "添加生产工单";
    },
    /** 同步按钮操作 */
    CreatehandleUpdate(Row) {
      this.initWorkshop();
      this.reset();
      const id = Row.id || this.ids
      getProductionOrde(id).then(response => {
        console.log(response.data)
        this.form = response.data;
        this.Createopen = true;
        this.titleName = "生成订单";
        // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1);
      });
      this.$modal.msgSuccess(Row.actualQty);
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
@@ -654,7 +711,28 @@
      this.download('om/productionOrde/export', {
        ...this.queryParams
      }, `productionOrde_${new Date().getTime()}.xlsx`)
    }
    },
    /** 提交按钮 */
    CreateSubmitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.orderNumber != null) {
            updateOrderScheduling(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addOrderScheduling(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
  }
};
</script>
jcdm-ui/src/views/main/sc/stationConf/index.vue
@@ -135,8 +135,8 @@
          <el-select style="width: 100%" @change="handleSelectChangeprocessesCode(form.processesCode)" v-model="form.processesCode" placeholder="请选择工序编号">
            <el-option
              v-for="item in options"
              :key="item.index"
              :label="item.processesName"
              :key="item.processesCode"
              :label="item.processesCode"
              :value="item.processesCode">
            </el-option>
          </el-select>
@@ -206,7 +206,17 @@
      processesCodeQueryParams:{
        pageNum: 1,
        pageSize: 10,
        processesCodes: null,
        processesCode: null,
        processesName: null,
        processesType: null,
        ipAddress: null,
        spareField1: null,
        spareField2: null,
        spareField3: null,
        spareField4: null,
        createUser: null,
        updateUser: null,
        remarks: null
      },
      // 表单参数
      form: {},
@@ -225,8 +235,8 @@
  methods: {
    handleSelectChangeprocessesCode(selectedOption) {
      this.processesCodeQueryParams.processesCodes = selectedOption;
      listProcesses(this.queryParams).then(response => {
      this.processesCodeQueryParams.processesCode = selectedOption;
      listProcesses(this.processesCodeQueryParams).then(response => {
        this.form.processesName = response.rows[0].processesName;
      });
    },