12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472 |
- <template>
- <div>
- <div class="mobile-header mobile-center-header">
- <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
- <p>应付对账
-
- </p>
- <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise && user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
- </div>
- <div class="btobapCheck-wrapper">
- <div class="order-tab">
- <div class="order-tab-wrapper clearfix">
- <div class="fl active tab">B2B</div>
- <nuxt-link class="fl tab" to="/mobile/center/user/payCenter" tag="div" >
- 商城
- </nuxt-link>
- </div>
- </div>
-
-
-
-
-
-
- <div v-show="activeType !== 'all'">
- <div class="search-content mi-search-content">
- <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="单据编号/客户名称/物料名称">
- <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
- </div>
- <div class="btobapCheck-wrapper-scroll" id="btobapCheck-wrapper-scroll">
- <div class="filter-wrapper">
- <base-filter
- v-for="filterOption in filterOptions"
- :key="filterOption.selectOption"
- :selectItems="filterOption.selectItems"
- :defaultVal="filterOption.defaultVal"
- :selectOption="filterOption.selectOption"
- @selectAction="onSelectAction"
- @valueAction="onValueAction"
- :title="filterOption.title">
- </base-filter>
- </div>
- <div v-if="resourceList.content && resourceList.content.length > 0">
- <div class="invoice-btob-list" v-for="item in resourceList.content">
- <div class="invoice-btob-wrapper-top">
- <span class="read" v-if="!isUnread(item.id)" style="margin-right: 0.3rem">已读</span>
- <span class="noread" v-if="isUnread(item.id)" style="margin-right: 0.3rem">未读</span>
- <span style="margin-right: 0.3rem">{{item.recordDate | time}}</span>
- <span class="isPut" v-if="item.status">已提交</span>
- <span class="noPut" v-else>未提交</span>
- </div>
- <div class="invoice-btob-wrapper-middle">
- <div class="invoice-btob-wrapper-middle-title">{{item.vendorName}}</div>
- <div @click="lookDetails(item.id)"><span>单据编号:</span><a>{{item.code}}</a></div>
- </div>
- <div class="invoice-btob-wrapper-content">
- <div><span>对账期间:</span>{{item.beginDate | time}} - {{item.endDate | time}}</div>
- <div><span>对账金额:</span>{{isUser ? '-' : item.checkAmount}}</div>
- <div><span>明细条目:</span>{{item.items && item.items.length}}条</div>
- <div><span>对账人:</span>{{item.recorder}}</div>
- {{item.getTotalProd}}
- {{item.checkStatus}}
- </div>
- </div>
- </div>
- <empty-status
- v-else
- :text="'暂无对账信息'"
- :showLink="false"
- ></empty-status>
- <pull-up :fixId="'btobapCheck-wrapper-scroll'" :allPage="allPage" :page="filterParams.page" @pullUpAction="onPullUpAction"></pull-up>
- </div>
- </div>
- <div v-show="activeType === 'all'">
- <div class="search-content mi-search-content">
- <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="客户名称">
- <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
- </div>
- <div class="timeLine-wrapper">
- <div class="inline-block left" @click="addMonth('out', 'outTimeMonth', -1)">
- <i class="iconfont icon-xiangzuo" style="font-size: 0.3rem"></i>
- </div>
- <div class="inline-block timeLine" style="text-indent: 0.12rem" @click="ShowMonthChoose('out', 'outTimeMonth')">{{outTimeMonth}}<i class="iconfont icon-arrow-down" style="font-size: 0.3rem"></i></div>
- <div class="inline-block right" @click="addMonth('out', 'outTimeMonth', 1)" v-show="MouthOutShow">
- <i class="iconfont icon-xiangyou" style="font-size: 0.3rem"></i>
- </div>
- </div>
- <div class="btobapCheck-wrapper-scroll btobapCheck-wrapper-scroll2" id="btobapCheck-wrapper-scroll2">
- <div v-if="resourceList.content && resourceList.content.length > 0">
- <div class="invoice-btob-list" v-for="item in resourceList.content">
- <div class="invoice-btob-wrapper-middle" style="border-top: 0">
- <div class="invoice-btob-wrapper-middle-title">{{item.vendorEnterprise && item.vendorEnterprise.enName}}</div>
- </div>
- <div class="invoice-btob-wrapper-middle">
- <div v-if="item.thisMonthCount && item.thisMonthCount.length > 0">
- <span class="inline-block" style="vertical-align: top">本月应付:</span>
- <div class="inline-block" style="vertical-align: top" >
- <div v-for="count in item.thisMonthCount" v-if="count.amount > 0">
- <span>{{count.currency}}:{{count.amount | computeNum(2)}}</span>
- </div>
- </div>
- </div>
- <div v-else><span>本月应付:0</span></div>
- <div v-if="item.thisMonthDoneCount && item.thisMonthDoneCount.length > 0">
- <span class="inline-block" style="vertical-align: top">本月已对:</span>
- <div class="inline-block" style="vertical-align: top" >
- <div v-for="count in item.thisMonthDoneCount" v-if="count.amount > 0">
- <span>{{count.currency}}:{{count.amount | computeNum(2)}}</span>
- </div>
- </div>
- </div>
- <div v-else><span>本月已对:0</span></div>
- <div v-if="item.thisMonthTodoCount && item.thisMonthTodoCount.length > 0">
- <span class="inline-block" style="vertical-align: top">本月未对:</span>
- <div class="inline-block" style="vertical-align: top" >
- <div v-for="count in item.thisMonthTodoCount" v-if="count.amount > 0">
- <span>{{count.currency}}:{{count.amount | computeNum(2)}}</span>
- </div>
- </div>
- </div>
- <div v-else><span>本月未对:0</span></div>
-
-
-
-
- {{count.currency}}{{count.amount | computeNum(2)}}
-
-
-
-
- <div v-if="item.totalCount && item.totalCount.length > 0">
- <span class="inline-block" style="vertical-align: top">应付总额:</span>
- <div class="inline-block" style="vertical-align: top" >
- <div v-for="count in item.totalCount" v-if="count.amount > 0">
- <span>{{count.currency}}:{{count.amount | computeNum(2)}}</span>
- </div>
- </div>
- </div>
- <div v-else><span>应付总额:0</span></div>
- </div>
- <div class="invoice-btob-wrapper-middle" @click="showApcheckList(item)">
- <div class="middle_btn">明细</div>
- </div>
- </div>
- </div>
- <empty-status
- v-else
- :text="'暂无对账信息'"
- :showLink="false"
- ></empty-status>
- <pull-up :fixId="'btobapCheck-wrapper-scroll2'" :allPage="allPage" :page="filterParams.page" @pullUpAction="onPullUpAction"></pull-up>
- </div>
- </div>
- </div>
- <modal-wrapper :title="isShowApcheckList.enName" :showModal="isShowApcheckList.show" @closeAction="deleteCheck" :bgColor="'#f1f3f6'" :hasFooter="true">
- <div slot="header" class="modal-h">
- <div class="modal-h-top">
-
-
-
- <span class="inline-block overflowhidden">
- 应付供应商:{{isShowApcheckList.enName}}
- </span>
- </div>
- <div class="timeLine-wrapper clearfix">
- <div v-show="!isShowApcheckList.showApcheck">
- <div style="margin-left: 0.5rem">
- <div class="inline-block left" @click="addMonth('inside', '', -1)">
- <i class="iconfont icon-xiangzuo" style="font-size: 0.3rem"></i>
- </div>
- <div class="inline-block timeLine" style="text-indent: 0.12rem" @click="ShowMonthChoose('inside')">{{isShowApcheckList.thisMonth}}<i class="iconfont icon-arrow-down" style="font-size: 0.3rem"></i></div>
- <div class="inline-block right" @click="addMonth('inside', '', 1)" v-show="MouthinShow">
- <i class="iconfont icon-xiangyou" style="font-size: 0.3rem"></i>
- </div>
- </div>
- <div style="clear:both"></div>
- <base-filter
- ref="baseFilter"
- v-for="filterOption in ApcheckfilterOptions"
- :ShowTitle="ShowTitle"
- :key="filterOption.selectOption"
- :selectItems="filterOption.selectItems"
- :defaultVal="filterOption.defaultVal"
- :selectOption="filterOption.selectOption"
- @selectAction="ApcheckonSelectAction"
- @valueAction="ApcheckonValueAction"
- :title="filterOption.title">
- </base-filter>
- </div>
- <div v-show="isShowApcheckList.showApcheck" style="line-height: 1.4rem;text-align: center">
- {{isShowApcheckList.startTime}} ~ {{isShowApcheckList.endTime}}
- </div>
- </div>
- <div style="height: 0.2rem; width: 100%;"></div>
- {{isShowApcheckList.thisMonth}}
-
- </div>
- <div class="btobapCheck-modal">
- <div class="choosescreen-result">
- <div v-if="isShowApcheckList.list.length > 0">
- <div class="clearfix choosescreen-result-list" v-for="(item, index) in isShowApcheckList.list">
- <div>
- <div class="choosescreen-result-list-content">
- <div style="border-bottom: 1px solid #D3D3D3;padding-bottom: 0.2rem">
-
-
-
- <div class="inline-block" style="margin-left: 0.15rem">
- <div class="OverHidden">采购单:<span>{{item.ordercode}}</span></div>
- <div class="OverHidden">发货单:<span>{{item.sendcode}}</span></div>
- <div class="OverHidden">验收单:<span>{{item.inoutno}}</span></div>
- {{index + 1}}
- {{item.piclass}}
- {{item.pidate | time}}
- </div>
- </div>
- <div style="padding-top: 0.2rem">
-
-
-
- <div class="inline-block" style="margin-left: 0.15rem">
- <div class="OverHidden">物料名称:<span>{{item.prodtitle}}</span></div>
- <div class="OverHidden">规格型号:<span>{{item.prodspec}}</span></div>
- <div class="OverHidden">发货数量:<span>{{item.qty}}</span></div>
- <div class="OverHidden">验收数量:<span>{{item.thischeckqty}}</span></div>
- <div class="OverHidden">单价:<span>{{item.currency}}:{{item.orderprice}}</span></div>
- {{item.sendcode}}
- <div class="OverHidden">税率:<span>{{item.taxrate}}%</span></div>
- <div class="OverHidden">对账人:<span>{{item.recorder}}</span></div>
- {{item.prodcode}}
- {{}}
- </div>
- </div>
- </div>
- <div class="clearfix" style="border-top:1px solid #D9D9D9;padding: 0 0.15rem;line-height: 0.8rem" >
- <div class="fl" style="font-size: 0.26rem">小计:</div>
- <div class="fr" style="color: #FF3208;font-size: 0.26rem">{{item.nowmoney | computeNum(2)}}</div>
- </div>
- </div>
- </div>
- </div>
- <empty-status
- v-else
- :text="'暂无对账信息'"
- :showLink="false"
- ></empty-status>
- </div>
- </div>
- <div slot="footer" class="footerBtn clearfix">
-
-
-
-
- <div class="fr" style="margin-right: 0.2rem" >合计:<a style="color: #001408;">{{allMoney | computeNum}}</a></div>
- {{allMoney}}
-
-
- </div>
- </modal-wrapper>
- <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
- <div class="fixedPicker" v-show="isShowMonthChoose">
- <picker :slots="slots" @change="onValuesChange" :showToolbar="true" ref="picker">
- <div class="titls">选择当前时间</div>
- <div class="leftBtn" @click="isShowMonthChoose=false">取消</div>
- <div class="rightBtn" @click="resultMonth">确定</div>
- </picker>
- </div>
- </div>
- </template>
- <script>
- import { Picker } from 'mint-ui'
- import { ModalWrapper, BaseFilter } from '~components/mobile/base'
- import { PullUp, EmptyStatus, RemindBox } from '~components/mobile/common'
- function years() {
- let _d = new Date()
- let _year = Number(_d.getFullYear())
- let arr = []
- let num = 2000
- for (let i = 2000; i < _year; i++) {
- num++
- arr.push(num + '年')
- }
- return arr
- }
- function getMonth() {
- let sdateTo = new Date()
-
- return sdateTo.getMonth() - 1
- }
- function getYear() {
- let num = 2000
- let sdateTo = new Date()
- let _year = sdateTo.getFullYear()
- for (let i = 0; i < 99; i++) {
- num++
- if (num === Number(_year)) {
- num = i
- break
- }
- }
- return num
- }
- export default {
- layout: 'mobileNoHeader',
- middleware: 'authenticated',
- data() {
- return {
- MouthinShow: true,
- MouthOutShow: true,
- ShowTitle: false,
- collectResult: '',
- timeoutCount: 0,
- isShowMonthChoose: false,
- slots: [
- {
- flex: 1,
- values: years(),
- className: 'slot1',
- textAlign: 'center',
- defaultIndex: getYear()
- }, {
- divider: true,
- content: '-',
- className: 'slot2'
- }, {
- flex: 1,
- values: ['01月', '02月', '03月', '04月', '05月', '06月', '07月', '08月', '09月', '10月', '11月', '12月'],
- className: 'slot3',
- textAlign: 'center',
- defaultIndex: getMonth()
- }
- ],
- activeType: 'all',
- filterParams: {
- keyword: '',
- page: 1,
- count: 10
- },
- filterOptions: [
- {
- title: '交易时间',
- selectOption: 'date',
- selectItems: [{
- key: '30天',
- val: 1
- }, {
- key: '90天',
- val: 2
- }, {
- key: '180天',
- val: 3
- }, {
- key: '自定义',
- val: 4
- }],
- defaultVal: 1
- }
- ],
- resourceList: {
- content: []
- },
- isUser: false,
- unreadCode: [],
- showModal: false,
- dateObj: {},
- screenObj: {},
- outTimeMonth: '',
- isShowApcheckList: {
- show: false,
- enName: '',
- thisMonth: '',
- list: [],
- showApcheck: false,
- id: '',
- startTime: '',
- endTime: '',
- objTime: {}
- },
- ApcheckfilterOptions: [
- {
- title: '',
- selectOption: 'date',
- selectItems: [{
- key: '自定义',
- val: 4
- }],
- defaultVal: 1
- }
- ],
- ShowApcheckChooseTime: false
- }
- },
- created() {
- this.$http.get('/btob/account/role/isUser').then(res => {
- this.isUser = res.data.isUser
- })
- this.getUnread()
- let sdateTo = new Date()
- this.isShowApcheckList.thisMonth = sdateTo.getFullYear() + '-' + sdateTo.getMonth()
- this.outTimeMonth = sdateTo.getFullYear() + '-' + sdateTo.getMonth()
- },
-
-
-
-
-
- methods: {
- onValuesChange(picker, value) {
-
- if (!this.$value) {
- picker.setSlotValue(0, '2018年')
- picker.setSlotValue(1, '11月')
- this.$picker = picker
- }
- let _ns = value[0].replace('年', '')
- let _my = value[1].replace('月', '')
- this.$value = _ns + '-' + _my
- },
-
- resultMonth() {
- this.isShowMonthChoose = false
- if (this.$monthType === 'out') {
- let _time2 = this.computedTime(this.$value + '-01')
- let _d = this.computedTime(new Date())
- if (_time2.getTime() > _d.getTime()) {
- this.setRemindText('所选对账日期不能超过当前时间')
- return
- }
- let _sp = new Date()
- if (_time2.getTime() >= _sp.getTime()) {
- this.MouthOutShow = false
- } else {
- this.MouthOutShow = true
- }
- this.outTimeMonth = this.$value
- this.filterParams.page = 1
- this.setSelect('', '', true)
- } else {
- let _time2 = this.computedTime(this.$value + '-01')
- let _d = this.computedTime(new Date())
- if (_time2.getTime() > _d.getTime()) {
- this.setRemindText('所选对账日期不能超过当前时间')
- return
- }
- let _sp = new Date()
- if (_time2.getTime() > _sp.getTime()) {
- this.MouthinShow = false
- } else {
- this.MouthinShow = true
- }
- this.$monthClick = true
- this.isShowApcheckList.thisMonth = this.$value
- this.ShowApcheckChooseTime = false
- this.$refs.baseFilter[0].setSelect(1)
- this.isShowApcheckList.show = true
- this.getApcheckDetailsinfo()
- }
- },
-
- addApCheck() {
- this.showModal = true
- },
- setRemindText: function (str) {
- this.collectResult = str
- this.timeoutCount++
- },
- setDate (type) {
- if (this.dateObj[type]) {
-
- this.dateObj[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
-
- if (this.dateObj.fromDate && this.dateObj.toDate && this.dateObj.fromDate > this.dateObj.toDate) {
- if (type === 'fromDate') {
- this.setRemindText('起始时间不能大于结束时间')
- } else {
- this.setRemindText('结束时间不能小于起始时间')
- }
- this.dateObj[type] = null
- }
-
- if (this.dateObj.toDate && type === 'toDate') {
- this.dateObj.toDate += (23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000)
- }
- } else {
- this.dateObj[type] = null
- }
- },
- toChooseUser() {
- console.log('选择客户')
- },
- onPullUpAction () {
- this.filterParams.page++
- this.setSelect(this.$selectObj.key, this.$selectObj.value, false)
- },
- getUnread() {
- this.$http.get('/sale/apCheck/unread').then(res => {
- this.unreadCode = res.data.content
- })
- },
- lookDetails(id) {
- console.log('前往详情并且设置为已读')
-
-
-
-
-
-
-
- },
- isUnread: function (id) {
- for (let i in this.unreadCode) {
- if (id === this.unreadCode[i]) {
- return true
- }
- }
- },
- ChangeList(tp) {
- this.activeType = tp
- this.filterParams.page = 1
- this.setSelect(this.$selectObj.key, this.$selectObj.value, true)
- },
- onFilter() {
- this.filterParams.page = 1
- this.setSelect(this.$selectObj.key, this.$selectObj.value, true)
- },
- onSelectAction(selectObj) {
- this.$selectObj = selectObj
- this.setSelect(selectObj.key, selectObj.value, true)
- },
- onValueAction(selectObj) {
- this.$selectObj = selectObj
- this.setSelect(selectObj.key, selectObj.value, true)
- },
- ApcheckonSelectAction(selectObj) {
- if (this.$monthClick) return
- this.ShowApcheckChooseTime = true
- this.isShowApcheckList.objTime = selectObj
- this.getApcheckDetailsinfo(selectObj.key, selectObj.value)
- },
- ApcheckonValueAction(selectObj) {
-
-
-
- },
-
-
-
-
-
- showApcheckList(item) {
- this.isShowApcheckList.show = true
- this.isShowApcheckList.vendorUU = item ? item.vendorEnterprise.uu : this.isShowApcheckList.vendorUU
- this.isShowApcheckList.enName = item ? item.vendorEnterprise.enName : this.isShowApcheckList.enName
- this.isShowApcheckList.thisMonth = this.outTimeMonth
- this.getApcheckDetailsinfo()
- },
-
- getApcheckDetailsinfo (...objTime) {
- if (!this.isShowApcheckList.show) return
- let _params = {
- params: {
- checkDate: this.isShowApcheckList.thisMonth,
- vendorUU: this.isShowApcheckList.vendorUU
-
- }
- }
-
- if (this.ShowApcheckChooseTime && !this.$monthClick) {
-
-
- _params = {
- params: {
- fromDate: objTime[1].fromDate,
- endDate: objTime[1].toDate,
- vendorUU: this.isShowApcheckList.vendorUU
-
- }
- }
- }
- this.$http.get('/sale/arCheck/getAllByKeywords', _params).then(res => {
- res.data.details.forEach(item => {
- item.check = true
- })
- this.isShowApcheckList.enName = res.data.vendorName
- this.$monthClick = false
- this.isShowApcheckList.list = res.data.details
- this.$nextTick(() => {
- this._initscroll()
- })
- })
- },
-
- checkAll() {
- let fl = true
- if (this.isCheckAll === 0) {
- fl = false
- }
- this.isShowApcheckList.list.forEach(item => {
- item.check = fl
- })
- },
- checkItem(item, index) {
- if (item.check) {
- item.check = false
- } else {
- this.$set(this.isShowApcheckList.list[index], 'check', true)
- }
- },
- // 对账按钮
- goTopayfor() {
- let apCheck = {
- custUu: '',
- custName: '',
- enUu: '',
- apDate: '',
- beginDate: '',
- endDate: '',
- checkStatus: '未对账',
- checkAmount: 0,
- currency: '',
- rate: '',
- items: [],
- taxrate: ''
- }
-
- let sourceInfos = []
-
- this.isShowApcheckList.list.maxThisCheckQty = 0
- this.isShowApcheckList.list.minThisCheckQty = 0
- let sameCust = true
- let validQty = true
- let _list = []
- this.isShowApcheckList.list.forEach((check) => {
-
- let item = {
- inoutno: '',
- inoutnodetno: '',
- orderCode: '',
- orderClass: '',
- orderDetno: '',
- price: '',
- checkQty: '',
- amount: '',
- sourceId: '',
- sourceTable: '',
- oldYCheckQty: '',
- status: 0,
- receiveCode: '',
- receiveName: '',
- prodCode: '',
- prodTitle: '',
- prodUnit: '',
- prodSpec: '',
- taxrate: '',
- sendcode: '',
- whname: '',
- custUserUU: ''
- }
-
- let sourceInfo = {
- sourceId: '',
- sourceTable: '',
- newYCheckQty: ''
- }
-
- if (check.check === true && !check.haveChecked) {
- _list.push(check)
- apCheck.custName = check.custname
- apCheck.enUu = check.enuu
- apCheck.checkAmount += (check.thischeckqty || 0) * (check.orderprice || 0)
- apCheck.apDate = check.pidate
- apCheck.rate = check.rate
-
- if (apCheck.custUu === '') {
- apCheck.custUu = check.custuu
- } else if (apCheck.custUu !== check.custuu) {
- sameCust = false
- this.setRemindText('请选择同一家客户')
- }
-
- if (apCheck.currency === '') {
- apCheck.currency = check.currency
- } else if (apCheck.currency !== check.currency) {
- sameCust = false
- this.setRemindText('请选择同一种币别')
- }
- let re = /^[0-9]+.?[0-9]*$/
-
- if (!re.test(apCheck.taxrate)) {
-
- apCheck.taxrate = check.taxrate
- } else if (apCheck.taxrate !== check.taxrate) {
- sameCust = false
- this.setRemindText('请选择相同的税率')
- }
-
- if (check.qty > 0) {
- this.isShowApcheckList.list.maxThisCheckQty = check.qty
- this.isShowApcheckList.list.minThisCheckQty = 0
- if (check.qty - (check.ycheckqty || 0) < check.thischeckqty || check.thischeckqty < 0 || check.thischeckqty === 0) {
- validQty = false
- this.setRemindText('本次对账数量,填写有误!')
- }
- } else if (check.qty < 0) {
- this.isShowApcheckList.list.maxThisCheckQty = 0
- this.isShowApcheckList.list.minThisCheckQty = check.qty
- if (((-check.qty) - (-check.ycheckqty) < (-check.thischeckqty)) || check.thischeckqty > 0 || check.thischeckqty === 0) {
- validQty = false
- this.setRemindText('本次对账数量,填写有误!')
- }
- }
-
- if (this.ShowApcheckChooseTime) {
- let _time1 = this.isShowApcheckList.objTime.value.fromDate
- _time1 = _time1.replace(/-/g, '/')
- let _start = new Date(_time1)
- let _time2 = this.isShowApcheckList.objTime.value.fromDate
- _time2 = _time2.replace(/-/g, '/')
- let _end = new Date(_time2)
-
- apCheck.beginDate = _start.getTime()
-
- apCheck.endDate = _end.getTime()
- } else {
- this.isShowApcheckList.startTime = this.isShowApcheckList.thisMonth + '-01'
- let _time1 = this.isShowApcheckList.startTime
- _time1 = _time1.replace(/-/g, '/')
- let _d = new Date(_time1)
- _d.setDate(1)
- _d.setMonth(_d.getMonth() + 1)
- _d.setDate(_d.getDate() - 1)
-
- let _time2 = this.isShowApcheckList.startTime
- _time2 = _time2.replace(/-/g, '/')
- apCheck.beginDate = new Date(_time2).getTime()
-
- apCheck.endDate = _d.getTime()
- }
-
- item.orderCode = check.ordercode
- item.orderClass = check.piclass
- item.orderDetno = check.orderdetno
- item.price = check.orderprice
- item.checkQty = check.thischeckqty
- item.amount = (check.thischeckqty || 0) * (check.orderprice || 0)
- item.sourceId = check.sourceid
- item.sourceTable = check.sourcetable
- item.oldYCheckQty = check.ycheckqty
- item.prodCode = check.prodcode
- item.prodTitle = check.prodtitle
- item.prodSpec = check.prodspec
- item.prodUnit = check.produnit
- item.inoutno = check.inoutno
- item.inoutnodetno = check.detno
- item.taxrate = check.taxrate
- item.receiveCode = check.receivecode
- item.receiveName = check.receivename
- item.sendcode = check.sendcode
- item.whname = check.whname
- item.custUserUU = check.custuseruu
-
- sourceInfo.sourceid = check.sourceid
- sourceInfo.sourcetable = check.sourcetable
- sourceInfo.newYCheckQty = ((check.ycheckqty || 0) + check.thischeckqty)
- sourceInfos.push(sourceInfo)
- apCheck.items.push(item)
-
-
- }
- })
- if (sameCust && validQty) {
- this.isShowApcheckList.list = _list
- this.saveApCheck(apCheck)
- }
- },
-
- saveApCheck(apCheck) {
- if (apCheck.items.length === 0) {
- this.setRemindText('请先选择需要对账的数据')
- } else {
- this.$http.post('/sale/apCheck/operation/save', apCheck).then(res => {
- this.setRemindText('生成应收对账成功')
- this.isShowApcheckList.id = res.data.id
- this.isShowApcheckList.showApcheck = true
- if (this.ShowApcheckChooseTime) {
- let _time1 = this.isShowApcheckList.objTime.value.fromDate
- _time1 = _time1.replace(/-/g, '/')
- let _start = new Date(_time1)
- let _time2 = this.isShowApcheckList.objTime.value.toDate
- _time2 = _time1.replace(/-/g, '/')
- let _end = new Date(_time2)
- this.isShowApcheckList.startTime = _start.getFullYear() + '-' + (_start.getMonth() + 1) + '-' + _start.getDate()
- this.isShowApcheckList.endTime = _end.getFullYear() + '-' + (_end.getMonth() + 1) + '-' + _end.getDate()
- } else {
- this.isShowApcheckList.startTime = this.outTimeMonth + '-01'
- let _d = this.computedTime(this.isShowApcheckList.startTime)
- this.isShowApcheckList.endTime = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate()
- }
- this.ShowApcheckChooseTime = false
- }, err => {
- this.setRemindText('生成对账单失败')
- })
- }
- },
-
- submitCheck() {
- this.$http.post('sale/apCheck/operation/updateStatus?id=' + this.isShowApcheckList.id).then(res => {
- this.setRemindText('新增成功')
- this.isShowApcheckList.showApcheck = false
- this.isShowApcheckList.show = false
- this.isShowApcheckList.id = ''
- })
- },
-
- deleteCheck() {
- if (this.isShowApcheckList.id === '') {
- this.isShowApcheckList.showApcheck = false
- this.isShowApcheckList.show = false
- this.isShowApcheckList.id = ''
- return
- }
- this.$http.post('/sale/apCheck/operation/deleteApCheck?id=' + this.isShowApcheckList.id, {}).then(res => {
- this.isShowApcheckList.showApcheck = false
- this.isShowApcheckList.show = false
- this.isShowApcheckList.id = ''
- let sourceInfos = []
- this.isShowApcheckList.list.forEach(item => {
- let sourceInfo = {
- sourceId: '',
- sourceTable: '',
- newYCheckQty: ''
- }
- sourceInfo.sourceId = item.sourceid
- sourceInfo.sourceTable = item.sourcetable
- sourceInfo.newYCheckQty = item.oldYCheckQty
- sourceInfos.push(sourceInfo)
- })
- this.$http.post('/sale/apCheck/update', sourceInfos).then(res => {})
- }, err => {
- this.setRemindText(err.response.data)
- })
- },
-
- addMonth(tp, key, val) {
- if (tp === 'inside') {
- let _sp = new Date()
- this.ShowApcheckChooseTime = false
- this.$monthClick = true
- let _d = this.computedTime(this.isShowApcheckList.thisMonth + '-01', val)
- let _m = Number(_d.getMonth() + 1) < 10 ? '0' + (_d.getMonth() + 1) : (_d.getMonth() + 1)
- this.isShowApcheckList.thisMonth = _d.getFullYear() + '-' + _m
- if (_d.getTime() >= _sp.getTime()) {
- this.MouthinShow = false
- } else {
- this.MouthinShow = true
- }
- this.$refs.baseFilter[0].setSelect(1)
- this.isShowApcheckList.show = true
- this.getApcheckDetailsinfo()
- } else {
- let _sp = new Date()
- let _d = this.computedTime(this[key] + '-01', val)
- let _m = Number(_d.getMonth() + 1) < 10 ? '0' + (_d.getMonth() + 1) : (_d.getMonth() + 1)
- this[key] = _d.getFullYear() + '-' + _m
- if (_d.getTime() >= _sp.getTime()) {
- this.MouthOutShow = false
- } else {
- this.MouthOutShow = true
- }
- this.filterParams.page = 1
- this.setSelect('', '', true)
- }
- },
- computedTime(num, val) {
- if ((typeof num === 'object') && num.constructor === Date) {} else {
- num = num.replace(/-/g, '/')
- }
- let _d = new Date(num)
- if (val !== undefined) {
- _d.setMonth(_d.getMonth() + val)
- }
- _d.setDate(1)
- _d.setMonth(_d.getMonth() + 1)
- _d.setDate(_d.getDate() - 1)
- return _d
- },
- async setSelect(...val) {
- let _url = '/purchase/arCheck'
- let itemL = {}
- if (this.activeType === 'all') {
- let _fromDate = this.outTimeMonth + '-01 00:00:00'
- let _d = this.computedTime(_fromDate)
- let _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
- _endDate = _endDate.replace(/-/g, '/')
- _endDate = new Date(_endDate).getTime()
- _fromDate = _fromDate.replace(/-/g, '/')
- _fromDate = new Date(_fromDate).getTime()
- _url = '/sale/arCheck/vendor'
- itemL = {
- params: {
- count: 20,
- page: this.filterParams.page,
- keyword: this.filterParams.keyword,
- searchFilter: {'fromDate': _fromDate, 'endDate': _endDate},
- sorting: { 'recordDate': 'desc' }
- }
- }
- } else {
- itemL = {
- params: {
- count: this.filterParams.count,
- page: this.filterParams.page,
- searchFilter: {'keyword': this.filterParams.keyword || '', 'fromDate': val[1].fromDate, 'endDate': val[1].toDate},
- sorting: {'recordDate': 'desc'},
- _state: this.activeType
- }
- }
- }
- let { data } = await this.$http.get(_url, itemL)
- if (!this.resourceList.content) {
- this.resourceList.content = []
- }
- data.content = data.content || []
- if (this.activeType !== 'all') {
- data.content.forEach(item => {
- item.checkAmount = item.checkAmount.toFixed(2)
- item.getTotalProd = 0
- item.items.forEach(im => {
- item.getTotalProd += im.checkQty
- })
- })
- } else {
- data.content.forEach((item) => {
- let _mouthArr = []
- let _totalArr = []
- item.thisMonthCount && item.thisMonthCount.forEach(count => {
- if (count.amount > 0) {
- _mouthArr.push(count)
- }
- })
- item.totalCount && item.totalCount.forEach(count => {
- if (count.amount > 0) {
- _totalArr.push(count)
- }
- })
- item.totalCount = _totalArr
- item.thisMonthCount = _mouthArr
- })
- console.log(data.content)
- }
- if (!val[2]) {
- this.resourceList.content.push(...data.content)
- data.content = this.resourceList.content
- } else {
- this.resourceList.content = []
- }
- this.resourceList = data
- },
-
- ShowMonthChoose(tp, key) {
- this.$monthType = tp
- if (tp === 'inside') {
- this.ShowApcheckChooseTime = false
- this.$monthClick = true
- this.$refs.baseFilter[0].setSelect(1)
- let _m = this.isShowApcheckList.thisMonth.split('-')[1].length < 2 ? '0' + this.isShowApcheckList.thisMonth.split('-')[1] : this.isShowApcheckList.thisMonth.split('-')[1]
- this.$picker.setSlotValue(0, this.isShowApcheckList.thisMonth.split('-')[0] + '年')
- this.$picker.setSlotValue(1, _m + '月')
- } else {
- let _m = this[key].split('-')[1].length < 2 ? '0' + this[key].split('-')[1] : this[key].split('-')[1]
- this.$picker.setSlotValue(0, this[key].split('-')[0] + '年')
- this.$picker.setSlotValue(1, _m + '月')
- }
- this.isShowMonthChoose = true
- }
- },
- computed: {
- allPage () {
- return Math.ceil(this.resourceList.totalElement / 10)
- },
- isEmpty () {
- return this.resourceList.content.length === 0
- },
- allMoney() {
- let sum = 0
- this.isShowApcheckList.list.forEach(obj => {
-
- sum += obj.nowmoney
-
- })
- return sum
- },
- isCheckAll() {
- if (this.isShowApcheckList.list.length === 0) {
- return true
- }
- return this.isShowApcheckList.list.filter(item => {
- return item.check === false
- }).length
- }
- },
- components: {
- ModalWrapper,
- BaseFilter,
- PullUp,
- EmptyStatus,
- Picker,
- RemindBox
- },
- filters: {
- time: function (time) {
- if (typeof time === 'number') {
- if (!time) {
- return '无'
- } else {
- let d = new Date(time)
- let year = d.getFullYear()
- let month = d.getMonth() + 1
- let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
- return year + '-' + month + '-' + day
- }
- }
- },
- computeNum: function(price, num) {
- return Math.floor(price * 100) / 100
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @mixin overFlowHidden {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .fixedPicker {
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 9999;
- background: rgba(0,0,0,0.5);
- .picker {
- width: 100%;
- left: 0;
- bottom: 0;
- position: absolute;
- background: #fff;
- }
- .titls {
- text-align: center;
- font-size: 0.24rem;
- line-height: 0.5rem
- }
- .leftBtn {
- color: #666;
- font-size: 0.24rem;
- position: absolute;
- left: 0.2rem;
- top: 0.1rem
- }
- .rightBtn {
- top: 0.1rem;
- color: #3e82f5;
- font-size: 0.24rem;
- position: absolute;
- right: 0.2rem;
- }
- }
- .mobile-header{
- position: fixed;
- top: 0;
- z-index: 100;
- width:100%;
- height: 1.26rem;
- line-height: 1.26rem;
- /*border-bottom:.01rem solid #ccc;*/
- background: #3e82f5;
- padding:0 .2rem 0 .1rem;
- color:#fff;
- }
- .mobile-header p{
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size:.36rem;
- text-align: center;
- width: 6rem;
- padding-left: 1rem;
- }
- .mobile-center-header p.en-name {
- font-size: .3rem;
- }
- .mobile-header a{
- font-size:.28rem;
- color:#fff;
- position: absolute;
- }
- .mobile-header a i{
- font-size: .48rem;
- margin-right: -.1rem;
- }
- .mobile-header p span {
- position: absolute;
- right: .4rem;
- font-size: .28rem;
- }
- .mobile-header p span i {
- font-size: .28rem;
- }
- .btobapCheck-wrapper {
- background: #f1f3f6;
- margin: 1.26rem 0 0.98rem 0;
- .search-content {
- padding: .24rem 0;
- text-align: center;
- background: #f1f3f6;
- input {
- width: 6.48rem;
- height: .58rem;
- line-height: .58rem;
- border-radius: .14rem;
- margin: 0 0 0 .11rem;
- font-size: .26rem;
- padding: 0 .71rem 0 .21rem;
- border: 1px solid #3f84f6;
- }
- }
- .order-tab {
- background: #3f84f6;
- padding-bottom: 0.2rem;
- .order-tab-wrapper {
- border: solid 1px #ffffff;
- width: 7.06rem;
- margin: 0 auto;
- border-radius: 0.04rem;
- line-height: 0.72rem;
- height: 0.72rem;
- overflow: hidden;
- div {
- color: #ffffff;
- font-size: 0.28rem;
- text-align: center;
- width: 50%;
- &.active {
- background-color: #ffffff;
- color: #3f84f6;
- }
- }
- }
- }
- .order-nav {
- background: #fff;
- div {
- height: 0.82rem;
- line-height: 0.82rem;
- display: inline-block;
- width: 49%;
- text-align: center;
- font-size: .28rem;
- color: #666;
- &.active span{
- color: #3f84f6;
- border-bottom: 0.04rem solid #3f84f6;
- padding-bottom: 0.2rem;
- }
- }
- }
- .btobapCheck-wrapper-scroll {
- height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem);
- overflow-y: auto;
- &.btobapCheck-wrapper-scroll2 {
- height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem - 1.3rem);
- }
- }
- .filter-wrapper{
- width: 7.1rem;
- margin: 0 auto 0.27rem;
- background: #fff;
- padding: 0.27rem 0.2rem;
- border-radius: 0.05rem;
- }
- .invoice-btob-list {
- width: 7.1rem;
- margin: 0 auto 0.2rem;
- background: #FFFFFF;
- border-radius: 0.05rem;
- padding: 0 0.24rem;
- }
- .invoice-btob-wrapper-top {
- height: 0.8rem;
- span{
- margin-top: 0.24rem;
- display: inline-block;
- font-size: 0.28rem;
- color: #333333;
- height:0.25rem;
- &.read {
- color: #15B262;
- }
- &.noread {
- color: #DE4545;
- }
- &.isPut {
- background: #15B262;
- color: #FFFFFF;
- font-size: 0.24rem;
- border-radius: 0.04rem;
- }
- &.noPut {
- font-size: 0.24rem;
- background: #DE4545;
- color: #FFFFFF;
- border-radius: 0.04rem;
- }
- }
- }
- .invoice-btob-wrapper-middle {
- border-top: 1px solid #D9D9D9;
- @include overFlowHidden();
- padding-top: 0.15rem;
- font-size: 0.28rem;
- color: #151515;
- line-height: 0.5rem;
- padding-bottom: 0.15rem;
- span {
- color: #666666;
- }
- .invoice-btob-wrapper-middle .tilte{
- color: #333333;
- }
- .middle_btn {
- text-align: center;
- font-size: 0.26rem;
- color: #333333;
- }
- }
- .invoice-btob-wrapper-content {
- border-top: 1px solid #D9D9D9;
- @include overFlowHidden();
- padding-top: 0.15rem;
- font-size: 0.28rem;
- color: #151515;
- line-height: 0.5rem;
- padding-bottom: 0.15rem;
- span {
- color: #666666;
- }
- }
- }
- .btobapCheck-modal {
- .search-content input {border: 1px solid #3f84f6;}
- .date-wrap{
- text-align: center;
- display: inline-block;
- label {
- width: 2.3rem;
- height: .5rem;
- line-height: .5rem;
- border-radius: .04rem;
- border: 1px solid #bfbfbf;
- background: url(/images/mobile/select-arrow.png) no-repeat;
- background-size: .12rem .06rem;
- vertical-align: middle;
- background-color: #fff;
- background-position: 2.1rem .2rem;
- position: relative;
- margin: .2rem 0 0 0;
- i {
- font-size: .28rem;
- color: #3f84f6;
- margin-left: .1rem;
- float: left;
- }
- input {
- opacity: 0;
- width: 2.22rem;
- height: .5rem;
- position: absolute;
- left: 0;
- z-index: 1;
- }
- p {
- font-weight: normal;
- font-size: .22rem;
- color: #3E81F6;
- text-align: left;
- text-indent: 10px;
- }
- }
- span {
- color: #a0a0a0;
- margin: 0.3rem .05rem 0;
- width: .3rem;
- display: inline-block;
- text-align: center;
- vertical-align: top;
- }
- }
- .choosescreen {
- padding: 0 0.15rem;
- font-size: 0.28rem;
- color: #418DF6;
- line-height: 0.52rem;
- i {
- font-size: 0.28rem;
- }
- }
- .choosescreen-list {
- margin: 0 0.15rem;
- padding-bottom: 0.28rem;;
- border-bottom: 1px solid #D9D9D9;
- div {
- line-height: 0.76rem;
- span {
- font-size: 0.28rem;
- color: #666666;
- display: inline-block;
- width: 1.68rem;
- }
- input {
- height: 0.5rem;
- line-height: 0.5rem;
- width: 4.44rem;
- margin-left: 0.18rem;
- font-size: 0.28rem;
- color: #333;
- border: 1px solid #AEAEAE;
- text-indent: 0.12rem;
- }
- }
- }
- .choosescreen-result {
- .choosescreen-result-list {
- /*padding: 0 0.15rem 0rem;*/
- background: #fff;
- margin:0 0 0.2rem;
- }
- .choosescreen-result-list-content {
- /*display: inline-block;*/
- vertical-align: middle;
- margin: 0 0.15rem;
- div.OverHidden {
- @include overFlowHidden();
- width: 5.5rem;
- }
- padding-top: 0.15rem;
- font-size: 0.28rem;
- color: #151515;
- line-height: 0.5rem;
- padding-bottom: 0.15rem;
- span {
- color: #666666;
- }
- }
- }
- }
- .timeLine-wrapper {
- background: #fff;
- border-radius: 0.05rem;
- height: 1.1rem;
- width: 7.1rem;
- margin: 0 auto 0.2rem;
- padding: 0.3rem 0 0 2rem;
- position: relative;
- .left {
- background: #fff;
- color: #333;
- padding: 0rem 0.1rem;
- /*box-shadow: 0 0 2px #a0a0a0;*/
- text-align: center;
- margin-right: 0.2rem;
- height: 0.5rem;
- line-height: 0.5rem;
- border: 1px solid #BFBFBF;
- }
- .right {
- text-align: center;
- background: #fff;
- color: #333;
- padding: 0rem 0.1rem;
- /*box-shadow: 0 0 2px #a0a0a0;*/
- margin-left: 0.2rem;
- height: 0.5rem;
- line-height: 0.5rem;
- border: 1px solid #BFBFBF;
- }
- .rightBtn {
- margin: 0.1rem 0.2rem 0 0;
- }
- }
- .modal-h {
- background: #F3F3F3;
- .modal-h-top {
- padding: 0.15rem;
- }
- .overflowhidden {
- @include overFlowHidden();
- width: 5.9rem;
- font-size: 0.28rem;
- color: #333333;
- margin-left: 0.1rem;
- }
- .timeLine-wrapper {
- width: 100%;
- padding: 0.1rem 0 0.1rem 0rem;
- height: 1.4rem;
- margin: 0
- }
- }
- div.timeLine {
- background: #FFFFFF;
- border: 1px solid #BFBFBF;
- border-radius: 4px;
- font-size: 0.28rem;
- color: #3E81F6;
- width: 1.7rem;
- display: inline-block;
- height: 0.5rem;
- line-height: 0.5rem
- }
- .footerBtn {
- padding: 0 0 0 0.15rem;
- height: 1rem;
- line-height: 1rem;
- background: #fff;
- font-size: 0.26rem;
- color: #666666;
- border-top: 1px solid #D3D3D3;
- .bbgoresult {
- background: #008BF7;
- color: #fff;
- width: 1.3rem;
- text-align: center;
- }
- .cancel {
- background: #fff;
- color: #333;
- height: 0.98rem;
- }
- }
- </style>
|