licp
2024-03-18 464c4f614e1d3f80209cf7f99bacdce41fc8cef4
src/components/do/b1-ins-order/add.vue
@@ -70,7 +70,7 @@
   .ins_order_add .el-table__row .cell {
      font-size: 12px;
   }
   .ins_order_add .el-table .warning-row .cell{
      color: #bababa;
   }
@@ -82,13 +82,15 @@
         <el-row class="title">
            <el-col :span="6" style="padding-left: 20px;">委托单信息</el-col>
            <el-col :span="18" style="text-align: right;">
               <el-select v-model="template" size="medium" placeholder="下单模板" style="margin-right: 10px;">
               <el-select v-model="template" size="medium" placeholder="下单模板" style="margin-right: 10px;" v-show="active<2">
                  <el-option v-for="(a, ai) in templates" :key="ai" :value="a.value" :label="a.label"></el-option>
               </el-select>
               <el-button size="medium" @click="">
               <el-button size="medium" @click="" v-show="active<2">
                  <span style="color: #3A7BFA;">保存模板</span>
               </el-button>
               <el-button size="medium" type="primary" @click="save" :loading="saveLoad">提交</el-button>
               <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-show="active<2">提交</el-button>
          <el-button size="medium" @click="upInsOrderOfState(2)" :loading="saveLoad" v-show="active==3">审核不通过</el-button>
          <el-button size="medium" type="primary" @click="upInsOrderOfState(1)" :loading="saveLoad" v-show="active==3">审核通过</el-button>
               <el-button size="medium" @click="$parent.playOrder(0)">
                  <span style="color: #3A7BFA;">返回</span>
               </el-button>
@@ -159,9 +161,9 @@
      </div>
      <div>
         <div style="text-align: right;line-height: 45px;">
            <el-button type="primary" size="small" @click="addSampleDia = true">添加样品</el-button>
            <el-button type="primary" size="small" @click="addSampleDia = true" v-show="active<2">添加样品</el-button>
            <el-button size="small" @click="delSample">
               <span style="color: #3A7BFA;">删除样品</span>
               <span style="color: #3A7BFA;" v-show="active<2">删除样品</span>
            </el-button>
         </div>
         <el-table class="el-table" ref="sampleTable" :data="sampleList" height="250px" tooltip-effect="dark" border
@@ -209,7 +211,7 @@
            <el-table-column label="操作" width="65" align="center">
               <template slot-scope="scope">
                  {{scope.index}}
                  <el-button type="text" size="small" @click="sampleList.splice(scope.$index, 1)">删除</el-button>
                  <el-button type="text" size="small" @click="sampleList.splice(scope.$index, 1)" :disabled="active!=1">删除</el-button>
               </template>
            </el-table-column>
         </el-table>
@@ -347,6 +349,16 @@
      components: {
         ValueTable
      },
    props:{
      active: {
            type: Number,
            default: () => 0
         },
      currentId:{
        type: Number,
            default: () => 0
      }
    },
      data() {
         return {
            template: null,
@@ -421,6 +433,19 @@
         this.selectEnumByCategoryForType()
         this.getUserNow()
         this.selectStandardTreeList()
      if(this.active==1){
        // 下单流程
      }else {
        // 查看/审核流程
        // 请求接口,回显数据
        this.$axios.post(this.$api.insOrder.getInsOrder, {
               orderId: this.currentId
            }).then(res => {
          this.addObj = {...res.data.insOrder};
          this.addObj.type = String(this.addObj.type)
          this.sampleList = res.data.sampleProduct
            })
      }
      },
      methods: {
         selectEnumByCategoryForType() {
@@ -461,6 +486,22 @@
               this.$parent.playOrder(0)
            })
         },
      upInsOrderOfState(state){
        this.saveLoad = true
            this.$axios.post(this.$api.insOrder.upInsOrderOfState,{
               state,
          id:this.currentId
            },{
               headers: {
                  'Content-Type': 'application/json'
               }
            }).then(res=>{
               this.saveLoad = false
               if(res.code==201)return
               this.$message.success('提交成功')
               this.$parent.playOrder(0)
            })
      },
         getUserNow() {
            this.$axios.get(this.$api.user.getUserNow).then(res => {
               let selects = res.data
@@ -621,4 +662,4 @@
         }
      }
   }
</script>
</script>