From 1aa48962bf1ae1ea53d7bca7eccdf3bc074fdda4 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期一, 02 六月 2025 13:44:14 +0800
Subject: [PATCH] 1.首检开发-v1

---
 H5/IPQC_SJ/Add.aspx  |  122 ++++++++++++++++++++----
 H5/Js/IPQC_SJ/Add.js |  142 +++++++++++++++++++++++++++
 2 files changed, 239 insertions(+), 25 deletions(-)

diff --git a/H5/IPQC_SJ/Add.aspx b/H5/IPQC_SJ/Add.aspx
index 4a554d8..bb2767d 100644
--- a/H5/IPQC_SJ/Add.aspx
+++ b/H5/IPQC_SJ/Add.aspx
@@ -105,6 +105,28 @@
                 font-size: 0.16rem !important;
                 color: blue !important;
             }
+
+            /* 姝ヨ繘鍣ㄦ牱寮� */
+            .van-stepper__input
+            {
+              width: .5rem;
+              height: .4rem;
+            }
+            .van-stepper__minus,.van-stepper__plus
+            {
+              width: .5rem;
+              height: .4rem;
+            }
+            /* 鍗曢�夋澶у皬 */
+            .van-radio__icon
+            {
+                -webkit-box-flex: 0;
+                -webkit-flex: none;
+                flex: none;
+                height: 1em;
+                font-size: .3333rem
+            }
+
          
         </style>
 </asp:Content>
@@ -285,35 +307,83 @@
                               <van-field label="椤圭洰鍚嶇О" colon="true" v-model="jymxData.fcheckItem" readonly ></van-field>
                               <van-field label="瑙勬牸瑕佹眰" colon="true" v-model="jymxData.fspecRequ" readonly ></van-field>
                               <van-field label="妫�楠屽伐鍏�" colon="true" v-model="jymxData.fcheckTool" readonly ></van-field>
-                              <van-field label="妫�楠屾暟" colon="true" v-model="jymxData.checkQyt" readonly ></van-field>
+                              <!-- <van-field label="妫�楠屾暟" colon="true" v-model="jymxData.checkQyt" readonly ></van-field> -->
                               <van-field label="涓嬮檺" colon="true" v-model="jymxData.fdownAllow" readonly ></van-field>
                               <van-field label="鏍囧噯鍊�" colon="true" v-model="jymxData.fstand" readonly ></van-field>
                               <van-field label="涓婇檺" colon="true" v-model="jymxData.fupAllow" readonly ></van-field>
                               <%--<van-field label="AC鏁�" colon="true" v-model="jymxData.facQty" readonly ></van-field>--%>
-                              <van-field label="RE鏁�" colon="true" v-model="jymxData.freQty" readonly ></van-field>
-                              <van-field label="鏍锋湰鏁�" colon="true" v-model="jymxData.ybsl" readonly ></van-field>
+                              <!-- <van-field label="RE鏁�" colon="true" v-model="jymxData.freQty" readonly ></van-field> -->
+                              <!-- <van-field label="鏍锋湰鏁�" colon="true" v-model="jymxData.ybsl" readonly ></van-field> -->
                               <%--<van-field label="棰勮缁撴灉" colon="true" v-model="jymxData.result" readonly ></van-field>--%>
                               <%--<van-field label="缁撴灉褰曞叆" colon="true" v-model="resultValue"  placeholder="璇疯緭鍏K-鏁板瓧鎴朜G-鏁板瓧"></van-field>--%>
                               
-                              <van-field label="妫�娴嬬粨鏋�" colon="true" readonly >
-                                   <template #input>
-                                       <div style="text-align: center;">
-                                           <van-tag round plain v-if="jymxData.fcheckResu === 'Y:鍚堟牸'" type="success">鍚堟牸</van-tag>
-                                           <van-tag round plain v-else-if="jymxData.fcheckResu === 'N:涓嶅悎鏍�'" type="danger">涓嶅悎鏍�</van-tag>
-                                           <van-tag round plain v-else type="warning">杩涜涓�</van-tag>
-                                       </div>
-                                   </template>
-                                </van-field>
+                              <van-field label="鐢熶骇鏃ユ湡" v-if="jymxData.fcheckType === '鍏抽敭閮ㄤ欢涓�鑷存��'" colon readonly class="wrap-field"> 
+                                <template #input>
+                                    <div class="wrap-content" @click="showScDatePicker = true">{{ jymxData.ipqcrzxxDate || '璇烽�夋嫨鏃ユ湡' }}</div>
+                                </template>
+                                <!-- <template #button>
+                                  <van-tag type="primary" style="font-size:15px" @click="showScDatePicker = true">閫夋嫨</van-tag>
+                                </template> -->
+                            </van-field>
+                            <!-- 鍙湁褰� jymxData.fcheckType 绛変簬 "鍝佹按娴嬭瘯" 鏃舵墠鏄剧ず璇ュ瓧娈� -->
+                            <van-field v-if="jymxData.fcheckType === '鍝佹按娴嬭瘯'" label="鏄惁鏈夊紓鍛�" colon="true" readonly>
+                              <template #input>
+                                <van-radio-group 
+                                  v-model="jymxData.ipqCpscs"
+                                  direction="horizontal"
+                                  class="custom-radio-group"
+                                  @change="updateCpscs">
+                                  <van-radio name="Y" shape="square">鏈�</van-radio>
+                                  <van-radio name="N" shape="square">鏃�</van-radio>
+                                </van-radio-group>
+                              </template>
+                            </van-field>
 
-                              <van-field label="璁よ瘉淇℃伅"   v-if='jymxData.isrzxx == 1' colon v-model="rzxxValue" placeholder="璇疯緭鍏ヨ璇佷俊鎭�" readonly class="wrap-field"> 
-                                   <template #input>
-                                       <div class="wrap-content">{{ rzxxValue }}</div>
-                                     </template>
+                              <van-field 
+                                label="浣跨敤鏁伴噺" 
+                                colon="true" 
+                                v-if="jymxData.fcheckType === '鍏抽敭閮ㄤ欢涓�鑷存��'">
+                                <template #input>
+                                  <van-stepper 
+                                    v-model="jymxData.ipqcrzxxNum" 
+                                    integer 
+                                    @change="updateRzxxNum(jymxData.ipqcrzxxNum)"
+                                  />
+                                </template>
+                              </van-field>
+
+                              <van-field label="璁よ瘉淇℃伅"   v-if="jymxData.fcheckType === '鍏抽敭閮ㄤ欢涓�鑷存��'" colon v-model="jymxData.ipqcrzxx" placeholder="璇烽�夋嫨璁よ瘉淇℃伅"  class="wrap-field" readonly> 
                                    <template #button>
-                                     <van-tag type="primary" style="font-size:15px" @click="updateRzxx()">杈撳叆</van-tag>
+                                     <van-tag type="primary" style="font-size:15px" @click="selectRzxx()">閫夋嫨</van-tag>
                                    </template>
                                </van-field>
-                             <van-dialog v-model="showDialogRzxx" title="璁よ瘉淇℃伅" :show-cancel-button="false"  @confirm="rzxxConfirm">
+                               <van-action-sheet 
+                                  v-model="showRzxx" 
+                                  :actions="actions" 
+                                  @select="onRzxxSelect"
+                                  title="璇烽�夋嫨璁よ瘉淇℃伅">
+                              </van-action-sheet>
+                               
+
+                            <van-popup v-model="showScDatePicker" position="bottom">
+                              <van-datetime-picker
+                                v-model="currentDate"
+                                type="date"
+                                title="閫夋嫨鐢熶骇鏃ユ湡"
+                                :min-date="minDate"
+                                :max-date="maxDate"
+                                @confirm="confirmScDate"
+                                @cancel="showScDatePicker = false"
+                              />
+                            </van-popup>
+                               <template #input>
+                                    <div class="wrap-content">{{ rzxxValue }}</div>
+                                  </template>
+                                <template #button>
+                                  <van-tag type="primary" style="font-size:15px" @click="selectRzxx()">閫夋嫨</van-tag>
+                                </template>
+                            </van-field>
+                             <!-- <van-dialog v-model="showDialogRzxx" title="璁よ瘉淇℃伅" :show-cancel-button="false"  @confirm="rzxxConfirm">
                                <van-field
                                  v-model="rzxxValue"
                                  rows="5"
@@ -323,15 +393,25 @@
                                  placeholder="璇疯緭鍏ヨ璇佷俊鎭�"
                                  show-word-limit
                              />
-                            </van-dialog>
+                            </van-dialog> -->
                             <van-button 
                             block 
                             type="info" 
                             @click="openZrPopup"
                             :loading="ttrre"
                             loading-text="鍔犺浇涓�..."
-                            v-if="jymxData.fcheckItem === '鍒剁儹鎬ц兘'"
+                            v-if="jymxData.fcheckType === '鍒剁儹鎬ц兘'"
                         >鍒剁儹鎬ц兘褰曞叆</van-button>
+
+                        <van-field label="妫�娴嬬粨鏋�" colon="true" readonly >
+                          <template #input>
+                              <div style="text-align: center;">
+                                  <van-tag round plain v-if="jymxData.fcheckResu === 'Y:鍚堟牸'" type="success">鍚堟牸</van-tag>
+                                  <van-tag round plain v-else-if="jymxData.fcheckResu === 'N:涓嶅悎鏍�'" type="danger">涓嶅悎鏍�</van-tag>
+                                  <van-tag round plain v-else type="warning">杩涜涓�</van-tag>
+                              </div>
+                          </template>
+                       </van-field>
                              
                     </template>
                     <template>
@@ -556,7 +636,7 @@
   <%--<comback ></comback>--%>
 </asp:Content>
 <asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
- <script src="../Js/IPQC_SJ/Add.js?<%=111112111148 %>"></script>
+ <script src="../Js/IPQC_SJ/Add.js?<%=111112111154 %>"></script>
 </asp:Content>
 
 
diff --git a/H5/Js/IPQC_SJ/Add.js b/H5/Js/IPQC_SJ/Add.js
index a279da8..914d032 100644
--- a/H5/Js/IPQC_SJ/Add.js
+++ b/H5/Js/IPQC_SJ/Add.js
@@ -98,6 +98,17 @@
                 //    message: '涓婁紶澶辫触',
                 //},
             ],
+
+            //鏃堕棿閫夋嫨鍙傛暟
+            showScDatePicker: false,
+            minDate: new Date(new Date().getFullYear() - 1, 0, 1),  // 杩囧幓涓�骞�
+            maxDate: new Date(new Date().getFullYear() + 1, 11, 31), // 鏈潵涓�骞�
+            currentDate: new Date(),
+            scDate: '',  // 瀛樺偍鏍煎紡鍖栧悗鐨勬棩鏈�
+
+            //璁よ瘉淇℃伅閫夋嫨
+            showRzxx: false,
+            actions: [],
         }
     },
     mounted() {
@@ -342,9 +353,10 @@
             this.showDialog= true
         },
 
-        updateRzxx() {
-            this.showDialogRzxx = true
-        },
+        // updateRzxx() {
+        //     this.showDialogRzxx = true
+        // },
+        //鍒犻櫎妫�楠屾槑缁嗚褰�
         deleteDetail13(guid12) {
             const that = this;
             var guid1 = that.formData.guid;//涓昏〃id
@@ -380,6 +392,7 @@
                 that.isLoading = false;
             });
         },
+        //鏇存柊璁よ瘉淇℃伅
         rzxxConfirm() {
             var that = this;
             var guid1 = that.formData.guid;//涓昏〃id
@@ -393,7 +406,7 @@
                 var json = res;
                 if (json.status == 0) {
                     that.$notify({ type: 'success', message: '杈撳叆鎴愬姛' });
-                    that.refreshJYItem();//鍒锋柊妫�楠岄」鐩�
+                    //that.refreshJYItem();//鍒锋柊妫�楠岄」鐩�
                 }
                 else {
                     that.$toast.fail(json.message);
@@ -406,6 +419,7 @@
                 that.isLoading = false;
             });
         },
+        //鏇存柊涓嶅悎鏍艰〃杩�
         remarksConfirm() {
             const that = this;
             that.isLoading = true;
@@ -666,5 +680,125 @@
             }, 100);
             console.log(that.formTbData.temperatureData);
         },
+        //淇濆瓨鐢熶骇鏃ユ湡
+        confirmScDate(value) {
+            const date = new Date(value);
+            this.scDate = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
+            //this.rzxxValue = this.scDate; // 鍚屾椂鏇存柊璁よ瘉淇℃伅瀛楁
+            console.log(this.scDate);
+
+            var that = this;
+            var guid1 = that.formData.guid;//涓昏〃id
+            var mxguid = that.tableData[that.tabActive].guid;//妫�楠岄」鐩殑guid
+            that.isLoading = true;
+            that.AxiosHttp("post", 'Ipqc/updateScDate', {
+                gid: guid1,
+                mxguid: mxguid,
+                scDateValue: that.scDate,//杈撳叆鐨勮璇佷俊鎭�
+            }, true, 0).then(function (res) {
+                var json = res;
+                if (json.status == 0) {
+                    that.$notify({ type: 'success', message: '杈撳叆鎴愬姛' });
+                    that.refreshJYItem();//鍒锋柊妫�楠岄」鐩�
+                }
+                else {
+                    that.$toast.fail(json.message);
+                }
+                //that.$notify({ type: 'success', message: json.message });
+                that.isLoading = false;
+            }).catch(function (error) {
+                that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+                that.inRzxxValue = null;
+                that.isLoading = false;
+            });
+
+            this.showScDatePicker = false;
+        },
+
+        selectRzxx() {
+            this.showRzxx = true;
+            this.getRzxxList();
+        },
+        //鑾峰彇璁よ瘉淇℃伅鐩稿叧鍒楄〃
+        getRzxxList() {
+            var that = this;
+            that.isLoading = true;
+            var mxguid = that.tableData[that.tabActive].guid;//妫�楠岄」鐩殑guid
+            that.AxiosHttp("post", 'Ipqc/GetRzxxList', {
+                // 鏍规嵁瀹為檯鎺ュ彛闇�瑕佷紶閫掑弬鏁�
+                mxguid: mxguid,
+            }, false)
+            .then(function (res) {
+                if (res.status == 0) {
+                    that.actions = res.data.tbBillList.map(item => {
+                        return { name: item.defect_name } // 鏍规嵁瀹為檯鏁版嵁缁撴瀯璋冩暣
+                    });
+                } else {
+                    that.$toast.fail(res.message);
+                }
+                that.isLoading = false;
+            })
+            .catch(function (error) {
+                that.isLoading = false;
+                that.$toast.fail("鑾峰彇璁よ瘉淇℃伅澶辫触");
+            });
+        },
+        //閫夋嫨璁よ瘉淇℃伅
+        onRzxxSelect(item) {
+            this.showRzxx = false;
+            this.rzxxValue = item.name;
+            this.rzxxConfirm();
+            //this.refreshJYItem();//鍒锋柊妫�楠岄」鐩�
+            // 濡傛灉闇�瑕佽幏鍙栬缁嗕俊鎭彲鍦ㄦ澶勮皟鐢ㄥ叾浠栨柟娉�
+        },
+        //鏇存柊璁よ瘉淇℃伅浣跨敤鏁伴噺
+        updateRzxxNum(value, index) {
+            // 娣诲姞闃叉姈鍒ゆ柇
+            if (this.isLoading) {
+                return;
+            }
+
+            const that = this;
+            that.isLoading = true;
+            that.AxiosHttp("post", 'Ipqc/saveIpqcrzxxNum', {
+                guid: that.tableData[that.tabActive].guid,
+                ipqcrzxxNum: value
+            }, true, 0).then(res => {
+                if (res.status == 0) {
+                    //that.$notify({ type: 'success', message: '鏁伴噺鏇存柊鎴愬姛' });
+                    //that.refreshJYItem();//鍒锋柊妫�楠岄」鐩�
+                } else {
+                    that.$toast.fail(res.rtnMsg);
+                }
+                that.isLoading = false;
+            }).catch(error => {
+                that.isLoading = false;
+                that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+            });
+        },
+        //鏇存柊鏄惁鏈夋棤寮傚懗
+        updateCpscs(value) {
+            // 娣诲姞闃叉姈鍒ゆ柇
+            if (this.isLoading) {
+                return;
+            }
+            const that = this;
+            that.isLoading = true;
+            if (!value) return;
+            that.AxiosHttp("post", 'Ipqc/saveIpqCpscs', {
+                guid: that.tableData[that.tabActive].guid,
+                ipqCpscs: value
+            }, true, 0).then(res => {
+                if (res.status == 0) {
+                    //that.refreshJYItem();
+                } else {
+                    that.$toast.fail(res.rtnMsg);
+                }
+                that.isLoading = false;
+            }).catch(error => {
+                that.isLoading = false;
+                that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+            });
+        },
     }
 })

--
Gitblit v1.9.3