xwt
6 天以前 c3c23631be761f336789f4cc11d33fab2ec9f125
来料检修改,推送钉钉修改
已修改4个文件
296 ■■■■ 文件已修改
manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/LLJ/Add.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/XJ/Add.vue 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
store/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json
@@ -2,7 +2,7 @@
    "name" : "GS-MES-AP",
    "appid" : "__UNI__F08FAE3",
    "description" : "",
    "versionName" : "1.1.3.0",
    "versionName" : "1.1.3.1",
    "versionCode" : 1,
    "transformPx" : false,
    /* 5+App特有相关 */
pages/QC/LLJ/Add.vue
@@ -63,37 +63,23 @@
        </view>
        <view class="dropdown-row">
            <view class="info-label">不良原因:</view>
            <select id="defect-reason" v-model="badreason" v-if="current" @change="saveRemarksGid">
                <option value=""></option>
                <option value="外观不良">外观不良</option>
                <option value="尺寸不良">尺寸不良</option>
                <option value="包装不良">包装不良</option>
                <option value="性能不良">性能不良</option>
                <option value="装配不良">装配不良</option>
                <option value="安规不良">安规不良</option>
            </select>
            <picker v-if="current" :value="badreasonIndex" :range="badreasonOptions" @change="onBadreasonChange">
                <view class="picker-text" :class="{ 'selected': badreason }">{{ badreason || '' }}</view>
            </picker>
            <view v-else class="info-value">{{ badreason }}</view>
        </view>
        <view class="dropdown-row">
            <view class="info-label">所属车间:</view>
            <select id="defect-reason" v-model="WORKSHOP" v-if="current" @change="saveRemarksGid">
                <option value=""></option>
                <option value="生产一部">生产一部</option>
                <option value="生产二部">生产二部</option>
                <option value="注塑车间">注塑车间</option>
                <option value="其他">其他</option>
            </select>
            <picker v-if="current" :value="workshopIndex" :range="workshopOptions" @change="onWorkshopChange">
                <view class="picker-text" :class="{ 'selected': WORKSHOP }">{{ WORKSHOP || '' }}</view>
            </picker>
            <view v-else class="info-value">{{ WORKSHOP }}</view>
        </view>
        <view class="dropdown-row">
            <view class="info-label">评审状态:</view>
            <select id="defect-reason" v-model="PSTYPE" v-if="current" @change="saveRemarksGid">
                <option value=""></option>
                <option value="特采/让步使用">特采/让步使用</option>
                <option value="挑选/返工使用">挑选/返工使用</option>
                <option value="退货">退货</option>
                <option value="待判">待判</option>
            </select>
            <picker v-if="current" :value="pstypeIndex" :range="pstypeOptions" @change="onPstypeChange">
                <view class="picker-text" :class="{ 'selected': PSTYPE }">{{ PSTYPE || '' }}</view>
            </picker>
            <view v-else class="info-value">{{ PSTYPE }}</view>
        </view>
                    <view class="info-block" style="margin-top: 10px;">   
@@ -199,7 +185,7 @@
                        <uni-th align="center" width="90">能否打开文件</uni-th>
                        <uni-th align="center" width="150">操作(点击)</uni-th>
                    </uni-tr>
                    <uni-tr v-for="(item,index) in drawing" style="height: 100px;">
                    <uni-tr v-for="(item,index) in (drawing || [])" style="height: 100px;">
                        <uni-td align="center">{{item.fName}}</uni-td>
                        <uni-td align="center" style="font-size:25px;">
                            <div v-if="item.fRelevantObject==' '" style="color: #E47470;">×</div>
@@ -360,6 +346,13 @@
                PSTYPE: '',
                WORKSHOP: '',
                REMARK: '',
                // picker 选项和索引
                badreasonOptions: ['', '外观不良', '尺寸不良', '包装不良', '性能不良', '装配不良', '安规不良'],
                badreasonIndex: 0,
                workshopOptions: ['', '生产一部', '生产二部', '注塑车间', '其他'],
                workshopIndex: 0,
                pstypeOptions: ['', '特采/让步使用', '挑选/返工使用', '退货', '待判'],
                pstypeIndex: 0,
                checkState: false,
                writeStatu: true,
                fileName:'',
@@ -494,16 +487,68 @@
                this.remarks = this.formData.remarks || this.remarks || '';
                console.log('打开弹窗时的remarks值:', this.remarks);
            },
            // picker 事件处理方法
            onBadreasonChange(e) {
                const index = e.detail.value;
                this.badreasonIndex = index;
                this.badreason = this.badreasonOptions[index];
                this.saveRemarksGid('badreason');
            },
            onWorkshopChange(e) {
                const index = e.detail.value;
                this.workshopIndex = index;
                this.WORKSHOP = this.workshopOptions[index];
                this.saveRemarksGid('WORKSHOP');
            },
            onPstypeChange(e) {
                const index = e.detail.value;
                this.pstypeIndex = index;
                this.PSTYPE = this.pstypeOptions[index];
                this.saveRemarksGid('PSTYPE');
            },
            saveRemarksGid(fieldName) {
              // 直接保存到数据库
              const requestData = {
                  gid: this.formData.id,
                  releaseNo: this.formData.releaseNo,
                  BLYY: this.badreason || '',
                  SSCJ: this.WORKSHOP || '',
                  PSZT: this.PSTYPE || ''
              };
              console.log('发送的数据:', requestData);
              console.log('badreason:', this.badreason);
              console.log('WORKSHOP:', this.WORKSHOP);
              console.log('PSTYPE:', this.PSTYPE);
              console.log('选择的字段:', fieldName);
              this.$post({
                  url: "/LLJ/saveDropdownFields",
                  data: requestData
              }).then(res => {
                  if (res && res.data && res.data.data && res.data.data.tbBillList && res.data.data.tbBillList.length > 0) {
                      // 延迟重新加载数据,确保数据库更新完成
                      setTimeout(() => {
                          this.init();
                      }, 500);
                  }
              }).catch(err => {
                  console.error('保存失败:', err);
              });
            },
            submitInspection() {
                if (this.PSTYPE == '') {
                    this.writeStatu = false
                }
                if (this.badreason == '') {
                    this.writeStatu = false
                }
                if (this.DEPARTMENT == '') {
                    this.writeStatu = false
                }
                // 重置验证状态
                this.writeStatu = true;
                // if (this.PSTYPE == '') {
                //     this.writeStatu = false
                // }
                // if (this.badreason == '') {
                //     this.writeStatu = false
                // }
                // 移除对未定义变量DEPARTMENT的检查
                // if (this.DEPARTMENT == '') {
                //     this.writeStatu = false
                // }
                console.log(this.tableData)
                this.checkState = false;
@@ -514,9 +559,9 @@
                })
                if (this.checkState) {
                    if (this.formData.fngDesc == '' || this.writeStatu == false) {
                    if (this.formData.fngDesc == '') {
                        uni.showToast({
                            title: '未填写不良描述或不良原因或所属车间或评审状态',
                            title: '未填写不良描述',
                            icon: 'none'
                        });
                    } else {
@@ -538,13 +583,13 @@
                                        suppName: this.formData.suppName,
                                        appicationReason: this.formData.fngDesc,
                                        badReason: this.badreason,
                                        remark: this.REMARK,
                                        remark: this.remarks || '',
                                        workShop: this.WORKSHOP,
                                        releaseNo: this.formData.releaseNo,
                                        staffNo: 'HMCS',
                                        // staffNo: this.$loginInfo.account,
                                        iqcStatus: this.PSTYPE,
                                        department: this.DEPARTMENT,
                                        department: this.WORKSHOP, // 使用WORKSHOP替代未定义的DEPARTMENT
                                        EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 确保紧急放行状态正确传递
                                    };
                                }
@@ -556,13 +601,13 @@
                                        suppName: this.formData.suppName,
                                        appicationReason: this.formData.fngDesc,
                                        badReason: this.badreason,
                                        remark: this.REMARK,
                                        remark: this.remarks || '',
                                        workShop: this.WORKSHOP,
                                        releaseNo: this.formData.releaseNo,
                                        // staffNo: 'HMCS',
                                        staffNo: this.$loginInfo.account,
                                        iqcStatus: this.PSTYPE,
                                        department: this.DEPARTMENT,
                                        department: this.WORKSHOP, // 使用WORKSHOP替代未定义的DEPARTMENT
                                        EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 确保紧急放行状态正确传递
                                    };
                                }
@@ -693,6 +738,11 @@
                        this.PSTYPE = data.pszt || '';
                        this.WORKSHOP = data.sscj || '';
                        this.remarks = data.remarks || ''; // 设置remarks变量
                        // 设置 picker 索引
                        this.badreasonIndex = this.badreasonOptions.indexOf(this.badreason);
                        this.workshopIndex = this.workshopOptions.indexOf(this.WORKSHOP);
                        this.pstypeIndex = this.pstypeOptions.indexOf(this.PSTYPE);
                        
                        // 确保PHSY字段被正确设置
@@ -782,7 +832,7 @@
                    success: (response) => {
                        console.log(response)
                        if (response.data.data == '返回结果为空') {
                            _this.drawing = null
                            _this.drawing = []
                        } else {
                            _this.drawing = response.data.data
                            // 遍历数据,判断文件后缀并添加字段
@@ -1245,11 +1295,13 @@
                            if (res.data.tbBillList > 0) {
                                this.formData.remarks = this.remarks;
                                this.remarksPopup = !this.remarksPopup;
                                this.$showMessage("保存成功");
                                // 立即重新加载数据确保同步
                                setTimeout(() => {
                                    this.init();
                                }, 2000);
                                }, 500);
                            }
                        }).catch(err => {
                            console.error('保存失败:', err);
                        })
                    },
            addDestruction() {
@@ -1280,11 +1332,13 @@
                    if (res.data.tbBillList > 0) {
                        this.formData.PHSY = this.PHSY === '' ? null : this.PHSY;
                        this.destructionPopup = false;
                        this.$showMessage("保存成功");
                        // 立即重新加载数据确保同步
                        setTimeout(() => {
                            this.init();
                        }, 2000);
                        }, 500);
                    }
                }).catch(err => {
                    console.error('保存失败:', err);
                })
            },
            clearDestruction() {
@@ -1300,11 +1354,13 @@
                    if (res.data.tbBillList > 0) {
                        this.formData.PHSY = null;
                        this.destructionPopup = false;
                        this.$showMessage("清除成功");
                        // 立即重新加载数据确保同步
                        setTimeout(() => {
                            this.init();
                        }, 2000);
                        }, 500);
                    }
                }).catch(err => {
                    console.error('清除失败:', err);
                })
            },
            viewAttachmentInfo() {
@@ -1872,22 +1928,7 @@
                }
                // #endif
            },
            saveRemarksGid() {
              this.$post({
                url: "/LLJ/saveDropdownFields",
                data: {
                  gid: this.formData.id,
                  releaseNo: this.formData.releaseNo,
                  BLYY: this.badreason || '',
                  SSCJ: this.WORKSHOP || '',
                  PSZT: this.PSTYPE || ''
                }
              }).then(res => {
                if (res.data.tbBillList > 0) {
                  this.$showMessage("自动保存成功");
                }
              });
            },
        }
    }
</script>
@@ -1948,6 +1989,24 @@
        color: #2c3e50;
        margin-right: 20px;
    }
    .picker-text {
        padding: 6px 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        background-color: white;
        color: #999;
        font-size: 14px;
        min-height: 32px;
        display: flex;
        align-items: center;
        max-width: 150px;
    }
    .picker-text.selected {
        color: #e74c3c;
        font-weight: 500;
    }
    .highlight {
        font-weight: bold;
pages/QC/XJ/Add.vue
@@ -40,20 +40,16 @@
              <view v-else class="info-value">{{ formData.daa020 }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">物料编码</view>
              <picker v-if="isUpdate" class="picker-input" name="selector" :range="ItemList"
                      @change="onItemChange">
                <view class="picker-value">{{ ItemList[ItemIndex] || '请选择' }}</view>
              </picker>
              <view v-else class="info-value">{{ formData.itemNo }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">工单单号</view>
              <picker v-if="isUpdate" class="picker-input" name="selector" :range="DAA001List"
                      @change="onDaa001Change">
                <view class="picker-value">{{ DAA001List[DAA001Index] || '请选择' }}</view>
              </picker>
              <view v-else class="info-value">{{ formData.billNo }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">物料编码</view>
              <view class="info-value">{{ formData.itemNo }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">物料名称</view>
@@ -173,16 +169,12 @@
        DAA020Index: -1,
        filteredDAA020List: [],
  
        DAA001List: [],
                DAA001List: [],
        DAA001Index: -1,
        schemeResult: [],
        isShowTable: false,
        ItemList: [],
        ItemIndex: -1,
        boardItems: [],
                isShowTable: false,
        lineList: [],
  
        lineNo: "",
@@ -376,86 +368,57 @@
        });
      },
      
      //生产线别选择并初始话工单号
            //生产线别选择并初始化工单号
      onDaa020Change(event) {
        //获取生产线别的下标地址
        this.DAA020Index = event.mp.detail.value;
        this.lineNo = this.lineList[this.DAA020Index].lineNo;
        this.$post({
          url: "/XJ/getBoardItem",
          data: {
            lineNo: this.lineNo
          }
        }).then(res => {
          //填充工单号的数据源
          this.boardItems = res.data.tbBillList;
          this.ItemList = this.boardItems.map(item => item.itemNo);
          //变为默认空值的状态
          this.ItemIndex = -1;
        })
      },
      onItemChange(event) {
        this.ItemIndex = event.mp.detail.value;
        this.formData.itemNo = this.boardItems[this.ItemIndex].itemNo;//主要是改这里
        this.formData.itemId = this.boardItems[this.ItemIndex].id;//主要是改这里
        this.formData.itemName = this.boardItems[this.ItemIndex].itemName;//主要是改这里
        this.formData.itemModel = this.boardItems[this.ItemIndex].itemModel;//主要是改这里
        this.$post({
          url: "/XJ/getDaa001",
          data: {
            daa020: this.lineNo,
            item: this.formData.itemNo
            daa020: this.lineNo
          }
        }).then(res => {
          //填充工单号的数据源
          this.schemeResult = res.data.tbBillList;
          this.DAA001List = this.schemeResult.map(s => s.daa001);
          this.DAA001List = this.schemeResult.map(s => s.Daa001);
          //变为默认空值的状态
          this.DAA001Index = -1;
          this.formData.billNo = "";
        })
      },
      //选取工单填充物料号和其他信息
            //选取工单填充物料号和其他信息
      onDaa001Change(event) {
        this.DAA001Index = event.mp.detail.value;
        this.formData.billNo = this.schemeResult[this.DAA001Index].daa001;
        this.formData.planQty = this.schemeResult[this.DAA001Index].daa008;
        //表单中的部分字段赋值
        const selectedWorkOrder = this.schemeResult[this.DAA001Index];
        this.formData.billNo = selectedWorkOrder.Daa001;
        this.formData.planQty = selectedWorkOrder.Daa008;
        // 从工单数据中获取物料信息
        this.formData.itemNo = selectedWorkOrder.ItemNo; // 物料编码
        this.formData.itemName = selectedWorkOrder.ItemName; // 物料名称
        this.formData.itemModel = selectedWorkOrder.ItemModel; // 规格型号
        // 获取检验项目
        this.$post({
          url: "/XJ/getItem",
          url: "/XJ/setJYItem",
          data: {
            daa001: this.formData.billNo
            itemNo: this.formData.itemNo
          }
        }).then(res => {
          let data = res.data.tbBillList[0];
          //当返回的结果集为空时置空原有的值
          if (!data) {
            this.formData.billNo = "";
            this.formData.itemNo = "";
            this.formData.planQty = "";
          if (res.data.tbBillList.length > 0) {
            this.tableData = res.data.tbBillList;
            this.isSubmit = false;
          } else {
            this.$showMessage("此物料没有启用的检验项目,请维护!");
            this.isSubmit = true;
            this.tableData = [];
            return;
          }
          this.$post({
            url: "/XJ/setJYItem",
            data: {
              itemNo: this.formData.itemNo
            }
          }).then(res => {
            if (res.data.tbBillList.length > 0) {
              this.tableData = res.data.tbBillList; // 在箭头函数中,this 指向外层作用域的 this
              this.isSubmit = false;
            } else {
              this.$showMessage("此物料没有启用的检验项目,请维护!");
              this.isSubmit = true;
              this.tableData = [];
            }
          });
        });
      },
      init() {
store/index.js
@@ -10,9 +10,9 @@
            networkFlag:'内网', 
            serverURLInt:'http://192.168.11.251:10055',//服务器体检 10.0.1.104:10054
            serverURL:'http://localhost:10055',//本地调试地址
            serverAPI:'http://localhost:5184/api',//当前正在使用的服务器,默认为外网  localhost
            //serverAPI:'http://localhost:5184/api',//当前正在使用的服务器,默认为外网  localhost
            //serverAPI:'http://192.168.1.22:10054/api',//内网 
            //serverAPI:'http://36.26.21.214:10055/api',
            serverAPI:'http://36.26.21.214:10055/api',
            ftpServer:'ftp://36.26.21.214',//FTP服务器地址
        }
    },