Commit fb5c8077 authored by 张锡奇's avatar 张锡奇
parents efb65cdd fceb70fb
...@@ -13,8 +13,8 @@ function urlFun(name){ ...@@ -13,8 +13,8 @@ function urlFun(name){
* 默认公司 * 默认公司
*/ */
// default:`http://192.168.4.34:5001`, // default:`http://192.168.4.34:5001`,
// default:`https://weixin.huansi.net/apiproxy/huansi/hszh_HSFabricTradeTest`, default:`https://weixin.huansi.net/apiproxy/huansi/hszh_HSFabricTradeTest`,
default:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/${userID}`, // default:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/${userID}`,
/** /**
* 基本地址 * 基本地址
......
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
columns1:[], columns1:[],
showTab:true, showTab:true,
page:1, page:1,
per_page:50 per_page:50,
} }
}, },
computed:{ computed:{
...@@ -120,11 +120,12 @@ export default { ...@@ -120,11 +120,12 @@ export default {
}, },
async mounted(){ async mounted(){
window.d = this; window.d = this;
this.$nextTick(()=>{ // if(this.$route.query.userId){
// store.dispatch('saveUserId',this.$route.query.userId);
}) // }
}, },
async activated(){ async activated(){
console.log("--------activate---------")
this.page = 1; this.page = 1;
this.per_page = 50; this.per_page = 50;
this.showTab = true; this.showTab = true;
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<div id="tiipOperateDetail"> <div id="tiipOperateDetail">
<customTime ref="time"/> <customTime ref="time"/>
<div class="Table"> <div class="Table">
<customerTable :columns="columns" :list="list" :tableStyle="tableStyle"></customerTable> <customerTable :showFooter="isFooter" :columns="columns" :list="list" :tableStyle="tableStyle" />
</div> </div>
</div> </div>
</template> </template>
...@@ -169,7 +169,7 @@ export default { ...@@ -169,7 +169,7 @@ export default {
singleTrBgColor:'#eef4fe', singleTrBgColor:'#eef4fe',
theadTdBorder:false, theadTdBorder:false,
tbodyTdBorder:false, tbodyTdBorder:false,
tbodyHeight:'calc(100%)', tbodyHeight:'100%',
tbodyTrBorderBottom:'1px solid #dbe9f8', tbodyTrBorderBottom:'1px solid #dbe9f8',
width:'100%' width:'100%'
}, },
...@@ -196,46 +196,172 @@ export default { ...@@ -196,46 +196,172 @@ export default {
field:'nAmountHTML', field:'nAmountHTML',
} }
], ],
hdr:{
begin_date:"2020-01-01",
end_date:"2020-01-31 23:59",
nAmount:792157.6,
nPieces:365,
nQty:427239.37,
sType:"销售",
},
DateValue:[new Date], DateValue:[new Date],
isFooter:false,
mode:0,//进入方式0 默认 往来单位->产品列表,1 往来单位->销售,2 往来单位->退货
upbCustomerGUID:"",//客户id
page:1,
per_page:50
} }
}, },
async mounted(){ async mounted(){
window.s=this
this.mode=this.$route.query.mode||0
this.upbCustomerGUID=this.$route.query.upbCustomerGUID||""
if(this.mode==1){
this.columns=[
{
width:"25%",
name:"单号",
align:"center",
field:"sOrderNoHTML",
underline:true,
color:"#2d8cf0"
},{
width:"25%",
name:"数量",
align:"center",
field:"nQty"
},{
width:"25%",
name:"金额",
align:"center",
field:"nAmountHTML"
},{
width:"25%",
name:"状态",
align:"center",
field:"sStatus"
}
]
this.tableStyle.tbodyHeight="calc(100vh - 125px)"
this.isFooter=true
this.$store.dispatch("CAHNGE_META_INFO", {title:"销售列表"});
}else if(this.mode==2){
this.columns=[
{
width:"25%",
name:"单号",
align:"center",
field:"sStoreInNoHTML",
underline:true,
color:"#2d8cf0"
},{
width:"25%",
name:"匹数",
align:"center",
field:"nPieceHTML"
},{
width:"25%",
name:"数量",
align:"center",
field:"nQtyHTML"
},{
width:"25%",
name:"金额",
align:"center",
field:"nAmountHTML"
}
]
this.tableStyle.tbodyHeight="calc(100vh - 125px)"
this.isFooter=true
this.$store.dispatch("CAHNGE_META_INFO", {title:"退货列表"});
}
this.$nextTick(async ()=>{ this.$nextTick(async ()=>{
this.$refs.time.$on("time",date=>{ this.$refs.time.$on("time",date=>{
this.DateValue=date this.DateValue=date
this.clean()
this.getData() this.getData()
}) })
this.$refs.time.dateMode=3 this.$refs.time.dateMode=3
this.global.$off("scrollTable");
this.global.$on("scrollTable",()=>{
this.getData(true)
})
this.global.$off("clickTd")
this.global.$on("clickTd",async res=>{
if(this.mode==1){
this.getDetail(1,"销售",this.list[res.trIndex].sOrderNo)
}else if(this.mode==2){
this.getDetail(2,"销售退货",this.list[res.trIndex].sStoreInNo)
}
})
}) })
}, },
methods:{ methods:{
async getData(){ async getData(reData){
let postData = [ if(this.mode==0){
{key:"url",value: 'Operation gai sType-material'}, var postData = [
{key:"sType",value:"销售"}, {key:"url",value: 'Operation gai sType-material'},
{key:"begin_date",value:this.DateValue[0]}, {key:"sType",value:"销售"},
{key:"end_date",value:this.DateValue[1]||this.DateValue[0]} {key:"begin_date",value:Util.dateFormat(this.DateValue[0],"yyyy-MM-dd")},
] {key:"end_date",value:Util.dateFormat(this.DateValue[1]||this.DateValue[0],"yyyy-MM-dd 23:59")}
]
}else if(/^1$|^2$/.test(this.mode)){
if(this.per_page<50)return;
var postData=[
{key:"url",value:this.mode==1?"Operation gai sType-customer-sOrder":"Abnormal early warning-customer-sOrder"},
{key:"sType",value:this.mode==1?"销售":"销售退货"},
{key:"begin_date",value:Util.dateFormat(this.DateValue[0],"yyyy-MM-dd")},
{key:"end_date",value:Util.dateFormat(this.DateValue[1]||this.DateValue[0],"yyyy-MM-dd 23:59")},
{key:"upbCustomerGUID",value:this.upbCustomerGUID}
]
var params={
page:this.page,
per_page:this.per_page
}
this.per_page=0
}
let res = await this.request('getBoss',{ let res = await this.request('getBoss',{
data:postData, data:postData,
params:{}, params:params||{},
},'加载中',{}) },'加载中',{})
if(this.mode==0){
this.list = res.map(x=>{
x.sMaterial = `<div>${x.sSampleMaterialNo&&`<span style="color:#FF6633">${x.sSampleMaterialNo}</span><br>`}<span style="color:black;">${ x.sSampleMaterialName||''}</span></div>`
x.nAmountHTML = `<div><span style="color:#339966;">${(x.nAmount||0).toLocaleString()}</span></div>`;
x.nQtyHTML = `<div><span">${(x.nQty || x.nOutQty || x.nInQty||0).toLocaleString()}</span></div>`;
return x;
})
}else if(/^1$|^2$/.test(this.mode)){
this.per_page=res.length
this.page++
this.list = res.map(x=>{ res.forEach((v,i)=>{
x.sMaterial = `<div>${x.sSampleMaterialNo&&`<span style="color:#FF6633">${x.sSampleMaterialNo}</span><br>`}<span style="color:black;">${ x.sSampleMaterialName||''}</span></div>` v.sOrderNoHTML=`<div><span style='text-decoration:${i<res.length-1?'underline':'none'};'>${v.sOrderNo||0}</span></div>`
x.nAmountHTML = `<div><span style="color:#339966;">${(x.nAmount||0).toLocaleString()}</span></div>`; v.nAmountHTML=`<div><span style="color:#339966;">${v.nAmount||0}</span></div>`
x.nQtyHTML = `<div><span">${(x.nQty || x.nOutQty || x.nInQty||0).toLocaleString()}</span></div>`; if(this.mode==2){
return x; v.nQtyHTML=`<div><span>${v.nSumInQty}</span></div>`
}) v.nPieceHTML=`<div><span>${v.nInPieceQty}</span></div>`
v.sStoreInNoHTML=`<div><span style="text-decoration:${i<res.length-1?"underline":"none"}">${v.sStoreInNo}</span></div>`
}
})
if(typeof reData=='boolean'&&reData){
this.list=res
}else{
this.list=this.list.concat(res)
}
}
},
clean(){
this.page=1
this.per_page=50
this.list=[]
},
async getDetail(M,sType,orderNo){
var postData=[
{key:"url",value:M==1?"Operation gai sType-customer-sOrder-dtl":"Abnormal early warning-customer-sOrder-dtl"},
{key:"sType",value:sType},
{key:"sOrderNo",value:orderNo},
]
var value=await this.request("getBoss",{data:postData},"加载中",{})
this.$store.dispatch("saveKanbanOrderDetail",value)
this.$router.push({name:"orderDetailsIndex"})
}, },
}, },
components:{ components:{
......
...@@ -121,10 +121,12 @@ export default { ...@@ -121,10 +121,12 @@ export default {
btns:true, btns:true,
time:true time:true
}, },
upbCustomerGUID:'',//客户ID
} }
}, },
async mounted(){ async mounted(){
window.d = this; this.upbCustomerGUID=this.$route.query.upbCustomerGUID||""
this.$store.dispatch('saveUserId',this.$route.params.userId); this.$store.dispatch('saveUserId',this.$route.params.userId);
await this.getStatus(); await this.getStatus();
await this.getHdr(); await this.getHdr();
...@@ -172,6 +174,7 @@ export default { ...@@ -172,6 +174,7 @@ export default {
data.sStatus = status.join(','); data.sStatus = status.join(',');
} }
data.searchvalue == '' && (delete data.searchvalue); data.searchvalue == '' && (delete data.searchvalue);
this.upbCustomerGUID&&(data.upbCustomerGUID=this.upbCustomerGUID)
data.begin_date = data.dBeginDate; data.begin_date = data.dBeginDate;
data.end_date = data.dEndDate; data.end_date = data.dEndDate;
delete data.dBeginDate; delete data.dBeginDate;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment