zouyu
5 天以前 2bd9b32aa6378ff6a841780628b844a42dbd8f01
src/views/business/materialOrder/customsInspectionOrder.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <div>
    <div v-show="!cableConfigShow&&!auxiliaryShow">
      <div class="header">
        <div>
          <span>采购订单信息</span>
@@ -24,6 +24,8 @@
          <el-button v-show="active==1" size="small" @click="templateDia=true">
            <span style="color: #3A7BFA;">保存模板</span>
          </el-button>
          <el-button v-if="active==1&&addObj.sample!=undefined&&(addObj.sample.indexOf('电缆')>-1 ||addObj.sample.indexOf('综合')>-1)" size="small" type="primary" @click="openCableConfig">电缆配置</el-button>
          <el-button v-if="active==1&&addObj.sample!=undefined&&addObj.sample.indexOf('电缆')>-1" size="small" type="primary" @click="openAuxiliaryCore">辅助线芯配置</el-button>
          <el-button v-show="active==1 && addObj.orderType === '进厂检验'" :loading="noNeedCheckLoad" size="small" type="primary" @click="noNeedCheck">免检</el-button>
          <el-button v-show="active==1" :loading="saveLoad" size="small" type="primary" @click="save">提交</el-button>
          <el-button size="small" @click="goBack">
@@ -32,7 +34,7 @@
        </div>
      </div>
    </div>
    <div class="search">
    <div class="search"  v-show="!cableConfigShow&&!auxiliaryShow">
      <el-form ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="90px">
        <el-row>
          <el-col :span="6">
@@ -145,7 +147,7 @@
        </el-row>
      </el-form>
    </div>
    <div>
    <div  v-show="!cableConfigShow&&!auxiliaryShow">
      <div style="display: flex;justify-content: space-between;background-color: #F5F7FB;margin-bottom: 6px">
        <div v-if="active==1">
          <el-form :inline="true" :model="addObj1" label-width="90px">
@@ -169,7 +171,8 @@
          </el-form>
        </div>
        <div style="margin-bottom: 6px;margin-top: 6px">
          <el-button v-show="active==1" :disabled="sampleList.length === 3" size="small" type="primary" @click="handleSplitCountNum">拆分</el-button>
          <el-button v-show="active==1" size="small" type="primary" @click="handleSplitCountNum">拆分</el-button>
          <el-button v-show="active==1" :disabled="sampleList.length<=1" size="small" type="danger" @click="handleDeleteSplitCountNum">删除拆分</el-button>
        </div>
      </div>
@@ -325,7 +328,7 @@
        <el-table-column :filter-method="filterHandler" :filters="filters" label="子实验室" min-width="130" prop="sonLaboratory"
                         show-overflow-tooltip></el-table-column>
      </el-table>
    </div>
    </div >
    <!--特殊值处理框-->
    <el-dialog :before-close="beforeClose" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
               :visible.sync="bsm1DiaAll"
@@ -433,6 +436,10 @@
        <el-button :loading="noNeedCheckLoad" type="primary" @click="handleNoNeedCheck">确 定</el-button>
      </span>
    </el-dialog>
    <!--电缆配置-->
    <cableConfig v-if="cableConfigShow" ref="cableConfigShow" :active="active" :isSpecial="isSpecial" :sampleSelectionList="sampleSelectionList" @goBackAdd="goBackAdd"/>
    <!--辅助线芯配置-->
    <auxiliary-wire-core v-if="auxiliaryShow" :active="active" :isSpecial="isSpecial" :sampleSelectionList="sampleSelectionList" @goBackAdd2="goBackAdd2"></auxiliary-wire-core>
  </div>
</template>
@@ -444,22 +451,30 @@
  delRawMaterOrderTemplate,
  getInsOrder,
  getUserNow,
  notificationRawOrder, selectRawMaterOrderTemplate,
  notificationRawOrder,
  selectRawMaterOrderTemplate,
  selectRawMaterOrderTemplateById,
  selectsStandardMethodByFLSSM,
  selectStandardMethodEnum,
  selectStandardProductList,
  selectStandardTreeListByPartNo
} from "@/api/business/rawMaterialOrder";
import {dateFormat} from "@/utils/date";
import AuxiliaryWireCore from "../productOrder/components/auxiliaryWireCore.vue";
import cableConfig from "../productOrder/components/cable-config.vue";
export default {
  name: "CustomsInspectionOrder",
  dicts: ['check_type', 'urgency_level'],
  components: {},
  components: {cableConfig, AuxiliaryWireCore},
  props: {
  },
  data() {
    return {
      cableConfigShow: false,
      auxiliaryShow: false,
      isSpecial: false,
      sampleSelectionList: [],//样品表格选中数据
      isOutsourcing: 'f',//是否外购成品
      customsInspection: {},
      orderType: '',
      active: 0,
@@ -614,6 +629,17 @@
    //   this.addObj.method = null
    //   this.productList = []
    // },
    isOutsourcing:{
      deep:  true,
      handler(newVal){
        if(newVal && newVal==='t'){
          this.addObj.appointed = dateFormat(new Date(),'yyyy-MM-dd')
          this.addObj.testQuantity = this.customsInspection.qtyArrived
          this.addObj.orderType = '进厂检验'
          this.addObj.typeSource = 0
        }
      }
    },
    productList: {
      deep: true,
      handler(val) {
@@ -643,6 +669,7 @@
  created() {
    this.active = this.$route.query.active
    this.orderType = this.$route.query.orderType
    this.isOutsourcing = this.$route.query.isOutsourcing
    this.currentId = this.$route.query.currentId
    this.isReport = this.$route.query.isReport
    this.customsInspection = this.$route.query.customsInspection
@@ -651,6 +678,7 @@
  activated() {
    this.active = this.$route.query.active
    this.orderType = this.$route.query.orderType
    this.isOutsourcing = this.$route.query.isOutsourcing
    this.currentId = this.$route.query.currentId
    this.isReport = this.$route.query.isReport
    this.customsInspection = this.$route.query.customsInspection
@@ -660,6 +688,82 @@
  //   this.getInfo() // 获取数据
  // },
  methods: {
    goBackAdd () {
      this.cableConfigShow = false
    },
    goBackAdd2 () {
      this.auxiliaryShow = false
    },
    // 编辑要求值表格
    editSpecial () {
      this.isSpecial = true
      this.$nextTick(() => {
        this.$refs.productTable.doLayout();
      });
    },
    areObjectsValuesEqual (objects, property) {
      if (!objects || objects.length === 0) return false;
      const firstValue = objects[0][property];
      return objects.every(obj => obj[property] === firstValue);
    },
    // 辅助线芯配置
    openAuxiliaryCore () {
      if (this.active == 1) {
        if (this.sampleIds.length === 0) {
          this.$message.error("未选择样品")
        } else if (this.sampleIds.length === 1) {
          if (!this.sampleSelectionList[0].standardMethodListId) {
            this.$message.error("样品未选择检验标准")
            return
          }
          this.auxiliaryShow = true
        } else {
          // 同时配置多个样品的电缆配置时必须选择相同的检验标准
          if (!this.sampleSelectionList.every(value => value.standardMethodListId)) {
            this.$message.error("样品未选择检验标准")
          } else {
            if (!this.areObjectsValuesEqual(this.sampleSelectionList, 'standardMethodListId')) {
              this.$message.error("请选择相同的检验标准")
              return
            }
            this.auxiliaryShow = true
          }
        }
      } else {
        if (this.sampleId === null) {
          this.$message.error('未选中样品')
        }
      }
    },
    //打开电缆配置弹框
    openCableConfig() {
      if (this.active == 1) {
        if (this.sampleIds.length === 0) {
          this.$message.error("未选择样品")
        } else if (this.sampleIds.length === 1) {
          if (!this.sampleSelectionList[0].standardMethodListId) {
            this.$message.error("样品未选择检验标准")
            return
          }
          this.cableConfigShow = true
        } else {
          // 同时配置多个样品的电缆配置时必须选择相同的检验标准
          if (!this.sampleSelectionList.every(value => value.standardMethodListId)) {
            this.$message.error("样品未选择检验标准")
          } else {
            if (!this.areObjectsValuesEqual(this.sampleSelectionList, 'standardMethodListId')) {
              this.$message.error("请选择相同的检验标准")
              return
            }
            this.cableConfigShow = true
          }
        }
      } else {
        if (this.sampleId === null) {
          this.$message.error('未选中样品')
        }
      }
    },
    save1 () {
      if (this.bsm1DiaList.length > 0) {
        this.bsm1DiaList.forEach(item => {
@@ -747,7 +851,7 @@
            })
          }
        })
      } else {
      } else{
        notificationRawOrder({ifsInventoryId:this.customsInspection.id}).then(res => {
          if (res.code === 200) {
            if (res.data === 1) {
@@ -771,7 +875,9 @@
            this.$set(this.addObj, 'receiverDate', this.customsInspection.receiverDate)
            this.$set(this.addObj, 'orderNo', this.customsInspection.orderNo)
            this.$set(this.addObj, 'declareUser', this.customsInspection.declareUser)
            this.$set(this.addObj, 'testQuantity', this.customsInspection.testQuantity)
            if(this.isOutsourcing==='f'){
              this.$set(this.addObj, 'testQuantity', this.customsInspection.testQuantity)
            }
            this.$set(this.addObj, 'buyUnitMeas', this.customsInspection.buyUnitMeas)
            this.$set(this.addObj, 'updateBatchNo', this.customsInspection.updateBatchNo)
            this.$set(this.addObj, 'partDetail', this.customsInspection.partDesc)
@@ -848,6 +954,12 @@
      selectRawMaterOrderTemplate({partNo:this.addObj.partNo}).then(res => {
        this.templates = res.data
      })
    },
    //删除拆分行
    handleDeleteSplitCountNum(){
      this.count--;
      this.sampleList.pop()
      this.computationalPairing(this.sampleList.length)
    },
    // 拆分
    handleSplitCountNum () {
@@ -1442,6 +1554,9 @@
      })
    },
    getProNum() {
      this.sampleSelectionList.forEach((m, i) => {
        this.$set(this.sampleSelectionList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length)
      })
      this.$refs.sampleTable.doLayout()
    },
    methodFocus() {
@@ -1511,6 +1626,7 @@
      val.forEach(a => {
        this.sampleIds.push(a.id)
      })
      this.sampleSelectionList = val
    },
    // 选中表格行的回调
    rowClick(row, column, event) {
@@ -1524,7 +1640,11 @@
      this.sampleId = row.id
      if (this.active !== 1) {
        this.sampleIds = []
        this.sampleIds.push(row.id)
        this.sampleSelectionList.forEach(ele=>{
          if(ele.id == row.id){
            this.sampleIds.push(row.id)
          }
        })
      }
      // this.productList = row.insProduct
      if (this.productList !== null) {