| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- const { createApp, ref ,onMounted,createVNode, render,computed,watch,nextTick} = Vue
- createApp({
- setup() {
- onMounted(()=>{
- getLoginAccountData()
- getAccountBalance()
- balance2()
- getData3()
- getMessage()
- getOrderMsg()
- invoiceData()
- listDataQuery()
- })
-
- const pageData = ref({
- accountBalance:{},
- data3:{},
- tab2:'msg',
- tab1:'xs'
- })
- const getLoginAccountData = ()=>{
- pageData.value.name = JSON.parse(sessionStorage.getItem('loginInfo')).resultobject.account_list[0].name
- pageData.value.date = `今天是${new Date().getFullYear()}年${new Date().getMonth() + 1}月${new Date().getDate()}日,欢迎您的使用`
- }
- const getAccountBalance = async ()=>{
- const res = await instance.post('',{
- "id":20221008145903,
- "content": {
- "type":1
- }
- })
- pageData.value.accountBalance = res.data.data[0]
- }
- const balance2 = async ()=>{
- const res = await instance.post('',{
- "id": "20241015111503",
- "content": {
- "point":"全部"
- },
- })
- pageData.value.sumallaoverduemount = res.data.data[0].sumallaoverduemount
-
- }
- const translate = (val)=>{
- return tool.translate(val)
- }
- const param = ref({
- id:20230713104304,
- content:{
- isAll:1,
- where:{
- begdate: "",
- enddate: "",
- type:''
- }
- }
- })
- const getData3 = async ()=>{
- const res = await instance.post('',param.value)
- pageData.value.data3 = res.data.data[0]
- }
- // 切换日期
- const invoiceDate = ref({})
- const svlistDate = ref({})
- const dateChange = (dom,pos)=>{
- let dtc = {
- data3:()=>{
- if (dom == '#begdate') {
- param.value.content.where.begdate = $(dom).val()
- }
- if (dom == '#enddate') {
- param.value.content.where.enddate = $(dom).val()
- }
- if ( param.value.content.where.enddate && param.value.content.where.begdate) {
- getData3()
- }
- },
- invoice:()=>{
- if (dom == '#begdate1') {
- invoiceDate.value.begdate = $(dom).val()
- }
- if (dom == '#enddate1') {
- invoiceDate.value.enddate = $(dom).val()
- }
- if ( invoiceDate.value.enddate && invoiceDate.value.begdate) {
- invoiceData()
- }
- },
- sevlist:()=>{
- if (dom == '#begdate2') {
- svlistDate.value.begdate = $(dom).val()
- }
- if (dom == '#enddate2') {
- svlistDate.value.enddate = $(dom).val()
- }
- if ( svlistDate.value.enddate && svlistDate.value.begdate) {
- listDataQuery()
- }
- },
-
- }
- dtc[pos]()
- }
- // 消息
- const getMessage = async ()=>{
- const res = await instance.post('',{
- "classname":'system.message.Message',
- "method":'queryMessage',
- "content": {
- "pageNumber":1,
- "pageSize":15,
- "nocache":true,
- "type":'应用'
- }
- })
- pageData.value.message = res.data.data;
- }
- // 单据动态
- const getOrderMsg = async ()=>{
- const res = await instance.post('',{
- id:20241015130103,
- "content": {
- }
- })
- pageData.value.orderMsg = res.data.data
- }
- // 发票查询
- const invoiceData = async ()=>{
- const res = await instance.post('',{
- "id": "2024101513041103",
- "content": {
- "where":{
- "begdate":invoiceDate.value.begdate,
- "enddate":invoiceDate.value.enddate
- }
- }
- })
- res.data.data.forEach(e=>{
- e.sumtaxincludedamount = tool.formatCurrency(e.sumtaxincludedamount)
- })
- pageData.value.invoiceData = res.data.data
- pageData.value.invoiceTotal = res.data.total
- }
- const linkOfIframe = (app)=>{
- let lg = localStorage.getItem('lang')
- let token = sessionStorage.getItem('token')
- if (tool.isMobile()) {
- switch (app.name) {
- case 'ordersaler':
- app.name = 'worderform'
- break;
- default:
- break;
- }
- let appid = ''
- if (app.system == 'sale' || app.system == 'service') {
- appid = 'wxc1b6ae925ac1d06a'
- } else {
- appid = 'wx197f219a82a89d7b'
- }
- window.location.href = `weixin://dl/business/?appid=${appid}&path=pages/login/selectSite&query=${token}_${app.name}_${lg}&env_version=develop`
- } else {
- window.location.href = `./iframe.html?path=${app.name}`
- }
- }
- const listDataQuery = async ()=>{
- // param.value.content.where.phonenumber = JSON.parse(sessionStorage.getItem('loginInfo')).customerphone
- const res = await instance.post('',{
- "id": "20230206091703",
- "content": {
- "siteid":"hy",
- "pageSize":100,
- "where":{
- "condition":"",
- "status":"",
- "begindate":svlistDate.value.begdate,
- "enddate":svlistDate.value.enddate,
- "phonenumber":'',
- }
- }
- })
- pageData.value.sevlist = res.data.data
- pageData.value.sevlistTotal = res.data.total
- }
- return {
- pageData,
- param,
- getData3,
- dateChange,
- // getSaleAndTarget,
- linkOfIframe,
- translate
- }
- }
- }).mount('#app')
|