王震
2023-12-04 8afbe0b83915dc417cea62221782e7ce15c00c78
src/views/quality/Packaging_ledger/index.vue
@@ -9,7 +9,7 @@
            :prelang="prelang"
            :ajaxFun="ajaxFun"
            :options="options" 
            @handleSelectionChange="handleCurrentChange"
            @currentChange="handleCurrentChange"
            ref="processconfiguration"
            >
        <template #toolbar></template>
@@ -41,6 +41,7 @@
                    </el-col>
                    <el-col :span="2">
                    <el-button
                        v-if="!isCheck"
                        style="float: right; padding: 3px 0"
                        type="text"
                        @click="relateOperationParam()"
@@ -53,7 +54,7 @@
              :data="testStandardParams"
              id="testStandardParamTable"
              ref="testStandardParam"
              :default-sort="{ prop: 'index' }"
              highlight-current-row
              height="700"
              style="width: 100%"
@@ -62,7 +63,7 @@
              stripe
            >
              <el-table-column
                prop="index"
                type ="index"
                label="序号"
                align="center"
                width="50"
@@ -92,12 +93,12 @@
              </el-table-column>
              <el-table-column
                label="数量"
                prop="parameterFormat"
                prop="number"
                align="center"
                width="80"
              >
                <template slot-scope="scope">
                  <el-input v-model="scope.row.parameterFormat"></el-input>
                  <el-input v-model="scope.row.number"></el-input>
                </template>
              </el-table-column>
              <el-table-column label="单位" prop="unit" align="center" />
@@ -118,7 +119,7 @@
        <!-- 新增 -->
        <packfrom
        :currshowlist.sync="addOrUpdateVisible"
        >
        @refreshDataList="getData">
        </packfrom>
        <packfromadd
        :currshowlist.sync="increase"
@@ -138,6 +139,8 @@
export default {
    data(){
        return {
          isCheck: false,
          dataway:{},
          goid:'',
          testStandardParams: [],
          packageBoxId:{},
@@ -237,17 +240,17 @@
                ],
                operator: [
                    {
                      text: '检验',
                      icon: 'el-icon-position',
                      type: 'text',
                      size: 'small',
                      fun: this.check
                    },{
                      text: '删除',
                      icon: 'el-icon-delete',
                      type: 'text',
                      size: 'small',
                      fun: this.deleteHandle
                    },{
                      text: '检验',
                      icon: 'el-icon-delete',
                      type: 'text',
                      size: 'small',
                      fun: this.check
                    }
                  ],
                  operatorConfig: {
@@ -265,18 +268,15 @@
        packfromadd
        },
        watch: {
          // renovate() {
          //   if (this.innerVisible = false) {
          //     this.$nextTick(() => {
          //       this.getData()
          //     })
          //   }
          // }
      },
    methods: {
       // 获取数据列表
      getData() {
        this.$refs.processconfiguration.refreshData()
      },
      wayRenovate(){
        this.getData()
      },
      //add
      addOrUpdateHandle(){
@@ -286,54 +286,56 @@
      deleteHandle(row){
        dropById({id:row.id}).then((res) =>{
          this.getData()
          this.$message.error('删除成功')
          this.$message.success('删除成功')
        })
      },
      handleCurrentChange(row){
        console.log(row,"id");
        this.packageBoxId = {
          packageBoxId:row[0].id
        if(row.state=='已报检'){
          this.isCheck = true
        }
        this.goid = row[0].id
        list({packageBoxId:row[0].id}).then((res) =>{
          console.log(res,"nihaoa");
        this.dataway = row
        this.packageBoxId = {
          packageBoxId:row.id
        }
        this.goid = row.id
        this.rightquery()
      },
      rightquery(){
        list({packageBoxId:this.goid}).then((res) =>{
          this.testStandardParams = res.data.data
        })
      },
      //详情添加
      relateOperationParam(){
        this.increase = true
        if (this.dataway.state == "未报检") {
            this.increase = true
        }else{
          this.$message.error('请先选择包装项目')
        }
      },
      preserve(datalist){
        console.log(datalist);
        this.testStandardParams = datalist
      },
      //右边保存
      addpreserve(){
        console.log(this.testStandardParams,"保存数据");
         this.testStandardParams.forEach(el => {
              el.packageBoxId =this.goid
         });
        console.log(this.testStandardParams,"niaho");
        saveList(this.testStandardParams).then((res) =>{
          this.$message.success('保存成功')
          this.testStandardParams
          this.rightquery()
        })
      },
      //删除
      deleteadd(row){
          console.log(row,"");
          deledata({id:row.id}).then((res)=>{
          this.$message.success('删除成功')
          this.testStandardParams
          this.rightquery()
          })
      },
      //审核
      check(row){
        console.log(row,"审核");
        let packageBox = {
                id:row.id,
                packageNo:row.packageNo,