licp
2024-03-21 7b5c250e4266e9e7e27a369c864e88316c8ac229
下单功能修改
已修改2个文件
116 ■■■■ 文件已修改
src/components/do/b1-ins-order/add.vue 113 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/add.vue
@@ -211,7 +211,7 @@
                border @selection-change="selectSample" highlight-current-row @row-click="rowClick" style="margin-top: 10px;">
                <el-table-column type="selection" width="60"></el-table-column>
                <el-table-column type="index" label="序号" width="65" align="center"></el-table-column>
                <el-table-column prop="sample" label="样品名称" align="center" show-overflow-tooltip min-width="100">
                <el-table-column prop="sample" label="样品名称" align="center" min-width="100">
                    <template slot-scope="scope">
                        <el-input size="small" v-model="scope.row.sample" clearable></el-input>
                    </template>
@@ -221,22 +221,22 @@
                        <el-input size="small" v-model="scope.row.sampleCode" clearable placeholder="不填写则系统自动生成"></el-input>
                    </template>
                </el-table-column>
                <!-- <el-table-column prop="factory" label="工厂" align="center" show-overflow-tooltip min-width="100">
                <!-- <el-table-column prop="factory" label="工厂" align="center" min-width="100">
                </el-table-column>
                <el-table-column prop="laboratory" label="实验室" align="center" show-overflow-tooltip min-width="100">
                <el-table-column prop="laboratory" label="实验室" align="center" min-width="100">
                </el-table-column>
                <el-table-column prop="sampleType" label="样品类型" align="center" show-overflow-tooltip min-width="100">
                <el-table-column prop="sampleType" label="样品类型" align="center" min-width="100">
                </el-table-column> -->
                <el-table-column prop="model" label="样品型号" align="center" show-overflow-tooltip min-width="100">
                <el-table-column prop="model" label="样品型号" align="center" min-width="100">
                    <template slot-scope="scope">
                        <el-select v-model="scope.row.model" filterable allow-create default-first-option placeholder="样品型号"
                            size="small">
                            size="small" @change="handleChangeModel">
                            <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
                    </template>
                </el-table-column>
                <el-table-column prop="standardMethodListId" label="检验标准" align="center" show-overflow-tooltip min-width="100">
                <el-table-column prop="standardMethodListId" label="检验标准" align="center" min-width="100">
                    <template slot-scope="scope">
                        <el-select v-model="scope.row.method" :disabled="scope.row.model==null" filterable placeholder="检验标准" size="small"
                            :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)" @focus="methodFocus">
@@ -245,14 +245,14 @@
                        </el-select>
                    </template>
                </el-table-column>
                <el-table-column prop="unit" label="单位" align="center" show-overflow-tooltip min-width="100">
                <el-table-column prop="unit" label="单位" align="center" min-width="100">
                    <template slot-scope="scope">
                        <el-select v-model="scope.row.unit" clearable size="small" style="width: 100%;">
                            <el-option v-for="(a, i) in units" :key="i" :label="a.label" :value="a.value"></el-option>
                        </el-select>
                    </template>
                </el-table-column>
                <el-table-column prop="isLeave" label="是否留样" align="center" show-overflow-tooltip min-width="100">
                <el-table-column prop="isLeave" label="是否留样" align="center" min-width="100">
                    <template slot-scope="scope">
                        <el-select v-model="scope.row.isLeave" size="small">
                            <el-option label="留样" :value="1"></el-option>
@@ -303,7 +303,7 @@
                <el-table-column prop="ask" label="要求值" min-width="220px">
                    <template slot-scope="scope">
                        <el-input size="small" placeholder="要求值" v-model="scope.row.ask" clearable type="textarea"
                            :autosize="{ minRows: 1, maxRows: 3}"></el-input>
                            :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)"></el-input>
                    </template>
                </el-table-column>
            </el-table>
@@ -639,6 +639,16 @@
                    this.$message.error('请添加一个样品')
                } else if (!this.sampleList.every(m => m.sampleCode)) {
                    this.$message.error('输入样品编号')
                }else if (!this.sampleList.every(m => m.sample)) {
                    this.$message.error('输入样品名称')
                }else if (!this.sampleList.every(m => m.model)) {
                    this.$message.error('输入样品型号')
                }else if (!this.sampleList.every(m => m.standardMethodListId)) {
                    this.$message.error('选择检验标准')
                }else if (!this.sampleList.every(m => m.unit)) {
                    this.$message.error('输入单位')
                }else if (!this.sampleList.every(m => m.isLeave)) {
                    this.$message.error('是否留样')
                } else {
                    this.saveLoad = true
                    this.$axios.post(this.$api.insOrder.addInsOrder, {
@@ -652,20 +662,7 @@
                        this.saveLoad = false
                        if (res.code == 201) return
                        this.$message.success('已提交')
                        // 如果紧急程度为紧急,需要直接下发人员
                        if (this.addObj.type == 2) {
                            this.issuedDialogVisible = true;
                            this.$axios.post(this.$api.insOrder.selectOrderManDay, {
                                id: res.data
                            }).then(ress => {
                                // TODO 需要再确认一下返回值
                                this.distributeData.orderId = res.data
                                // this.distributeData.sampleId = res.data.sampleId
                                this.distributeData.appointed = ress.data
                            })
                        } else {
                            this.$parent.playOrder(0)
                        }
            this.$parent.playOrder(0)
                    })
                }
            },
@@ -682,7 +679,18 @@
                    this.saveLoad = false
                    if (res.code == 201) return
                    this.$message.success('提交成功')
                    this.$parent.playOrder(0)
                    // 如果紧急程度为紧急,需要直接下发人员
          if (this.addObj.type == 2) {
                            this.issuedDialogVisible = true;
                            this.$axios.post(this.$api.insOrder.selectOrderManDay, {
                                id: this.currentId
                            }).then(ress => {
                                this.distributeData.orderId = this.currentId
                                this.distributeData.appointed = ress.data
                            })
                        } else {
                            this.$parent.playOrder(0)
                        }
                })
            },
            // 下发
@@ -698,7 +706,6 @@
                this.upLoad = true;
                this.$axios.post(this.$api.insOrder.upInsOrder, {
                    orderId: this.distributeData.orderId,
                    sampleId: this.distributeData.sampleId,
                    appointed: this.distributeData.appointed,
                    userId: this.distributeData.userId
                }).then(res => {
@@ -793,7 +800,7 @@
                    this.count++
                }
                this.$refs.sampleTable.doLayout()
                this.selectsStandardMethodByFLSSM()
                // this.selectsStandardMethodByFLSSM()
            },
            selectsStandardMethodByFLSSM() {
                this.methodLoad = true
@@ -801,7 +808,18 @@
                    tree: this.selectTree
                }).then(res => {
                    this.methodLoad = false
                    this.methods = res.data.standardMethodList
          if(res.data.standardMethodList.length==0&&this.selectTree.split('-').length==5){
            let arr = this.selectTree.split('-')
            let arr0 = arr.slice(0,arr.length-1)
            let selectTree = arr0.join('-').substring(0, arr0.join('-').length - 1)
            this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
              tree: selectTree
            }).then(ress => {
              this.methods = ress.data.standardMethodList
            })
          }else{
            this.methods = res.data.standardMethodList
          }
                })
            },
            addStandardTree() {
@@ -906,6 +924,17 @@
            },
            upProductSelect(selection, row) {
                row.state = row.state == 1 ? 0 : 1
        this.sampleList.map(item=>{
          if(this.sampleIds.indexOf(item.id)>-1){
            item.insProduct.map(m=>{
              if(m.id==row.id){
                m.state = row.state;
              }
              return m;
            })
          }
          return item
        })
            },
            tableRowClassName({
                row,
@@ -1009,7 +1038,31 @@
            },
            methodFocus(){
                this.selectsStandardMethodByFLSSM()
            }
            },
      handleChangeModel(e){
        let num = this.selectTree.split('-').length;
        if(num==4){
          this.selectTree = this.selectTree + ' - '+ e
        }else{
          let arr = this.selectTree.split('-')
          let arr0 = arr.slice(0,arr.length-1)
          this.selectTree = arr0.join('-')+ '- '+ e
        }
      },
      // 要求值变化时
      requestChange(e,row){
        this.sampleList.map(item=>{
          if(this.sampleIds.indexOf(item.id)>-1){
            item.insProduct.map(m=>{
              if(m.id==row.id){
                m.ask = e;
              }
              return m;
            })
          }
          return item
        })
      }
        }
    }
</script>
</script>
src/main.js
@@ -13,7 +13,8 @@
//本地
Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
const javaApi = 'http://192.168.0.24:8001';
const javaApi = 'http://192.168.0.24:8001';//李
// const javaApi = 'http://114.132.189.42:9006';//李
//胜云服务器
// Vue.prototype.LOCATIONVUE = "http://syxt.shxiao2.cn";
// const javaApi = 'http://122.114.52.69:8001';