From 2cc5a1afe8296d148f0a32989395d538e5323a8e Mon Sep 17 00:00:00 2001
From: hdy <1105738590@qq.com>
Date: 星期四, 18 一月 2024 16:22:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 jcdm-ui/src/views/main/om/productionOrde/index.vue |  112 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 85 insertions(+), 27 deletions(-)

diff --git a/jcdm-ui/src/views/main/om/productionOrde/index.vue b/jcdm-ui/src/views/main/om/productionOrde/index.vue
index 5bc4ecd..249fae6 100644
--- a/jcdm-ui/src/views/main/om/productionOrde/index.vue
+++ b/jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -30,23 +30,20 @@
       <el-form-item style="margin-left: 14px" label="浜у搧缂栧彿" prop="productCode">
         <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-form-item label="鏈哄瀷" prop="typeZ">
+        <el-input v-model="queryParams.typeZ" 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-form-item>
-      <el-form-item label="浜х嚎缂栧彿" prop="lineCode">
-        <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="璇疯緭鍏ヤ骇鍝丅OM" 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-form-item>
-      <el-form-item label="宸ヨ壓閰嶆柟" prop="recipeCode">
-        <el-input v-model="queryParams.recipeCode" placeholder="璇疯緭鍏ュ伐鑹洪厤鏂�" clearable @keyup.enter.native="handleQuery"/>
+      <el-form-item label-width="130" label="閫氱煡鍗曠敓鎴愭棩鏈�" prop="dateConditions">
+        <el-date-picker
+          v-model="queryParams.dateConditions"
+          type="datetimerange"
+          :picker-options="pickerOptions"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          range-separator="鑷�"
+          start-placeholder="寮�濮嬫棩鏈�"
+          end-placeholder="缁撴潫鏃ユ湡"
+          align="right">
+        </el-date-picker>
       </el-form-item>
     </el-form>
     </el-card>
@@ -117,18 +114,19 @@
 <!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="success"
           plain
-          icon="el-icon-download"
+          icon="el-icon-wind-power"
           size="mini"
           @click="getProductionNotice"
+          v-hasPermi="['om:productionOrde:receive']"
         >鎺ユ敹</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
           type="primary"
           plain
-          icon="el-icon-createUpdate"
+          icon="el-icon-edit"
           size="mini"
           :disabled="single"
           @click="CreatehandleUpdate"
@@ -145,7 +143,7 @@
         </el-table-column>
         <el-table-column label="鐢熶骇璁㈠崟" width="160" align="center">
           <template slot-scope="scope">
-            <router-link :to="{path: '/main/workReport-data/index/', query: {workOrderNo: scope.row.workOrderNo} }" class="link-type">
+            <router-link :to="{path: '/main/orderScheduling-data/index/', query: {workOrderNo: scope.row.workOrderNo} }" class="link-type">
               <span>{{ scope.row.workOrderNo }}</span>
             </router-link>
           </template>
@@ -349,9 +347,9 @@
         <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 ref="form" inline  :model="form" :rules="CreateRules" label-width="100px">
+        <el-form-item   label="鏈哄瀷" prop="typeZ">
+          <el-input disabled v-model="form.typeZ"  placeholder="璇疯緭鍏ユ満鍨�" />
         </el-form-item>
         <el-form-item  label="鏃ユ湡" prop="dateTime">
           <el-date-picker clearable
@@ -368,7 +366,7 @@
           <el-input type="number"   :maxlength="3"  :pattern="'[0-9]{3}'" v-model="form.startCode"  placeholder="璇疯緭鍏ヨ捣濮嬬紪鍙�" @input="handleCodeChange"/>
         </el-form-item>
         <el-form-item   label="璧锋缂栧彿" prop="startEndCode">
-          <el-input disabled v-model="form.startEndCode"/>
+          <el-input type="textarea" disabled v-model="form.startEndCode"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -396,6 +394,7 @@
   generateNumbers
 } from "@/api/main/bs/orderScheduling/orderScheduling";
 import {listMaterial} from "@/api/main/bs/material/material";
+import {listModelNumber} from "@/api/main/bs/modelNumber/modelNumber";
 
 export default {
   name: "ProductionOrde",
@@ -459,6 +458,7 @@
         flag: null,
         adds:null,
         productionNotice: null,
+        dateConditions: [],
       },
       materialQueryParams: {
         pageNum: 1,
@@ -501,6 +501,33 @@
         year: '',
       },
       markNo: '',
+      pickerOptions: {
+        shortcuts: [{
+          text: '鏈�杩戜竴鍛�',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: '鏈�杩戜竴涓湀',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: '鏈�杩戜笁涓湀',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+            picker.$emit('pick', [start, end]);
+          }
+        }]
+      },
     };
   },
   created() {
@@ -540,15 +567,18 @@
         //鏃�
         dateTimeRule = dateTimeRule + day;
         dateTimeRule = dateTimeRule + this.markNo;
-        this.form.dateTimeRule = dateTimeRule;
+        this.form.dateTimeRule = dateTimeRule;//姝ゅ璧嬪�间笉鍔犳満鍨�
+        dateTimeRule = dateTimeRule + this.form.typeZ;//姝ゅ鍔犳満鍨嬶紝椤哄簭涓嶈兘棰犲��
+
         //璧嬪�艰捣濮嬬紪鐮�
-        this.form.startEndCode = dateTimeRule +  startCode + "----" + dateTimeRule + String(parseInt(startCode) + parseInt(planQty)-1).padStart(3, '0') ;
+        this.form.startEndCode = dateTimeRule +  String(parseInt(startCode)).padStart(3, '0') + "         " + dateTimeRule + String(parseInt(startCode) + parseInt(planQty)-1).padStart(3, '0') ;
       }
     },
 
     getProductionNotice(){
       getProductionNotice(this.queryParams).then(response => {
-        this.$modal.msgSuccess("鎺ユ敹鎴愬姛");
+
+        this.$modal.msgSuccess(response.msg);
         this.queryParams = {}
         this.getList();
       });
@@ -728,6 +758,7 @@
         this.materialQueryParams.materialCode = response.data.productCode;
         listMaterial(this.materialQueryParams).then(response => {
           this.markNo = response.rows[0].mark
+          this.form.typeL = response.rows[0].typeL;
         });
         this.form = response.data;
         this.Createopen = true;
@@ -770,6 +801,33 @@
 
     /** 鐢熸垚绠变綋鏉$爜鎻愪氦鎸夐挳 */
     submitFormForBoxCode() {
+      let startCode = parseInt(this.form.startCode);
+      let queryParams = {
+        model: this.form.typeZ,
+        modelDate: this.form.dateTimeRule,
+      }
+      if(startCode>999){
+        this.$message.error('璧峰缂栧彿瓒呭嚭鏈�澶ц寖鍥达紝璇疯緭鍏�1-999鐨勬暟瀛楋紒');
+        return;
+      }else if(startCode<1){
+        this.$message.error('璧峰缂栧彿瓒呭嚭鏈�灏忚寖鍥达紝璇疯緭鍏�1-999鐨勬暟瀛楋紒');
+        return;
+      }
+      listModelNumber(queryParams).then(response => {
+        if(response.rows.length === 0){
+          this.saveBoxCode()
+        }else {
+          let maxNumValue = response.rows[0].maxnumValue;
+          if(startCode<=maxNumValue){
+            this.$message.error('绠变綋鏉$爜閲嶅锛岃閲嶆柊杈撳叆璧峰缂栧彿锛�');
+          }else {
+            this.saveBoxCode()
+          }
+        }
+      });
+    },
+
+    saveBoxCode(){
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {

--
Gitblit v1.9.3