王震
2023-11-09 4d0093d34b0928c810582d745279c77e15502e56
Merge remote-tracking branch 'origin/master'

# Conflicts:
# src/views/quality/finishedProductInspection/finishedProduct-form.vue
已修改4个文件
318 ■■■■ 文件已修改
src/views/equipment/metering/index.vue 145 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProduct-form.vue 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/processInspect/processInspect-form.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/rawMaterial-form.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipment/metering/index.vue
@@ -37,7 +37,7 @@
        uploadInfo: {
          // 是否展示上传EXCEL以及对应的url
          isShow: true,
          url: '/mes/equipment/upload'
          url: '/mes/equipmentDevice/upload'
        },
        prelang: 'workstation',
        options: {
@@ -94,41 +94,23 @@
            //   isSearch: true,
            //   searchInfoType: 'text'
            // },
            {
              minWidth: '30',
              prop: 'type',
              label: '设备类型',
            //   sort: true,
              isTrue: true,
              isSearch: true,
            //   searchInfoType: 'select',
              formatter: this.workShopFormatter,
            //   optList: () => {
            //     return this.workshopList
            //   }
            },
            // {
            //   minWidth: '30',
            //   prop: 'type',
            //   label: '设备类型',
            // //   sort: true,
            //   isTrue: true,
            //   isSearch: true,
            // //   searchInfoType: 'select',
            //   formatter: this.workShopFormatter,
            // //   optList: () => {
            // //     return this.workshopList
            // //   }
            // },
            // 型号规格
            {
              minWidth: '30',
              prop: 'supplier',
              label: '厂家',
              sort: true,
              isTrue: true,
              isSearch: false,
              searchInfoType: 'text'
            },
                         // 状态
                         {
              minWidth: '30',
              prop: 'status',
              label: '状态',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            // 制造日期
            {
 // 制造日期
 {
              minWidth: '150',
              width: '250',
              prop: 'createTime',
@@ -151,6 +133,99 @@
              isSearch: true,
              searchInfoType: 'datetime'
            },
            {
              minWidth: '30',
              prop: 'createUser',
              label: '负责人',
              sort: true,
              isTrue: true,
              isSearch: false,
              searchInfoType: 'text'
            },
            {
              minWidth: '30',
              prop: 'supplier',
              label: '厂家',
              sort: true,
              isTrue: true,
              isSearch: false,
              searchInfoType: 'text'
            },
                         // 状态
                         {
              minWidth: '30',
              prop: 'status',
              label: '状态',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
               // 状态
               {
              minWidth: '30',
              prop: 'responsibleDepartment',
              label: '负责部门',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '30',
              prop: 'InspectionUnit',
              label: '检验单位',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '30',
              prop: 'certificate',
              label: '证书编号',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '30',
              prop: 'verification',
              label: '检定',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '30',
              prop: 'classification',
              label: '分类',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '30',
              prop: 'FixedPointPosition',
              label: '定点位置',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '30',
              prop: 'specifications',
              label: '规格',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
          ],
          toolbar: [
            {
src/views/quality/finishedProductInspection/finishedProduct-form.vue
@@ -13,7 +13,7 @@
    </div>
    <div class="page-main">
        <div class="finishedProduct-basic">
            <el-form :model="processInspectVo" ref="addInspectionform" class="l-mes"
            <el-form :model="processInspectVo" ref="addInspectionform" class="l-mes"
            label-position="right" label-width="120px" style="width: 100%" size="small">
                <div class="formwrapper">
                    <el-row>
@@ -75,13 +75,8 @@
                </div>
            </el-form>
        </div>
        <div class="finishedProduct-detail">
            <el-row style="width:100%;z-index: 10;height:30px;">
                <!-- <el-col :span="12" class="inspectionProject_span" @click="increase">添加</el-col> -->
                <el-col :span="12" class="inspectionProject_span">检验项目</el-col>
                <el-col v-if="resultVal==null" :span="12" class="inspectionProject_span" style="text-align: right;">
                    <el-button size="mini" @click="clickAddInspectionColumn()">添加检测值列</el-button>
@@ -91,7 +86,7 @@
            <el-row style="width:100%;">
                <el-col :span="24">
                    <el-table border :data="inspectionItems" height="400"
                        :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
                        :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
                        :cell-style="{textAlign:'center'}" row-key="iid" default-expand-all
                        style="width: 100%" ref="table" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
                        <el-table-column type="index" label="序号" width="60"></el-table-column>
@@ -101,10 +96,10 @@
                        <el-table-column prop="required" label="标准值" width="240" ></el-table-column>
                        <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index" label="检测值"
                            width="240" style="text-align: center;">
                            <template slot-scope="scope">
                                <el-col v-if="scope.row.itype === '1'">
                                    <el-tooltip v-if="scope.row.iname!=null" :disabled="scope.row.eId != null"
                                    <el-tooltip v-if="scope.row.iname!=null" :disabled="scope.row.eId != null"
                                        class="item" effect="dark" content="请先选择设备!"
                                            placement="top-start">
                                            <el-input :disabled="scope.row.eId == null" v-model="scope.row.empiricalValueAddss[index]"
@@ -131,9 +126,9 @@
                                <span v-if="resultVal!=null && processInspectVo.id!=null" v-text="scope.row.ename"></span>
                                <div v-else>
                                    <el-input  v-model="scope.row.eId"  v-if="scope.row.iname != null" placeholder="请输入设备号"></el-input>
                                    <!-- <el-select style="width:100%" v-model="scope.row.eId"
                                    <!-- <el-select style="width:100%" v-model="scope.row.eId"
                                    v-if="scope.row.iname != null" filterable @change="updateDevice(scope.row,scope.$index)">
                                        <el-option v-for="(item,index) in deviceList"
                                        <el-option v-for="(item,index) in deviceList"
                                        :key="index" :value="item.id" :label="item.number +'-'+ item.name"></el-option>
                                    </el-select> -->
                                </div>
@@ -182,37 +177,6 @@
                </el-col>
            </el-row>
        </div>
        <div class="finishedProduct-result">
            <el-row style="width:100%">
                <el-col :span="24">检测结果</el-col>
@@ -220,7 +184,7 @@
            <el-row style="width:100%;">
                <el-col :span="24">
                    <el-table border height="90" :data="inspectionResultForm"
                    :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
                    :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
                    :cell-style="{textAlign:'center'}">
                        <el-table-column prop="materialCode" label="物料编号"></el-table-column>
                        <el-table-column prop="material" label="物料名称"></el-table-column>
@@ -245,7 +209,7 @@
</template>
<script>
import {
import {
    chooseMater,
    addFinish,
    queryById,
@@ -309,7 +273,7 @@
        this.init()
    },
    methods: {
        submitSave(){
            let pro = 0
            this.inspectionItems.forEach(item => {
@@ -618,4 +582,4 @@
  border-top: 0 !important;
  cursor: pointer !important;
}
</style>
</style>
src/views/quality/processInspect/processInspect-form.vue
@@ -143,7 +143,7 @@
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index"
                            <el-table-column
                                label="检验描述" width="240" style="text-align: center;">
                                <template slot-scope="scope">
                                    <el-col v-if="scope.row.itype === '1'">
@@ -151,26 +151,26 @@
                                            class="item" effect="dark" content="请先选择设备!" placement="top-start">
                                            <el-input :disabled="scope.row.eId == null"
                                                v-model="scope.row.inote"
                                                @blur="changeState(scope.row, index)" placeholder="请输入检验描述"></el-input>
                                                @blur="changeState(scope.row, inote)" placeholder="请输入检验描述"></el-input>
                                            <span v-if="resultVal != null && processInspectVo.id != null"
                                                v-text="scope.row.inote"></span>
                                        </el-tooltip>
                                    </el-col>
                                    <el-col v-else>
                                <el-col v-else>
                                        <el-tooltip v-if="scope.row.iname != null" :disabled="scope.row.eId != null"
                                            class="item" effect="dark" content="请先选择设备!" placement="top-start">
                                            <!-- <el-input :disabled="scope.row.eId == null"
                                                v-model="scope.row.empiricalValueAddss[index]"
                                                @blur="changeState(scope.row, index)" placeholder="请输入检测值"></el-input> -->
                                            <el-select style="width: 100%;" @change="changeState(scope.row, index)" :disabled="scope.row.eId == null" v-model="scope.row.inote" placeholder="请选择">
                                            <el-input :disabled="scope.row.eId == null"
                                                v-model="scope.row.inote"
                                                @blur="changeState(scope.row, inote)" placeholder="请输入检测值"></el-input>
                                            <!-- <el-select style="width: 100%;" @change="changeState(scope.row, inote)" :disabled="scope.row.eId == null" v-model="scope.row.inote" placeholder="请选择">
                                                <el-option v-for="item in dataVal" :key="item.value" :label="item.label"
                                                    :value="item.value">
                                                </el-option>
                                            </el-select>
                                            <span v-if="resultVal != null && processInspectVo.id != null"
                                            </el-select>  -->
                                         <span v-if="resultVal != null && processInspectVo.id != null"
                                                v-text="scope.row.inote"></span>
                                        </el-tooltip>
                                    </el-col>
                                    </el-col>
                                </template>
                            </el-table-column>
                            <el-table-column label="结论" fixed="right" min-width="100">
src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -127,7 +127,7 @@
                  </el-table-column>
                  <el-table-column prop="father" label="检验项目" width="260">
                    <template slot-scope="scope">
                      <el-input v-if="scope.row.children" style="width:120px" :disabled="dataForm.id!=null" v-model="scope.row.father" placeholder="请输入检验项目"></el-input>
                      <el-input v-if="scope.row.children" style="width:90%" :disabled="dataForm.id!=null" v-model="scope.row.father" placeholder="请输入检验项目"></el-input>
                    </template>
                  </el-table-column>
                  <el-table-column prop="name" label="项目" width="260">
@@ -167,8 +167,7 @@
                          <el-col v-else>                                     
                              <el-select style="width: 100%;" 
                              :disabled="scope.row.deviceId == null ||  (dataForm.id!=null&&resultVal!=null)"
                              v-model="scope.row.testValueList[index]" @change="aaa(scope.row)"
                                placeholder="请选择">
                              v-model="scope.row.testValueList[index]" placeholder="请选择">
                                  <el-option v-for="item in dataVal" :key="item.value" :label="item.label"
                                      :value="item.value">
                                  </el-option>
@@ -198,16 +197,18 @@
                  </el-table-column>
                  <el-table-column fixed="right" v-if="dataForm.id != null" prop="testState" label="结论" min-width="150">
                    <template slot-scope="scope">
                      <span v-if="scope.row.testState == 0" style="color:#F56C6C">不合格</span>
                      <span v-else-if="scope.row.testState == 1" style="color:#67C23A">合格</span>
                      <span v-else>暂无结论</span>
                      <div v-if="!scope.row.children">
                        <span v-if="scope.row.testState == 0" style="color:#F56C6C">不合格</span>
                        <span v-else-if="scope.row.testState == 1" style="color:#67C23A">合格</span>
                        <span v-else>暂无结论</span>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column fixed="right" style="background-color: white;" v-if="dataForm.id == null" label="操作" width="150">
                    <template slot-scope="scope">
                      <div v-if="!scope.row.children">
                          <el-button type="text"  @click="addwaydata(scope)">新增</el-button>
                          <el-button type="text" @click="clickDeleteline(scope)">取消</el-button>
                      <div>
                          <el-button v-if="scope.row.father!=null" type="text"  @click="addChildren(scope.row)">添加项目</el-button>
                          <el-button v-else type="text" @click="delChildren(scope,scope.$index)">取消</el-button>
                      </div>
                    </template>
                  </el-table-column>
@@ -337,7 +338,6 @@
            dataRule: {},
            deviceList: [],
            restaurants:[],
            whetherNot:'',
        }
    },
    beforeUpdate(){
@@ -355,9 +355,6 @@
      this.init()
      this.getDeviceList()
      this.restaurants = this.loadAll();
      console.log(this.dataForm);
    },
    watch:{
      dialogVisible(newVal){
@@ -365,7 +362,6 @@
          this.unqualifiedNum = null
        }
      },
    },
    methods:{
      querySearch(queryString, cb) {
@@ -408,11 +404,6 @@
          this.dataForm.message = param.message
          this.dataForm.projectName = param.projectName
          this.projectList = param.rawInsProducts == null ? [] : param.rawInsProducts
          console.log(param.rawInsProducts);
          param.rawInsProducts.forEach(item =>{
            item.iid = Math.random()
            console.log(item);
          })
          param.rawInsProducts.forEach(o=>{
            this.clickAddLine(o)
          })
@@ -426,8 +417,6 @@
        this.showPart = true
      },
      updateDevice(row,index){
        console.log(row);
        return
        if(this.dataForm.id != null){
          updateDeviceById({deviceId:row.deviceId,rpId:row.rpId}).then(res=>{
            this.list[index].testValue = ''
@@ -450,9 +439,6 @@
          this.resultVal = resultVal
          this.conclusionTable[0].testState = resultVal
          sessionStorage.setItem("raw-resultVal-"+this.dataForm.id,resultVal)
      },
      aaa(row){
        console.log(row);
      },
      showDialog(){
        let pro = this.list.filter(item => {
@@ -488,7 +474,6 @@
        if(row){
          let userNameList = []
          row.children.forEach(item => {
            console.log("item--",item);
              item.iid = Math.random()
              let arr = []
              item.testValue = ''
@@ -503,7 +488,6 @@
              if (arr.length > this.empiricalValueAdd) {
                  this.empiricalValueAdd = arr.length
              }
            console.log("aaaa----",row);
            this.list.push(row)
          })
        }else{
@@ -623,38 +607,29 @@
          this.conclusionTable = []
        }
      },
       // 删除行
       clickDeleteline(scope) {
        console.log(scope);
        let index = this.list.findIndex(el =>{
          return el.children.find(ele => ele.iid == scope.row.iid)
        })
        let childrenIndex = this.list[index].children.findIndex(el => {
          return el.iid == scope.row.iid
        })
        // console.log(this.list);
        console.log(index);
        console.log(childrenIndex);
        this.list[index].children.splice(childrenIndex , 1);
        if(childrenIndex == 0){
          this.list.splice(scope.row,1)
        }
       // 删除子项目
       delChildren(scope,index) {
        console.log(scope,index);
      },
      addwaydata(row){
        console.log(row.row);
       let index = this.list.findIndex(el =>{
          return el.children.find(ele => ele.iid == row.row.iid)
        })
        console.log(index);
      //添加子项目
      addChildren(row){
        console.log(row);
        let obj = {
          iid:Math.random(),
          name:'',
          required:'',
          unit:''
          deviceId: null,
          deviceName: null,
          iid: Math.random(),
          required: null,
          rpId: null,
          name: null,
          unit: null,
          userName: null,
          testValue: null,
          testValueList: [],
          note: null,
          testState: null
        }
        this.list[index].children.push(obj)
        row.children.push(obj)
      },
      save(){
        console.log(this.dataForm);
@@ -662,20 +637,12 @@
        console.log(data);
        console.log(this.list);
        data.rawInsProducts = this.list
        // console.log(data.rawInsProducts);
        // data.rawInsProducts.forEach(item=>{
        //   console.log(item);
        //   let val = item.testValueList.join(",")
        //   item.testValue = val
        //   console.log(item.testValue);
        // })
        // console.log(data);
        console.log('=====>');
        addRawInspects(data).then(res=>{
            // this.$message.success("保存成功")
            this.$message.success("保存成功")
            this.$router.go(-1)
        }).catch(error=>{
          // this.$message.error(error||'error')
          this.$message.error(error)
        })
      },
      getDeviceList(){