123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <template>
- <div>
- <basicDetails
- ref="details"
- :titleText="`${mainData.billno}`"
- :editData="mainData"
- :mainAreaData="mainAreaData"
- delApiId="20221114135503"
- turnPageId="20221114135403"
- idname="sa_dispatchid"
- ownertable="sa_dispatch"
- 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') && mainData.STATUS == '新建'" :data="mainData" @onSuccess="onSuccess" />
- <el-button type="primary" size="mini" v-if="tool.checkAuth($route.name,'check')" :disabled="mainData.STATUS !== '复核'" @click="addLogistics">生成物流单</el-button>
- <el-button type="primary" size="mini" v-if="tool.checkAuth($route.name,'check')" :disabled="mainData.STATUS !== '新建' && mainData.STATUS !== '审核'" @click="onCheck">{{mainData.STATUS === '审核'?'反审':mainData.STATUS === '复核'?'反审':'审核'}}</el-button>
- <el-button class="inline-16" type="primary" size="mini" v-if="tool.checkAuth($route.name,'recheck')" :disabled="mainData.STATUS !== '审核' && mainData.STATUS !== '复核'" @click="onReCheck">{{mainData.STATUS === '复核'?'反复核':'复核'}}</el-button>
- </div>
- <div slot="slot0" >
- <default-info :mainData="mainData"></default-info>
- </div>
- <div slot="slot1" >
- <product-list ref="product" :mainData="mainData"></product-list>
- </div>
- </basicDetails>
- </div>
- </template>
- <script>
- import Edit from '../modules/edit'
- import productList from '../modules/productlist.vue'
- import defaultInfo from '../modules/defaultInfo.vue'
- import { log } from '@antv/g2plot/lib/utils'
- export default {
- name: "detail",
- data() {
- return {
- mainData:{},
- mainAreaData:{}
- }
- },
- components:{
- Edit,
- productList,
- defaultInfo
- },
- methods:{
- async queryMainData(id) {
- const res = await this.$api.requested({
- "id": "20221114135303",
- "version":1,
- "content": {
- "sa_dispatchid":this.$route.query.id
- }
- })
- this.mainData = res.data
- console.log(this.mainData)
- this.changeDataStructure()
- },
- changeDataStructure() {
- let that = this
- this.mainAreaData = [
- {
- label:'发货单号',
- value:this.mainData.billno
- },
- {
- label:'订单号',
- value:this.mainData.sonum
- },
- {
- label:'发货日期',
- value:this.mainData.billdate
- },
- {
- label:'经销商编号',
- value:this.mainData.agentnum
- },
- {
- label:'经销商名称',
- value:this.mainData.enterprisename
- },
- {
- 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;
- case '复核':
- style = {color:"#3874f6"}
- break;
- case '关闭':
- style = {color:"#b2c0ea"}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label:'运费状态',
- value:this.mainData.freightstatus
- },
- {
- label:'备注',
- value:this.mainData.remarks
- },
- ]
- },
- // 监听切换数据,上一页,下一页
- pageChange (id,rowindex,tabIndex) {
- this.flag = false
- tabIndex = this.$route.query.tabIndex
- this.$router.replace({path:'/dispatchdetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
- this.queryMainData(id)
- },
- onSuccess(){
- this.visible = false
- this.queryMainData(this.$route.query.id)
- this.$refs.product && this.$refs.product.listData()
- console.log('触发');
-
- this.$emit('onSuccess')
- },
- onCheck () {
- this.$confirm(`确定${this.mainData.STATUS === '审核'?'反审核':'审核'}该发货单`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- const res = await this.$api.requested({
- "id": this.mainData.STATUS === '审核'?20221114135703:20221114135603,
- "version":1,
- "content": {
- "sa_dispatchid":this.$route.query.id
- }
- })
- this.tool.showMessage(res,()=>{
- this.queryMainData()
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- onReCheck() {
- this.$confirm(`确定${this.mainData.STATUS === '复核'?'反复核':'复核'}该发货单`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- const res = await this.$api.requested({
- "id":20221114135803,
- "version":1,
- "content": {
- "sa_dispatchid":this.$route.query.id,
- "isrecheck":this.mainData.STATUS === '复核'?false:true
- }
- })
- this.tool.showMessage(res,()=>{
- this.queryMainData()
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- async addLogistics () {
- const res = await this.$api.requested({
- "id": "20230216185104",
- "content": {
- "sa_dispatchid":this.mainData.sa_dispatchid
- }
- })
-
- this.tool.showMessage(res,()=>{
- let route = this.$route
- this.oldRoute = {path:route.path,query:route.query}
- this.$store.dispatch('setHistoryRouter',this.oldRoute)
- this.$router.replace({path:'/logisticsdetail',query:{id:res.data[0].sa_logisticsid,rowindex:res.data[0].rowindex}})
- })
- }
- },
- mounted () {
- this.queryMainData(this.$route.query.id)
- },
- created() {
- }
- }
- </script>
-
- <style scoped>
-
- </style>
|