src/views/business/outsourcingFinishProduct/index.vue
@@ -184,10 +184,47 @@
          type="primary" @click="viewInsInfo1">查看</el-link>
      </div>
    </el-dialog>
    <!--    <Inspection v-if="state>0" :key="InspectionKey" :inspectorList="inspectorList" :orderId="orderId"-->
    <!--                :sonLaboratory="'原材料'" :state="state"-->
    <!--                :typeSource="typeSource"-->
    <!--                @goback="goback" @refreshView="refreshView"/>-->
    <!--    IFS物料属性编辑弹框-->
    <el-dialog
      title="更新IFS库存物料批次属性"
      :visible.sync="ifsMaterialPropsVisible"
      :close-on-click-modal="false"
      width="20%">
      <el-form style="width:100%" :model="ifsMaterialPropsForm">
        <el-form-item label="载具编号(Attr1):">
          <el-input placeholder="载具编号" size="small" v-model="ifsMaterialPropsForm.drumNo"></el-input>
        </el-form-item>
        <el-form-item label="起始米标(Attr2):">
          <el-input @blur="validateQuality()" placeholder="起始米标" size="small" v-model="ifsMaterialPropsForm.startMeterMark">
            <span slot="suffix">km</span>
          </el-input>
        </el-form-item>
        <el-form-item label="截止米标(Attr3):">
          <el-input @blur="validateQuality()" placeholder="截止米标" size="small" v-model="ifsMaterialPropsForm.endMeterMark">
            <span slot="suffix">km</span>
          </el-input>
        </el-form-item>
        <el-form-item label="外护颜色(Attr4):">
          <el-select style="width:100%" size="small" v-model="ifsMaterialPropsForm.outerColor">
            <el-option v-for="(item,index) in outerColorList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="绝缘颜色(Attr5):">
          <el-select style="width:100%" size="small" v-model="ifsMaterialPropsForm.insulationColor">
            <el-option v-for="(item,index) in insulationColorList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="印字信息(Attr8):">
          <el-select style="width:100%" size="small" v-model="ifsMaterialPropsForm.letteringInfo" placeholder="请选择">
            <el-option v-for="(item,index) in letteringInfoList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
    <el-button @click="closePartPropDialog()">取 消</el-button>
    <el-button type="primary" @click="saveOrUpdatePartProp()">确 定</el-button>
  </span>
    </el-dialog>
  </div>
</template>
@@ -198,6 +235,7 @@
import FilesLookVisible from "@/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue";
import DownFileDialog from "@/views/business/materialOrderComponents/materialOrder/downFileDialog.vue";
import limsTable from "@/components/Table/lims-table.vue";
import {getDicts} from "@/api/system/dict/data";
import {
  concessionRelease,
  getIfsByQuarter,
@@ -209,6 +247,7 @@
  updateEntrustCode
} from "@/api/business/rawMaterialOrder";
import { getWarehouseSubmit, getIfsByStateOne, getIfsByOver, getIfsByAll } from "@/api/business/outsourcingFinishProductInspection";
import {getOneByIfsId,saveOrUpdateProps} from "@/api/business/ifsPartProps.js";
import { mapGetters } from "vuex";
export default {
@@ -219,6 +258,22 @@
  data() {
    // 这里存放数据
    return {
      selectedRow:{},
      outerColorList:[],
      insulationColorList:[],
      letteringInfoList: [],
      ifsMaterialPropsForm:{
        id:null,
        ifsInventoryId: null,
        drumNo: '', // 载具编号
        startMeterMark: '', // 起始米标
        endMeterMark: '', // 截止米标
        insulationColor: '', // 绝缘颜色
        outerColor: '', // 外护颜色
        inboundLength: '', // 入库长度
        letteringInfo: '', // 印字信息
      },
      ifsMaterialPropsVisible:false,
      tableData: [],
      tableLoading: false,
      column: [
@@ -772,6 +827,13 @@
              clickFun: (row) => {
                this.handleFileLook(row);
              },
            },
            {
              name: '更新IFS批次属性',
              type: 'text',
              clickFun: (row) => {
                this.showMaterialPropsDialog(row);
              },
            }
          ]
        }
@@ -875,6 +937,90 @@
  },
  // 方法集合
  methods: {
    validateQuality(){
      let inboundLength = Number(this.calcInbondLength(this.ifsMaterialPropsForm.startMeterMark,this.ifsMaterialPropsForm.endMeterMark));
      let testQuantity = Number(this.selectedRow.purQtyInStore);
      if(inboundLength!=null && testQuantity!==inboundLength){
        this.$message.warning(`入库长度(${inboundLength}km)与检验数量(${testQuantity}km)不符,请确认!`);
      }
    },
    calcInbondLength(startMeterMark,endMeterMark){
      let inboundLength = null;
      if((startMeterMark!=null && startMeterMark!=='') && (endMeterMark!=null&&endMeterMark!=='')){
        let minus = this.$Big(endMeterMark).minus(this.$Big(startMeterMark));
        inboundLength = Math.abs(minus)
      }
      return inboundLength;
    },
    saveOrUpdatePartProp(){
      this.ifsMaterialPropsForm.ifsInventoryId = this.selectedRow.id
      saveOrUpdateProps({
        ...this.ifsMaterialPropsForm,
        partNo: this.selectedRow.partNo,
        lotBatchNo: this.selectedRow.updateBatchNo,
        contract: this.selectedRow.contract
      }).then((res)=>{
        if(res.code==200){
          this.$message.success("保存成功");
          this.ifsMaterialPropsVisible = false;
          this.refreshView()
        }
      })
    },
    getPartProps(ifsId){
      getOneByIfsId(ifsId).then((res)=>{
        if(res.code==200 && res.data){
          this.ifsMaterialPropsForm = res.data;
        }
      })
    },
    //打开IFS物料属性弹框
    showMaterialPropsDialog(row){
      this.selectedRow = row
      this.getPartProps(row.id)
      this.getOuterColorDicts()
      this.getInsulationColorDicts()
      this.getLetteringInfoDicts()
      this.$nextTick(()=>{
        this.ifsMaterialPropsVisible = true;
      })
    },
    getLetteringInfoDicts(){
      getDicts("lettering_info_type").then(res=>{
        if(res.code==200){
          this.letteringInfoList = res.data
        }
      })
    },
    getInsulationColorDicts(){
      getDicts("insulation_color_type").then(res=>{
        if(res.code==200){
          this.insulationColorList = res.data
        }
      })
    },
    getOuterColorDicts(){
      getDicts("outer_color_type").then(res=>{
        if(res.code==200){
          this.outerColorList = res.data
        }
      })
    },
    closePartPropDialog(){
      this.ifsMaterialPropsForm = {
        id:null,
        ifsInventoryId: null,
        drumNo: '', // 载具编号
        startMeterMark: '', // 起始米标
        endMeterMark: '', // 截止米标
        insulationColor: '', // 绝缘颜色
        outerColor: '', // 外护颜色
        inboundLength: '', // 入库长度
        letteringInfo: '', // 印字信息
      }
      this.selectedRow = {}
      this.ifsMaterialPropsVisible = false;
    },
    // 点击查询回调
    goSearch() {
      this.page.current = 1