Commit 802299e6 authored by godwithdh's avatar godwithdh

往来单位

parent 1d57409a
......@@ -12,8 +12,8 @@ function urlFun(name){
/**
* 默认公司
*/
default:`http://192.168.4.34:5001`,
// default:`https://weixin.huansi.net/apiproxy/huansi/hszh_HSFabricTradeTest`,
// default:`http://192.168.4.34:5001`,
default:`https://weixin.huansi.net/apiproxy/huansi/hszh_HSFabricTradeTest`,
// default:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/${userID}`,
/**
......
......@@ -109,7 +109,7 @@ export default {
columns1:[],
showTab:true,
page:1,
per_page:50
per_page:50,
}
},
computed:{
......@@ -120,11 +120,12 @@ export default {
},
async mounted(){
window.d = this;
this.$nextTick(()=>{
})
// if(this.$route.query.userId){
// store.dispatch('saveUserId',this.$route.query.userId);
// }
},
async activated(){
console.log("--------activate---------")
this.page = 1;
this.per_page = 50;
this.showTab = true;
......
......@@ -146,7 +146,7 @@
<div id="tiipOperateDetail">
<customTime ref="time"/>
<div class="Table">
<customerTable :columns="columns" :list="list" :tableStyle="tableStyle"></customerTable>
<customerTable :showFooter="isFooter" :columns="columns" :list="list" :tableStyle="tableStyle" />
</div>
</div>
</template>
......@@ -169,7 +169,7 @@ export default {
singleTrBgColor:'#eef4fe',
theadTdBorder:false,
tbodyTdBorder:false,
tbodyHeight:'calc(100%)',
tbodyHeight:'100%',
tbodyTrBorderBottom:'1px solid #dbe9f8',
width:'100%'
},
......@@ -196,46 +196,129 @@ export default {
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],
isFooter:false,
mode:0,//进入方式0 默认 往来单位->产品列表,1 往来单位->销售
upbCustomerGUID:"",//客户id
page:1,
per_page:50
}
},
async mounted(){
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:"销售列表"});
}
this.$nextTick(async ()=>{
this.$refs.time.$on("time",date=>{
this.DateValue=date
this.clean()
this.getData()
})
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=>{
var postData=[
{key:"url",value:"Operation gai sType-customer-sOrder-dtl"},
{key:"sType",value:"销售"},
{key:"sOrderNo",value:this.list[res.trIndex].sOrderNo},
]
var value=await this.request("getBoss",{data:postData},"加载中",{})
this.$store.dispatch("saveKanbanOrderDetail",value)
this.$router.push({name:"orderDetailsIndex"})
})
})
},
methods:{
async getData(){
let postData = [
{key:"url",value: 'Operation gai sType-material'},
{key:"sType",value:"销售"},
{key:"begin_date",value:this.DateValue[0]},
{key:"end_date",value:this.DateValue[1]||this.DateValue[0]}
]
async getData(reData){
if(this.mode==0){
var postData = [
{key:"url",value: 'Operation gai sType-material'},
{key:"sType",value:"销售"},
{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(this.mode==1){
if(this.per_page<50)return;
var postData=[
{key:"url",value:"Operation gai sType-customer-sOrder"},
{key:"sType",value:"销售"},
{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',{
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(this.mode==1){
this.per_page=res.length
this.page++
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;
})
res.forEach((v,i)=>{
v.sOrderNoHTML=`<div><span style='text-decoration:${i<res.length-1?'underline':'none'};'>${v.sOrderNo||0}</span></div>`
v.nAmountHTML=`<div><span style="color:#339966;">${v.nAmount||0}</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=[]
},
},
components:{
......
......@@ -121,10 +121,12 @@ export default {
btns:true,
time:true
},
upbCustomerGUID:'',//客户ID
}
},
async mounted(){
window.d = this;
this.upbCustomerGUID=this.$route.query.upbCustomerGUID||""
this.$store.dispatch('saveUserId',this.$route.params.userId);
await this.getStatus();
await this.getHdr();
......@@ -172,6 +174,7 @@ export default {
data.sStatus = status.join(',');
}
data.searchvalue == '' && (delete data.searchvalue);
this.upbCustomerGUID&&(data.upbCustomerGUID=this.upbCustomerGUID)
data.begin_date = data.dBeginDate;
data.end_date = data.dEndDate;
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