| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 | <template>    <div>      <basicDetails          ref="details"          :titleText="`${mainData.billno}`"          :editData="mainData"          :mainAreaData="mainAreaData"          turnPageId="20221122132804"          idname="sa_logisticsid"          ownertable="sa_logistics"          delApiId="20221122132904"          tags=""          :tabs="['基础信息','物流单明细','装箱信息','物流信息']"          @pageChange="pageChange"          @onEditSuccess="queryMainData($route.query.id)">        <div slot="tags">        </div>        <div slot="customOperation" >          <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update')" :data="mainData" @onSuccess="queryMainData(),$refs.dispatch.listData()"/>          <el-button type="primary" size="mini"  v-if="tool.checkAuth($route.name,'confirmRec') && mainData.status =='审核'" :disabled="mainData.status == '收货'" @click="onConfimRec">确认收货</el-button>          <el-button class="inline-16" type="primary" size="mini"  v-if="tool.checkAuth($route.name,'check')" @click="onCheck">{{mainData.status === '审核'?'反审':'审核'}}</el-button>        </div>        <div slot="slot0" >          <defalutInfo :mainData="mainData" ref="info"></defalutInfo>        </div>        <div slot="slot1" >          <dispatchTable ref="dispatch" @onInit="onInit" @rowClick="rowClick" :needQuery="true"></dispatchTable>          <dismx ref="dismx"></dismx>        </div>        <div  slot="slot2">          <addBox v-if="tool.checkAuth($route.name,'addBoxInfo')" class="mt-10" @onSuccess="onBoxSuccess"></addBox>          <boxlist :data="mainData" v-if="tool.checkAuth($route.name,'boxInfo') && mainData" ref="boxlist"></boxlist>          <el-empty description="暂无查询权限" v-else></el-empty>        </div>        <div  slot="slot3">          <courierRecords></courierRecords>        </div>      </basicDetails>    </div></template>    <script>  import Edit from '../modules/edit'  import defalutInfo from '../modules/defaultInfo.vue'  import dispatchTable from '../modules/dispatchTable.vue'  import dismx from '../modules/productlist.vue'  import addBox from './tabs/logisticsBox/add.vue'  import boxlist from './tabs/logisticsBox/logisticsBox.vue'  import courierRecords from './tabs/courierRecords.vue'  export default {    name: "detail",    data() {      return {        mainData:'',        mainAreaData:{}      }    },    components:{      defalutInfo,      dispatchTable,      dismx,      addBox,      boxlist,      courierRecords,      Edit    },    methods:{      async queryMainData(id) {        const res = await this.$api.requested({          "id": 20221204201804,          "content": {            "sa_logisticsid":this.$route.query.id          }        })        this.mainData = res.data[0]        console.log(this.mainData);                this.changeDataStructure()       /* this.$refs.info.style(this.mainData.status)*/      },      changeDataStructure() {        let that = this        this.mainAreaData = [          {            label:'物流编号',            value:this.mainData.billno          },          {            label:'单据日期',            value:this.mainData.billdate          },          {            label:'车牌号',            value:this.mainData.carnum          },          {            label:'物流联系人',            value:this.mainData.logiscontact          },          {            label:'物流电话',            value:this.mainData.logisphone          },          {            label:'运费',            value:this.mainData.freightamount          },          {            label:'收货人',            value:this.mainData.name          },          {            label:'寄件方式',            value:this.mainData.paytype          },                    {            label:'状态',            value:this.mainData.status,            style:function () {              let style = {}              switch (that.mainData.status) {                case '新建':                  style = {color:"#000000"}                  break;                case '审核':                  style = {color:"#d90a0a"}                  break;                case '收货':                  style = {color:"#52C41A"}                  break;                default:                  break;              }              return style            }          },          {            label:'经销商编码',            value:this.mainData.agentnum          },          {            label:'经销商简称',            value:this.mainData.enterprisename          },          {            label:'备注',            value:this.mainData.remarks          },        ]      },      // 监听切换数据,上一页,下一页      pageChange (id,rowindex,tabIndex) {        this.flag = false        tabIndex = this.$route.query.tabIndex        this.$router.replace({path:'/logisticsdetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})        this.queryMainData(id)      },      onSuccess(){        this.visible = false        this.queryMainData(this.$route.query.id)        this.$emit('onSuccess')      },      onCheck () {        this.$confirm(`确定${this.mainData.status === '审核'?'反审核':'审核'}该物流单`, '提示', {          confirmButtonText: '确定',          cancelButtonText: '取消',          type: 'warning'        }).then(async () => {          const res = await this.$api.requested({            "id":20221122133104,            "version":1,            "content": {               "sa_logisticsid":this.$route.query.id            }          })          this.tool.showMessage(res,()=>{            this.queryMainData()          })        }).catch(() => {          this.$message({            type: 'info',            message: '已取消'          });                  });      },      onConfimRec () {        this.$confirm(`确认收货吗`, '提示', {          confirmButtonText: '确定',          cancelButtonText: '取消',          type: 'warning'        }).then(async () => {          const res = await this.$api.requested({            "id": "20221122133204",            "content": {              "sa_logisticsid":this.$route.query.id            }          })          this.tool.showMessage(res,()=>{            this.queryMainData()          })        }).catch(() => {          this.$message({            type: 'info',            message: '已取消'          });                  });      },      rowClick (row) {        this.$refs['dismx'].listData(row.sa_dispatchid)      },      onBoxSuccess () {        this.$refs['boxlist'].listData()      },      onInit (data) {        this.$refs.dismx.listData(data.sa_dispatchid)      }    },    mounted () {      this.queryMainData(this.$route.query.id)         },    created() {    }  }  </script>    <style scoped>    </style>
 |