btobarCheck.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547
  1. <template>
  2. <div>
  3. <div class="mobile-header mobile-center-header">
  4. <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
  5. <p>应付对账
  6. <!--<span @click="addApCheck"><i class="icon-sousuo iconfont"></i>新增对账单</span>-->
  7. </p>
  8. <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise && user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
  9. </div>
  10. <div class="btobapCheck-wrapper">
  11. <div class="order-tab">
  12. <div class="order-tab-wrapper clearfix">
  13. <div class="fl active tab">B2B</div>
  14. <nuxt-link class="fl tab" to="/mobile/center/user/payCenter" tag="div" >
  15. 商城
  16. </nuxt-link>
  17. </div>
  18. </div>
  19. <!--<div class="order-nav">-->
  20. <!--<div :class="activeType === 'all' ? 'active': ''" @click="ChangeList('all')"><span>未对账</span></div>-->
  21. <!--<div :class="activeType === 'todo' ? 'active' : ''" @click="ChangeList('todo')"><span>待确认</span></div>-->
  22. <!--<div :class="activeType === 'done' ? 'active': ''" @click="ChangeList('done')"><span>已对账</span></div>-->
  23. <!--<div :class="activeType === 'end' ? 'active' : ''" @click="ChangeList('end')"><span>已作废</span></div>-->
  24. <!--</div>-->
  25. <div v-show="activeType !== 'all'">
  26. <div class="search-content mi-search-content">
  27. <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="单据编号/供应商名称/物料名称">
  28. <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
  29. </div>
  30. <div class="btobapCheck-wrapper-scroll" id="btobapCheck-wrapper-scroll">
  31. <div class="filter-wrapper">
  32. <base-filter
  33. v-for="filterOption in filterOptions"
  34. :key="filterOption.selectOption"
  35. :selectItems="filterOption.selectItems"
  36. :defaultVal="filterOption.defaultVal"
  37. :selectOption="filterOption.selectOption"
  38. @selectAction="onSelectAction"
  39. @valueAction="onValueAction"
  40. :title="filterOption.title">
  41. </base-filter>
  42. </div>
  43. <div v-if="resourceList.content && resourceList.content.length > 0">
  44. <div class="invoice-btob-list" v-for="item in resourceList.content">
  45. <div class="invoice-btob-wrapper-top">
  46. <span class="read" v-if="!isUnread(item.id)" style="margin-right: 0.3rem">已读</span>
  47. <span class="noread" v-if="isUnread(item.id)" style="margin-right: 0.3rem">未读</span>
  48. <span style="margin-right: 0.3rem">{{item.recordDate | time}}</span>
  49. <span class="isPut" v-if="item.status">已提交</span>
  50. <span class="noPut" v-else>未提交</span>
  51. </div>
  52. <div class="invoice-btob-wrapper-middle">
  53. <div class="invoice-btob-wrapper-middle-title">{{item.vendorName}}</div>
  54. <div @click="lookDetails(item.id)"><span>单据编号:</span><a>{{item.code}}</a></div>
  55. </div>
  56. <div class="invoice-btob-wrapper-content">
  57. <div><span>对账期间:</span>{{item.beginDate | time}} - {{item.endDate | time}}</div>
  58. <div><span>对账金额:</span>{{isUser ? '-' : item.checkAmount}}</div>
  59. <div><span>明细条目:</span>{{item.items && item.items.length}}条</div>
  60. <div><span>对账人:</span>{{item.recorder}}</div>
  61. <!--<div><span>商品总数:</span>{{item.getTotalProd}}</div>-->
  62. <!--<div><span>对账结果:</span>{{item.checkStatus}}</div>-->
  63. </div>
  64. </div>
  65. </div>
  66. <empty-status
  67. v-else
  68. :text="'暂无对账信息'"
  69. :showLink="false"
  70. ></empty-status>
  71. <pull-up :fixId="'btobapCheck-wrapper-scroll'" :allPage="allPage" :page="filterParams.page" @pullUpAction="onPullUpAction"></pull-up>
  72. </div>
  73. </div>
  74. <div v-show="activeType === 'all'">
  75. <div class="search-content mi-search-content">
  76. <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="供应商名称">
  77. <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
  78. </div>
  79. <div class="modal-h">
  80. <div class="timeLine-wrapper clearfix" style="margin-bottom: 0.2rem;">
  81. <div style="margin-left: 0.5rem">
  82. <div class="inline-block left" @click="addMonth('out', 'outTimeMonth', -1)">
  83. <i class="iconfont icon-xiangzuo" style="font-size: 0.3rem"></i>
  84. </div>
  85. <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>
  86. <div class="inline-block right" @click="addMonth('out', 'outTimeMonth', 1)" v-show="MouthOutShow">
  87. <i class="iconfont icon-xiangyou" style="font-size: 0.3rem"></i>
  88. </div>
  89. </div>
  90. <div style="clear:both"></div>
  91. <base-filter
  92. ref="baseFilterTwo"
  93. v-for="filterOption in ApcheckfilterOptions"
  94. :ShowTitle="ShowTitle"
  95. :key="filterOption.selectOption"
  96. :selectItems="filterOption.selectItems"
  97. :defaultVal="filterOption.defaultVal"
  98. :selectOption="filterOption.selectOption"
  99. @selectAction="ApcheckonSelectAction"
  100. @valueAction="ApcheckonValueAction"
  101. :title="filterOption.title">
  102. </base-filter>
  103. </div>
  104. </div>
  105. <div class="btobapCheck-wrapper-scroll btobapCheck-wrapper-scroll2" id="btobapCheck-wrapper-scroll2">
  106. <div v-if="resourceList.content && resourceList.content.length > 0">
  107. <div class="invoice-btob-list" v-for="item in resourceList.content">
  108. <div class="invoice-btob-wrapper-middle" style="border-top: 0">
  109. <div class="invoice-btob-wrapper-middle-title">{{item.vendorEnterprise && item.vendorEnterprise.enName}}</div>
  110. </div>
  111. <div class="invoice-btob-wrapper-middle">
  112. <div>
  113. <span class="inline-block" style="vertical-align: top">本期应付:</span>
  114. <div class="inline-block" style="vertical-align: top" >
  115. <div v-for="count in item.amountDetailList">
  116. <span v-if="count.thisPeriodAmount > 0">{{count.currency}}:{{count.thisPeriodAmount | computeNum(2)}}</span>
  117. <span v-else>{{count.currency}}:暂无数据</span>
  118. </div>
  119. </div>
  120. </div>
  121. <div>
  122. <span class="inline-block" style="vertical-align: top">本期发货:</span>
  123. <div class="inline-block" style="vertical-align: top" >
  124. <div v-for="count in item.amountDetailList">
  125. <span v-if="count.thisPeriodSendQty > 0">{{count.currency}}:{{count.thisPeriodSendQty | computeNum(2)}}</span>
  126. <span v-else>{{count.currency}}:暂无数据</span>
  127. </div>
  128. </div>
  129. </div>
  130. <div>
  131. <span class="inline-block" style="vertical-align: top">本期未对账:</span>
  132. <div class="inline-block" style="vertical-align: top" >
  133. <div v-for="count in item.amountDetailList">
  134. <span v-if="count.thisPeriodTodoAmount > 0">{{count.currency}}:{{count.thisPeriodTodoAmount | computeNum(2)}}</span>
  135. <span v-else>{{count.currency}}:暂无数据</span>
  136. </div>
  137. </div>
  138. </div>
  139. <div>
  140. <span class="inline-block" style="vertical-align: top">本期已对账:</span>
  141. <div class="inline-block" style="vertical-align: top" >
  142. <div v-for="count in item.amountDetailList">
  143. <span v-if="count.thisPeriodDoneAmount > 0">{{count.currency}}:{{count.thisPeriodDoneAmount | computeNum(2)}}</span>
  144. <span v-else>{{count.currency}}:暂无数据</span>
  145. </div>
  146. </div>
  147. </div>
  148. <div>
  149. <span class="inline-block" style="vertical-align: top">本期已付:</span>
  150. <div class="inline-block" style="vertical-align: top" >
  151. <div v-for="count in item.amountDetailList">
  152. <span v-if="count.thisPeriodReceipt > 0">{{count.currency}}:{{count.thisPeriodReceipt | computeNum(2)}}</span>
  153. <span v-else>{{count.currency}}:暂无数据</span>
  154. </div>
  155. </div>
  156. </div>
  157. <div>
  158. <span class="inline-block" style="vertical-align: top">应付总额:</span>
  159. <div class="inline-block" style="vertical-align: top" >
  160. <div v-for="count in item.amountDetailList">
  161. <span v-if="count.totalAmount > 0">{{count.currency}}:{{count.totalAmount | computeNum(2)}}</span>
  162. <span v-else>{{count.currency}}:暂无数据</span>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="invoice-btob-wrapper-middle" @click="showApcheckList(item)">
  168. <div class="middle_btn">明细</div>
  169. </div>
  170. </div>
  171. </div>
  172. <empty-status
  173. v-else
  174. :text="'暂无对账信息'"
  175. :showLink="false"
  176. ></empty-status>
  177. <pull-up :fixId="'btobapCheck-wrapper-scroll2'" :allPage="allPage" :page="filterParams.page" @pullUpAction="onPullUpAction"></pull-up>
  178. </div>
  179. </div>
  180. </div>
  181. <modal-wrapper :title="isShowApcheckList.enName" :showModal="isShowApcheckList.show" @closeAction="deleteCheck" :bgColor="'#f1f3f6'" :hasFooter="true">
  182. <div slot="header" class="modal-h">
  183. <div class="modal-h-top">
  184. <!--<span class="item inline-block" @click="checkAll()" v-show="!isShowApcheckList.showApcheck">-->
  185. <!--<label class="mobile-cart-check" :class="{active: !isCheckAll}"></label>-->
  186. <!--</span>-->
  187. <span class="inline-block overflowhidden">
  188. 应付供应商:{{isShowApcheckList.enName}}
  189. </span>
  190. </div>
  191. <div class="timeLine-wrapper clearfix">
  192. <div v-show="!isShowApcheckList.showApcheck">
  193. <div style="margin-left: 0.5rem">
  194. <div class="inline-block left" @click="addMonth('inside', '', -1)">
  195. <i class="iconfont icon-xiangzuo" style="font-size: 0.3rem"></i>
  196. </div>
  197. <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>
  198. <div class="inline-block right" @click="addMonth('inside', '', 1)" v-show="MouthinShow">
  199. <i class="iconfont icon-xiangyou" style="font-size: 0.3rem"></i>
  200. </div>
  201. </div>
  202. <div style="clear:both"></div>
  203. <base-filter
  204. ref="baseFilter"
  205. v-for="filterOption in ApcheckfilterOptions"
  206. :ShowTitle="ShowTitle"
  207. :key="filterOption.selectOption"
  208. :selectItems="filterOption.selectItems"
  209. :defaultVal="filterOption.defaultVal"
  210. :selectOption="filterOption.selectOption"
  211. @selectAction="ApcheckonSelectAction"
  212. @valueAction="ApcheckonValueAction"
  213. :title="filterOption.title">
  214. </base-filter>
  215. </div>
  216. <div v-show="isShowApcheckList.showApcheck" style="line-height: 1.4rem;text-align: center">
  217. {{isShowApcheckList.startTime}} ~ {{isShowApcheckList.endTime}}
  218. </div>
  219. </div>
  220. <div style="height: 0.2rem; width: 100%;"></div>
  221. <!--<div class="timeLine" @click="ShowMonthChoose('inside')" style="text-indent: 0.12rem">{{isShowApcheckList.thisMonth}}<i class="iconfont icon-arrow-down" style="font-size: 0.3rem"></i></div>-->
  222. <!--<input type="month" v-model="isShowApcheckList.thisMonth" @change="showApcheckList()"/>-->
  223. </div>
  224. <div class="btobapCheck-modal">
  225. <div style="height: 0.2rem; width: 100%;"></div>
  226. <div class="choosescreen-result">
  227. <div v-if="isShowApcheckList.list.length > 0">
  228. <div class="choosescreen-result-lists" v-for="(type, key) in isShowApcheckList.list">
  229. <div class="choosescreen-details">
  230. <!--<span class="item inline-block" @click="checkItem(type, key)" v-show="!isShowApcheckList.showApcheck && !type.allChecked">-->
  231. <!--<label class="mobile-cart-check" :class="{active: type.check}"></label>-->
  232. <!--</span>-->
  233. <div class="inline-block" style="margin-left: 0.15rem">
  234. <div class="OverHidden" style="font-weight: bold;">订单:<span style="color:#3f84f6;">{{type.orderCode}}</span></div>
  235. </div>
  236. </div>
  237. <div class="clearfix choosescreen-result-list" v-for="(item, index) in type.details">
  238. <div>
  239. <div class="choosescreen-result-list-content">
  240. <div class="inline-block" style="margin-left: 0.15rem">
  241. <div class="OverHidden" :class="{'div62': item.haveChecked}">验收单:<span>{{item.inoutno}}</span></div>
  242. <div class="OverHidden" :class="{'div62': item.haveChecked}">发货单:<span>{{item.sendcode}}</span></div>
  243. <div class="OverHidden" :class="{'div62': item.haveChecked}">物料编号:<span>{{item.prodcode}}</span></div>
  244. <div class="OverHidden" :class="{'div62': item.haveChecked}">物料名称:<span>{{item.prodtitle}}</span></div>
  245. <div class="OverHidden" :class="{'div62': item.haveChecked}">规格型号:<span>{{item.prodspec}}</span></div>
  246. <div class="OverHidden" :class="{'div62': item.haveChecked}">发货数量:<span>{{item.qty}}</span></div>
  247. <div class="OverHidden" :class="{'div62': item.haveChecked}">验收数量:<span>{{item.thischeckqty}}</span></div>
  248. <div class="OverHidden" :class="{'div62': item.haveChecked}">单价:<span>{{item.currency}}:{{item.orderprice}}</span></div>
  249. <div class="OverHidden" :class="{'div62': item.haveChecked}">税率:<span>{{item.taxrate}}%</span></div>
  250. <div class="OverHidden clearfix" :class="{'div62': item.haveChecked}" v-if="item.haveChecked === 1">
  251. <div class="pull-left">对账人:<span>{{item.recorder}}</span></div>
  252. <div class="pull-right">已对账</div>
  253. </div>
  254. </div>
  255. </div>
  256. <div class="clearfix" style="border-top:1px solid #D9D9D9;padding: 0 0.15rem;line-height: 0.8rem" >
  257. <div class="fl" style="font-size: 0.26rem">小计:</div>
  258. <div class="fr" style="color: #FF3208;font-size: 0.26rem">{{item.nowmoney | computeNum(2)}}</div>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. </div>
  264. <empty-status
  265. v-else
  266. :text="'暂无对账信息'"
  267. :showLink="false"
  268. ></empty-status>
  269. </div>
  270. </div>
  271. <div slot="footer" class="footerBtn clearfix">
  272. <!--<span class="item inline-block" @click="checkAll()" v-show="!isShowApcheckList.showApcheck">-->
  273. <!--<label class="mobile-cart-check" :class="{active: !isCheckAll}"></label>全选-->
  274. <!--</span>-->
  275. <!--<div class="fr bbgoresult" @click="goTopayfor" v-show="!isShowApcheckList.showApcheck">对账</div>-->
  276. <div class="fr" style="margin-right: 0.2rem" >合计:<a style="color: #001408;">{{allMoney | computeNum}}</a></div>
  277. <!--<div class="fl" style="margin-left: 0.2rem" v-show="isShowApcheckList.showApcheck">合计:<a style="color: #001408;">{{allMoney}}</a></div>-->
  278. <!--<div class="fr bbgoresult" v-show="isShowApcheckList.showApcheck" @click="submitCheck">提交</div>-->
  279. <!--<div class="fr bbgoresult cancel" v-show="isShowApcheckList.showApcheck" @click="deleteCheck">取消</div>-->
  280. </div>
  281. </modal-wrapper>
  282. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  283. <div class="fixedPicker" v-show="isShowMonthChoose">
  284. <picker :slots="slots" @change="onValuesChange" :showToolbar="true" ref="picker">
  285. <div class="titls">选择当前时间</div>
  286. <div class="leftBtn" @click="isShowMonthChoose=false">取消</div>
  287. <div class="rightBtn" @click="resultMonth">确定</div>
  288. </picker>
  289. </div>
  290. </div>
  291. </template>
  292. <script>
  293. import { Picker } from 'mint-ui'
  294. import { ModalWrapper, BaseFilter } from '~components/mobile/base'
  295. import { PullUp, EmptyStatus, RemindBox } from '~components/mobile/common'
  296. function years() {
  297. let _d = new Date()
  298. let _year = Number(_d.getFullYear())
  299. let arr = []
  300. let num = 2000
  301. for (let i = 2000; i < _year; i++) {
  302. num++
  303. arr.push(num + '年')
  304. }
  305. return arr
  306. }
  307. function getMonth() {
  308. let sdateTo = new Date()
  309. // console.log(sdateTo.getMonth() - 1)
  310. if (sdateTo.getMonth() === 0) {
  311. return 11
  312. } else {
  313. return sdateTo.getMonth() - 1
  314. }
  315. }
  316. function getYear() {
  317. let num = 2000
  318. let sdateTo = new Date()
  319. let _year = sdateTo.getFullYear()
  320. for (let i = 0; i < 99; i++) {
  321. num++
  322. if (num === Number(_year)) {
  323. num = i
  324. break
  325. }
  326. }
  327. if (sdateTo.getMonth() === 0) {
  328. return num - 1
  329. } else {
  330. return num
  331. }
  332. }
  333. export default {
  334. layout: 'mobileNoHeader',
  335. middleware: 'authenticated',
  336. data() {
  337. return {
  338. MouthinShow: true,
  339. MouthOutShow: true,
  340. ShowTitle: false,
  341. collectResult: '',
  342. timeoutCount: 0,
  343. isShowMonthChoose: false,
  344. slots: [
  345. {
  346. flex: 1,
  347. values: years(),
  348. className: 'slot1',
  349. textAlign: 'center',
  350. defaultIndex: getYear()
  351. }, {
  352. divider: true,
  353. content: '-',
  354. className: 'slot2'
  355. }, {
  356. flex: 1,
  357. values: ['01月', '02月', '03月', '04月', '05月', '06月', '07月', '08月', '09月', '10月', '11月', '12月'],
  358. className: 'slot3',
  359. textAlign: 'center',
  360. defaultIndex: getMonth()
  361. }
  362. ],
  363. activeType: 'all',
  364. filterParams: {
  365. keyword: '',
  366. page: 1,
  367. count: 10
  368. },
  369. filterOptions: [
  370. {
  371. title: '交易时间',
  372. selectOption: 'date',
  373. selectItems: [{
  374. key: '30天',
  375. val: 1
  376. }, {
  377. key: '90天',
  378. val: 2
  379. }, {
  380. key: '180天',
  381. val: 3
  382. }, {
  383. key: '自定义',
  384. val: 4
  385. }],
  386. defaultVal: 1
  387. }
  388. ],
  389. resourceList: {
  390. content: []
  391. },
  392. isUser: false,
  393. unreadCode: [],
  394. showModal: false,
  395. dateObj: {},
  396. screenObj: {},
  397. outTimeMonth: '',
  398. isShowApcheckList: {
  399. show: false,
  400. enName: '',
  401. thisMonth: '',
  402. list: [],
  403. showApcheck: false,
  404. id: '',
  405. startTime: '',
  406. endTime: '',
  407. objTime: {}
  408. },
  409. ApcheckfilterOptions: [
  410. {
  411. title: '',
  412. selectOption: 'date',
  413. selectItems: [{
  414. key: '自定义',
  415. val: 4
  416. }],
  417. defaultVal: 1
  418. }
  419. ],
  420. ShowApcheckChooseTimeOUT: false,
  421. ShowApcheckChooseTime: false
  422. }
  423. },
  424. created() {
  425. this.$http.get('/btob/account/role/isUser').then(res => {
  426. this.isUser = res.data.isUser
  427. })
  428. this.getUnread()
  429. let sdateTo = new Date()
  430. if (sdateTo.getMonth() === 0) {
  431. let _time = new Date(sdateTo)
  432. _time.setMonth(_time.getMonth())
  433. _time.setDate(1)
  434. // _time.setMonth(_time.getMonth())
  435. _time.setDate(_time.getDate() - 1)
  436. this.isShowApcheckList.thisMonth = _time.getFullYear() + '-' + (_time.getMonth() + 1)
  437. this.outTimeMonth = _time.getFullYear() + '-' + (_time.getMonth() + 1)
  438. } else {
  439. this.isShowApcheckList.thisMonth = sdateTo.getFullYear() + '-' + sdateTo.getMonth()
  440. this.outTimeMonth = sdateTo.getFullYear() + '-' + sdateTo.getMonth()
  441. }
  442. },
  443. // mounted() {
  444. // this.$nextTick(() => {
  445. // this.$refs.picker.change()
  446. // })
  447. // },
  448. methods: {
  449. onValuesChange(picker, value) {
  450. // console.log(picker.getValues())
  451. if (!this.$value) {
  452. picker.setSlotValue(0, '2018年')
  453. picker.setSlotValue(1, '11月')
  454. this.$picker = picker
  455. }
  456. let _ns = value[0].replace('年', '')
  457. let _my = value[1].replace('月', '')
  458. this.$value = _ns + '-' + _my
  459. },
  460. // 选择月份完毕
  461. resultMonth() {
  462. this.isShowMonthChoose = false
  463. if (this.$monthType === 'out') {
  464. let _time2 = this.computedTime(this.$value + '-01')
  465. let _d = this.computedTime(new Date())
  466. if (_time2.getTime() > _d.getTime()) {
  467. this.setRemindText('所选对账日期不能超过当前时间')
  468. return
  469. }
  470. let _sp = new Date()
  471. if (_time2.getTime() >= _sp.getTime()) {
  472. this.MouthOutShow = false
  473. } else {
  474. this.MouthOutShow = true
  475. }
  476. this.$monthClick = true
  477. this.outTimeMonth = this.$value
  478. this.filterParams.page = 1
  479. this.$refs.baseFilterTwo[0].setSelect(1)
  480. this.ShowApcheckChooseTimeOUT = false
  481. this.setSelect('', '', true)
  482. } else {
  483. let _time2 = this.computedTime(this.$value + '-01')
  484. let _d = this.computedTime(new Date())
  485. if (_time2.getTime() > _d.getTime()) {
  486. this.setRemindText('所选对账日期不能超过当前时间')
  487. return
  488. }
  489. let _sp = new Date()
  490. if (_time2.getTime() > _sp.getTime()) {
  491. this.MouthinShow = false
  492. } else {
  493. this.MouthinShow = true
  494. }
  495. this.$monthClick = true
  496. this.isShowApcheckList.thisMonth = this.$value
  497. this.ShowApcheckChooseTime = false
  498. this.$refs.baseFilter[0].setSelect(1)
  499. this.isShowApcheckList.show = true
  500. this.getApcheckDetailsinfo()
  501. }
  502. },
  503. // 立即对账
  504. addApCheck() {
  505. this.showModal = true
  506. },
  507. setRemindText: function (str) {
  508. this.collectResult = str
  509. this.timeoutCount++
  510. },
  511. setDate (type) {
  512. if (this.dateObj[type]) {
  513. // 初始化为00:00:00
  514. this.dateObj[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
  515. // TODO
  516. if (this.dateObj.fromDate && this.dateObj.toDate && this.dateObj.fromDate > this.dateObj.toDate) {
  517. if (type === 'fromDate') {
  518. this.setRemindText('起始时间不能大于结束时间')
  519. } else {
  520. this.setRemindText('结束时间不能小于起始时间')
  521. }
  522. this.dateObj[type] = null
  523. }
  524. // else {
  525. // if (this.dateObj.fromDate && this.dateObj.toDate && this.dateObj.fromDate === this.dateObj.toDate) {
  526. // // 23:59:59
  527. // this.dateObj.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
  528. // }
  529. // }
  530. // 23:59:59
  531. if (this.dateObj.toDate && type === 'toDate') {
  532. this.dateObj.toDate += (23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000)
  533. }
  534. } else {
  535. this.dateObj[type] = null
  536. }
  537. },
  538. toChooseUser() {
  539. console.log('选择客户')
  540. },
  541. onPullUpAction () {
  542. this.filterParams.page++
  543. this.setSelect(this.$selectObj.key, this.$selectObj.value, false)
  544. },
  545. getUnread() {
  546. this.$http.get('/sale/apCheck/unread').then(res => {
  547. this.unreadCode = res.data.content
  548. })
  549. },
  550. lookDetails(id) {
  551. console.log('前往详情并且设置为已读')
  552. // if (!this.isUnread(id)) { } else {
  553. // let sourceId = []
  554. // sourceId.push(id)
  555. // this.$http.post('/sale/tender/setRead', sourceId).then(res => {
  556. // this.getUnread()
  557. // })
  558. // }
  559. },
  560. isUnread: function (id) {
  561. for (let i in this.unreadCode) {
  562. if (id === this.unreadCode[i]) {
  563. return true
  564. }
  565. }
  566. },
  567. ChangeList(tp) {
  568. this.activeType = tp
  569. this.filterParams.page = 1
  570. this.setSelect(this.$selectObj.key, this.$selectObj.value, true)
  571. },
  572. onFilter() {
  573. this.filterParams.page = 1
  574. this.setSelect(this.$selectObj.key, this.$selectObj.value, true)
  575. },
  576. onSelectAction(selectObj) {
  577. this.$selectObj = selectObj
  578. this.setSelect(selectObj.key, selectObj.value, true)
  579. },
  580. onValueAction(selectObj) {
  581. this.$selectObj = selectObj
  582. this.setSelect(selectObj.key, selectObj.value, true)
  583. },
  584. ApcheckonSelectAction(selectObj) {
  585. if (this.$monthClick) return
  586. this.isShowApcheckList.objTime = selectObj
  587. if (this.isShowApcheckList.show) {
  588. this.ShowApcheckChooseTime = true
  589. this.getApcheckDetailsinfo(selectObj.key, selectObj.value)
  590. } else {
  591. this.ShowApcheckChooseTimeOUT = true
  592. this.setSelect(selectObj.key, selectObj.value, true)
  593. }
  594. },
  595. ApcheckonValueAction(selectObj) {
  596. // if (this.$monthClick) return
  597. // this.isShowApcheckList.objTime = selectObj
  598. // this.getApcheckDetailsinfo(selectObj.key, selectObj.value)
  599. },
  600. // B2B未对账
  601. // NotapCheck () {
  602. // console.log('未对账')
  603. // },
  604. // 未对账详情
  605. showApcheckList(item) {
  606. this.isShowApcheckList.show = true
  607. this.isShowApcheckList.amountDetailList = item.amountDetailList
  608. this.isShowApcheckList.vendorUU = item ? item.vendorEnterprise.uu : this.isShowApcheckList.vendorUU
  609. this.isShowApcheckList.enName = item ? item.vendorEnterprise.enName : this.isShowApcheckList.enName
  610. this.isShowApcheckList.thisMonth = this.outTimeMonth
  611. this.getApcheckDetailsinfo()
  612. },
  613. // 未对账详情获取数据
  614. getApcheckDetailsinfo (...objTime) {
  615. if (!this.isShowApcheckList.show) return
  616. let _params = {
  617. params: {
  618. checkDate: this.isShowApcheckList.thisMonth,
  619. vendorUU: this.isShowApcheckList.vendorUU
  620. // suuorname: this.isShowApcheckList.enName
  621. }
  622. }
  623. // 是否打开自定义时间选项 且
  624. if (this.ShowApcheckChooseTime && !this.$monthClick) {
  625. // let _fromDate = new Date(this.outTimeMonth + '-01 00:00:00').getTime()
  626. // let _d = this.computedTime(this.isShowApcheckList.thisMonth).getTime()
  627. _params = {
  628. params: {
  629. fromDate: objTime[1].fromDate,
  630. endDate: objTime[1].toDate,
  631. vendorUU: this.isShowApcheckList.vendorUU
  632. // suuorname: this.isShowApcheckList.enName
  633. }
  634. }
  635. }
  636. this.$http.get('/sale/arCheck/getAllByKeywords', _params).then(res => {
  637. res.data.groupList.forEach(item => {
  638. item.check = true
  639. item.details.forEach(type => {
  640. type.check = true
  641. })
  642. })
  643. this.isShowApcheckList.enName = res.data.vendorName
  644. this.$monthClick = false
  645. this.isShowApcheckList.list = res.data.groupList
  646. this.$nextTick(() => {
  647. this._initscroll()
  648. })
  649. })
  650. },
  651. // 对账全选
  652. checkAll() {
  653. let fl = true
  654. if (this.isCheckAll === 0) {
  655. fl = false
  656. }
  657. this.isShowApcheckList.list.forEach(item => {
  658. item.check = fl
  659. })
  660. },
  661. checkItem(item, index) {
  662. if (item.check) {
  663. item.check = false
  664. } else {
  665. this.$set(this.isShowApcheckList.list[index], 'check', true)
  666. }
  667. },
  668. // 对账按钮
  669. goTopayfor() {
  670. let apCheck = {
  671. custUu: '',
  672. custName: '',
  673. enUu: '',
  674. apDate: '',
  675. beginDate: '',
  676. endDate: '',
  677. checkStatus: '未对账',
  678. checkAmount: 0,
  679. currency: '',
  680. rate: '',
  681. items: [],
  682. taxrate: ''
  683. }
  684. // 保存来源单据相关信息
  685. let sourceInfos = []
  686. // 所允许的本次对账最大最小数量
  687. this.isShowApcheckList.list.maxThisCheckQty = 0
  688. this.isShowApcheckList.list.minThisCheckQty = 0
  689. let sameCust = true
  690. let validQty = true
  691. let _list = []
  692. this.isShowApcheckList.list.forEach((check) => {
  693. // 保存应收对账单明细行数据
  694. let item = {
  695. inoutno: '',
  696. inoutnodetno: '',
  697. orderCode: '',
  698. orderClass: '',
  699. orderDetno: '',
  700. price: '',
  701. checkQty: '',
  702. amount: '',
  703. sourceId: '',
  704. sourceTable: '',
  705. oldYCheckQty: '',
  706. status: 0,
  707. receiveCode: '',
  708. receiveName: '',
  709. prodCode: '',
  710. prodTitle: '',
  711. prodUnit: '',
  712. prodSpec: '',
  713. taxrate: '',
  714. sendcode: '',
  715. whname: '',
  716. custUserUU: ''
  717. }
  718. // 应收对账单明细行来源表信息
  719. let sourceInfo = {
  720. sourceId: '',
  721. sourceTable: '',
  722. newYCheckQty: ''
  723. }
  724. // 此次对账后新的已转数
  725. if (check.check === true && !check.haveChecked) {
  726. _list.push(check)
  727. apCheck.custName = check.custname
  728. apCheck.enUu = check.enuu
  729. apCheck.checkAmount += (check.thischeckqty || 0) * (check.orderprice || 0)
  730. apCheck.apDate = check.pidate
  731. apCheck.rate = check.rate
  732. // 必须是同一家客户才能生成对账单,否则提示错误
  733. if (apCheck.custUu === '') {
  734. apCheck.custUu = check.custuu
  735. } else if (apCheck.custUu !== check.custuu) {
  736. sameCust = false
  737. this.setRemindText('请选择同一家客户')
  738. }
  739. // 必须是相同币别才能生成对账单,否则提示错误
  740. if (apCheck.currency === '') {
  741. apCheck.currency = check.currency
  742. } else if (apCheck.currency !== check.currency) {
  743. sameCust = false
  744. this.setRemindText('请选择同一种币别')
  745. }
  746. let re = /^[0-9]+.?[0-9]*$/
  747. // 必须是相同税率才能生成对账单,否则提示错误
  748. if (!re.test(apCheck.taxrate)) {
  749. // if (!angular.isNumber(apCheck.taxrate)) {
  750. apCheck.taxrate = check.taxrate
  751. } else if (apCheck.taxrate !== check.taxrate) {
  752. sameCust = false
  753. this.setRemindText('请选择相同的税率')
  754. }
  755. // 本次对账数量必须小于总对账数量
  756. if (check.qty > 0) {
  757. this.isShowApcheckList.list.maxThisCheckQty = check.qty
  758. this.isShowApcheckList.list.minThisCheckQty = 0
  759. if (check.qty - (check.ycheckqty || 0) < check.thischeckqty || check.thischeckqty < 0 || check.thischeckqty === 0) {
  760. validQty = false
  761. this.setRemindText('本次对账数量,填写有误!')
  762. }
  763. } else if (check.qty < 0) {
  764. this.isShowApcheckList.list.maxThisCheckQty = 0
  765. this.isShowApcheckList.list.minThisCheckQty = check.qty
  766. if (((-check.qty) - (-check.ycheckqty) < (-check.thischeckqty)) || check.thischeckqty > 0 || check.thischeckqty === 0) {
  767. validQty = false
  768. this.setRemindText('本次对账数量,填写有误!')
  769. }
  770. }
  771. // todo
  772. if (this.ShowApcheckChooseTime) {
  773. let _time1 = this.isShowApcheckList.objTime.value.fromDate
  774. _time1 = _time1.replace(/-/g, '/')
  775. let _start = new Date(_time1)
  776. let _time2 = this.isShowApcheckList.objTime.value.fromDate
  777. _time2 = _time2.replace(/-/g, '/')
  778. let _end = new Date(_time2)
  779. // 获取筛选时间的开始时间为对账的开始时间
  780. apCheck.beginDate = _start.getTime()
  781. // 获取筛选的截止时间为对账的截止时间
  782. apCheck.endDate = _end.getTime()
  783. } else {
  784. this.isShowApcheckList.startTime = this.isShowApcheckList.thisMonth + '-01'
  785. let _time1 = this.isShowApcheckList.startTime
  786. _time1 = _time1.replace(/-/g, '/')
  787. let _d = new Date(_time1)
  788. _d.setDate(1)
  789. _d.setMonth(_d.getMonth() + 1)
  790. _d.setDate(_d.getDate() - 1)
  791. // 获取筛选时间的开始时间为对账的开始时间
  792. let _time2 = this.isShowApcheckList.startTime
  793. _time2 = _time2.replace(/-/g, '/')
  794. apCheck.beginDate = new Date(_time2).getTime()
  795. // 获取筛选的截止时间为对账的截止时间
  796. apCheck.endDate = _d.getTime()
  797. }
  798. // 应收对账单明细行数据
  799. item.orderCode = check.ordercode
  800. item.orderClass = check.piclass
  801. item.orderDetno = check.orderdetno
  802. item.price = check.orderprice
  803. item.checkQty = check.thischeckqty
  804. item.amount = (check.thischeckqty || 0) * (check.orderprice || 0)
  805. item.sourceId = check.sourceid
  806. item.sourceTable = check.sourcetable
  807. item.oldYCheckQty = check.ycheckqty
  808. item.prodCode = check.prodcode
  809. item.prodTitle = check.prodtitle
  810. item.prodSpec = check.prodspec
  811. item.prodUnit = check.produnit
  812. item.inoutno = check.inoutno
  813. item.inoutnodetno = check.detno
  814. item.taxrate = check.taxrate
  815. item.receiveCode = check.receivecode
  816. item.receiveName = check.receivename
  817. item.sendcode = check.sendcode
  818. item.whname = check.whname
  819. item.custUserUU = check.custuseruu
  820. // 来源表相关信息
  821. sourceInfo.sourceid = check.sourceid
  822. sourceInfo.sourcetable = check.sourcetable
  823. sourceInfo.newYCheckQty = ((check.ycheckqty || 0) + check.thischeckqty)
  824. sourceInfos.push(sourceInfo)
  825. apCheck.items.push(item)
  826. // haveSelected = true
  827. // 如果是同一家客户,生成对账单的同时,关闭模态框
  828. }
  829. })
  830. if (sameCust && validQty) {
  831. this.isShowApcheckList.list = _list
  832. this.saveApCheck(apCheck)
  833. }
  834. },
  835. // 对账提交
  836. saveApCheck(apCheck) {
  837. if (apCheck.items.length === 0) {
  838. this.setRemindText('请先选择需要对账的数据')
  839. } else {
  840. this.$http.post('/sale/apCheck/operation/save', apCheck).then(res => {
  841. this.setRemindText('生成应收对账成功')
  842. this.isShowApcheckList.id = res.data.id
  843. this.isShowApcheckList.showApcheck = true
  844. if (this.ShowApcheckChooseTime) {
  845. let _time1 = this.isShowApcheckList.objTime.value.fromDate
  846. _time1 = _time1.replace(/-/g, '/')
  847. let _start = new Date(_time1)
  848. let _time2 = this.isShowApcheckList.objTime.value.toDate
  849. _time2 = _time1.replace(/-/g, '/')
  850. let _end = new Date(_time2)
  851. this.isShowApcheckList.startTime = _start.getFullYear() + '-' + (_start.getMonth() + 1) + '-' + _start.getDate()
  852. this.isShowApcheckList.endTime = _end.getFullYear() + '-' + (_end.getMonth() + 1) + '-' + _end.getDate()
  853. } else {
  854. this.isShowApcheckList.startTime = this.outTimeMonth + '-01'
  855. let _d = this.computedTime(this.isShowApcheckList.startTime)
  856. this.isShowApcheckList.endTime = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate()
  857. }
  858. this.ShowApcheckChooseTime = false
  859. }, err => {
  860. this.setRemindText('生成对账单失败')
  861. })
  862. }
  863. },
  864. // 提交对账单
  865. submitCheck() {
  866. this.$http.post('sale/apCheck/operation/updateStatus?id=' + this.isShowApcheckList.id).then(res => {
  867. this.setRemindText('新增成功')
  868. this.isShowApcheckList.showApcheck = false
  869. this.isShowApcheckList.show = false
  870. this.isShowApcheckList.id = ''
  871. })
  872. },
  873. // 删除对账单
  874. deleteCheck() {
  875. if (this.isShowApcheckList.id === '') {
  876. this.isShowApcheckList.showApcheck = false
  877. this.isShowApcheckList.show = false
  878. this.isShowApcheckList.id = ''
  879. return
  880. }
  881. this.$http.post('/sale/apCheck/operation/deleteApCheck?id=' + this.isShowApcheckList.id, {}).then(res => {
  882. this.isShowApcheckList.showApcheck = false
  883. this.isShowApcheckList.show = false
  884. this.isShowApcheckList.id = ''
  885. let sourceInfos = []
  886. this.isShowApcheckList.list.forEach(item => {
  887. let sourceInfo = {
  888. sourceId: '',
  889. sourceTable: '',
  890. newYCheckQty: ''
  891. }
  892. sourceInfo.sourceId = item.sourceid
  893. sourceInfo.sourceTable = item.sourcetable
  894. sourceInfo.newYCheckQty = item.oldYCheckQty
  895. sourceInfos.push(sourceInfo)
  896. })
  897. this.$http.post('/sale/apCheck/update', sourceInfos).then(res => {})
  898. }, err => {
  899. this.setRemindText(err.response.data)
  900. })
  901. },
  902. // 月份+1
  903. addMonth(tp, key, val) {
  904. if (tp === 'inside') {
  905. let _sp = new Date()
  906. this.ShowApcheckChooseTime = false
  907. this.$monthClick = true
  908. let _d = this.computedTime(this.isShowApcheckList.thisMonth + '-01', val)
  909. let _m = Number(_d.getMonth() + 1) < 10 ? '0' + (_d.getMonth() + 1) : (_d.getMonth() + 1)
  910. this.isShowApcheckList.thisMonth = _d.getFullYear() + '-' + _m
  911. if (_d.getTime() >= _sp.getTime()) {
  912. this.MouthinShow = false
  913. } else {
  914. this.MouthinShow = true
  915. }
  916. this.$refs.baseFilter[0].setSelect(1)
  917. this.isShowApcheckList.show = true
  918. this.getApcheckDetailsinfo()
  919. } else {
  920. let _sp = new Date()
  921. this.$monthClick = true
  922. let _d = this.computedTime(this[key] + '-01', val)
  923. let _m = Number(_d.getMonth() + 1) < 10 ? '0' + (_d.getMonth() + 1) : (_d.getMonth() + 1)
  924. this[key] = _d.getFullYear() + '-' + _m
  925. if (_d.getTime() >= _sp.getTime()) {
  926. this.MouthOutShow = false
  927. } else {
  928. this.MouthOutShow = true
  929. }
  930. this.filterParams.page = 1
  931. this.$refs.baseFilterTwo[0].setSelect(1)
  932. this.ShowApcheckChooseTimeOUT = false
  933. this.setSelect('', '', true)
  934. }
  935. },
  936. computedTime(num, val) {
  937. if ((typeof num === 'object') && num.constructor === Date) {} else {
  938. num = num.replace(/-/g, '/')
  939. }
  940. let _d = new Date(num)
  941. if (val !== undefined) {
  942. _d.setMonth(_d.getMonth() + val)
  943. }
  944. _d.setDate(1)
  945. _d.setMonth(_d.getMonth() + 1)
  946. _d.setDate(_d.getDate() - 1)
  947. return _d
  948. },
  949. async setSelect(...val) {
  950. let _url = '/purchase/arCheck'
  951. let itemL = {}
  952. if (this.activeType === 'all') {
  953. _url = '/sale/arCheck/vendor'
  954. if (!this.ShowApcheckChooseTimeOUT) {
  955. let _fromDate = this.outTimeMonth + '-01 00:00:00'
  956. let _d = this.computedTime(_fromDate)
  957. let _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
  958. _endDate = _endDate.replace(/-/g, '/')
  959. _endDate = new Date(_endDate).getTime()
  960. _fromDate = _fromDate.replace(/-/g, '/')
  961. _fromDate = new Date(_fromDate).getTime()
  962. itemL = {
  963. params: {
  964. count: 20,
  965. page: this.filterParams.page,
  966. keyword: this.filterParams.keyword,
  967. searchFilter: { 'fromDate': _fromDate, 'endDate': _endDate },
  968. sorting: { 'recordDate': 'desc' }
  969. }
  970. }
  971. } else {
  972. itemL = {
  973. params: {
  974. count: 20,
  975. page: this.filterParams.page,
  976. keyword: this.filterParams.keyword,
  977. searchFilter: { 'fromDate': val[1].fromDate, 'endDate': val[1].toDate },
  978. sorting: { 'recordDate': 'desc' }
  979. }
  980. }
  981. }
  982. } else {
  983. itemL = {
  984. params: {
  985. count: this.filterParams.count,
  986. page: this.filterParams.page,
  987. searchFilter: {'keyword': this.filterParams.keyword || '', 'fromDate': val[1].fromDate, 'endDate': val[1].toDate},
  988. sorting: {'recordDate': 'desc'},
  989. _state: this.activeType
  990. }
  991. }
  992. }
  993. let { data } = await this.$http.get(_url, itemL)
  994. if (!this.resourceList.content) {
  995. this.resourceList.content = []
  996. }
  997. data.content = data.content || []
  998. if (this.activeType !== 'all') {
  999. data.content.forEach(item => {
  1000. item.checkAmount = item.checkAmount.toFixed(2)
  1001. item.getTotalProd = 0
  1002. item.items.forEach(im => {
  1003. item.getTotalProd += im.checkQty
  1004. })
  1005. })
  1006. } else {
  1007. data.content.forEach((item) => {
  1008. let _mouthArr = []
  1009. let _totalArr = []
  1010. item.thisMonthCount && item.thisMonthCount.forEach(count => {
  1011. if (count.amount > 0) {
  1012. _mouthArr.push(count)
  1013. }
  1014. })
  1015. item.totalCount && item.totalCount.forEach(count => {
  1016. if (count.amount > 0) {
  1017. _totalArr.push(count)
  1018. }
  1019. })
  1020. item.totalCount = _totalArr
  1021. item.thisMonthCount = _mouthArr
  1022. })
  1023. console.log(data.content)
  1024. }
  1025. if (!val[2]) {
  1026. this.resourceList.content.push(...data.content)
  1027. data.content = this.resourceList.content
  1028. } else {
  1029. this.resourceList.content = []
  1030. }
  1031. this.$monthClick = false
  1032. this.resourceList = data
  1033. },
  1034. // 选择月份
  1035. ShowMonthChoose(tp, key) {
  1036. this.$monthType = tp
  1037. if (tp === 'inside') {
  1038. this.ShowApcheckChooseTime = false
  1039. this.$monthClick = true
  1040. this.$refs.baseFilter[0].setSelect(1)
  1041. let _m = this.isShowApcheckList.thisMonth.split('-')[1].length < 2 ? '0' + this.isShowApcheckList.thisMonth.split('-')[1] : this.isShowApcheckList.thisMonth.split('-')[1]
  1042. this.$picker.setSlotValue(0, this.isShowApcheckList.thisMonth.split('-')[0] + '年')
  1043. this.$picker.setSlotValue(1, _m + '月')
  1044. } else {
  1045. this.ShowApcheckChooseTimeOUT = false
  1046. this.$monthClick = true
  1047. let _m = this[key].split('-')[1].length < 2 ? '0' + this[key].split('-')[1] : this[key].split('-')[1]
  1048. this.$picker.setSlotValue(0, this[key].split('-')[0] + '年')
  1049. this.$picker.setSlotValue(1, _m + '月')
  1050. }
  1051. this.isShowMonthChoose = true
  1052. }
  1053. },
  1054. computed: {
  1055. allPage () {
  1056. return Math.ceil(this.resourceList.totalElement / 10)
  1057. },
  1058. isEmpty () {
  1059. return this.resourceList.content.length === 0
  1060. },
  1061. allMoney() {
  1062. let sum = 0
  1063. this.isShowApcheckList.list.forEach(obj => {
  1064. obj.details.forEach(childObj => {
  1065. sum += childObj.nowmoney
  1066. })
  1067. })
  1068. return sum
  1069. },
  1070. isCheckAll() {
  1071. if (this.isShowApcheckList.list.length === 0) {
  1072. return true
  1073. }
  1074. return this.isShowApcheckList.list.filter(item => {
  1075. return item.check === false
  1076. }).length
  1077. }
  1078. },
  1079. components: {
  1080. ModalWrapper,
  1081. BaseFilter,
  1082. PullUp,
  1083. EmptyStatus,
  1084. Picker,
  1085. RemindBox
  1086. },
  1087. filters: {
  1088. time: function (time) {
  1089. if (typeof time === 'number') {
  1090. if (!time) {
  1091. return '无'
  1092. } else {
  1093. let d = new Date(time)
  1094. let year = d.getFullYear()
  1095. let month = d.getMonth() + 1
  1096. let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  1097. return year + '-' + month + '-' + day
  1098. }
  1099. }
  1100. },
  1101. computeNum: function(price, num) {
  1102. return Math.floor(price * 100) / 100
  1103. }
  1104. }
  1105. }
  1106. </script>
  1107. <style lang="scss" scoped>
  1108. @mixin overFlowHidden {
  1109. overflow: hidden;
  1110. text-overflow: ellipsis;
  1111. white-space: nowrap;
  1112. }
  1113. .fixedPicker {
  1114. position: fixed;
  1115. bottom: 0;
  1116. left: 0;
  1117. width: 100%;
  1118. height: 100%;
  1119. z-index: 9999;
  1120. background: rgba(0,0,0,0.5);
  1121. .picker {
  1122. width: 100%;
  1123. left: 0;
  1124. bottom: 0;
  1125. position: absolute;
  1126. background: #fff;
  1127. }
  1128. .titls {
  1129. text-align: center;
  1130. font-size: 0.24rem;
  1131. line-height: 0.5rem
  1132. }
  1133. .leftBtn {
  1134. color: #666;
  1135. font-size: 0.24rem;
  1136. position: absolute;
  1137. left: 0.2rem;
  1138. top: 0.1rem
  1139. }
  1140. .rightBtn {
  1141. top: 0.1rem;
  1142. color: #3e82f5;
  1143. font-size: 0.24rem;
  1144. position: absolute;
  1145. right: 0.2rem;
  1146. }
  1147. }
  1148. .mobile-header{
  1149. position: fixed;
  1150. top: 0;
  1151. z-index: 100;
  1152. width:100%;
  1153. height: 1.26rem;
  1154. line-height: 1.26rem;
  1155. /*border-bottom:.01rem solid #ccc;*/
  1156. background: #3e82f5;
  1157. padding:0 .2rem 0 .1rem;
  1158. color:#fff;
  1159. }
  1160. .mobile-header p{
  1161. overflow: hidden;
  1162. text-overflow: ellipsis;
  1163. white-space: nowrap;
  1164. font-size:.36rem;
  1165. text-align: center;
  1166. width: 6rem;
  1167. padding-left: 1rem;
  1168. }
  1169. .mobile-center-header p.en-name {
  1170. font-size: .3rem;
  1171. }
  1172. .mobile-header a{
  1173. font-size:.28rem;
  1174. color:#fff;
  1175. position: absolute;
  1176. }
  1177. .mobile-header a i{
  1178. font-size: .48rem;
  1179. margin-right: -.1rem;
  1180. }
  1181. .mobile-header p span {
  1182. position: absolute;
  1183. right: .4rem;
  1184. font-size: .28rem;
  1185. }
  1186. .mobile-header p span i {
  1187. font-size: .28rem;
  1188. }
  1189. .btobapCheck-wrapper {
  1190. background: #f1f3f6;
  1191. margin: 1.26rem 0 0.98rem 0;
  1192. .search-content {
  1193. padding: .24rem 0;
  1194. text-align: center;
  1195. background: #f1f3f6;
  1196. input {
  1197. width: 6.48rem;
  1198. height: .58rem;
  1199. line-height: .58rem;
  1200. border-radius: .14rem;
  1201. margin: 0 0 0 .11rem;
  1202. font-size: .26rem;
  1203. padding: 0 .71rem 0 .21rem;
  1204. border: 1px solid #3f84f6;
  1205. }
  1206. }
  1207. .order-tab {
  1208. background: #3f84f6;
  1209. padding-bottom: 0.2rem;
  1210. .order-tab-wrapper {
  1211. border: solid 1px #ffffff;
  1212. width: 7.06rem;
  1213. margin: 0 auto;
  1214. border-radius: 0.04rem;
  1215. line-height: 0.72rem;
  1216. height: 0.72rem;
  1217. overflow: hidden;
  1218. div {
  1219. color: #ffffff;
  1220. font-size: 0.28rem;
  1221. text-align: center;
  1222. width: 50%;
  1223. &.active {
  1224. background-color: #ffffff;
  1225. color: #3f84f6;
  1226. }
  1227. }
  1228. }
  1229. }
  1230. .order-nav {
  1231. background: #fff;
  1232. div {
  1233. height: 0.82rem;
  1234. line-height: 0.82rem;
  1235. display: inline-block;
  1236. width: 49%;
  1237. text-align: center;
  1238. font-size: .28rem;
  1239. color: #666;
  1240. &.active span{
  1241. color: #3f84f6;
  1242. border-bottom: 0.04rem solid #3f84f6;
  1243. padding-bottom: 0.2rem;
  1244. }
  1245. }
  1246. }
  1247. .btobapCheck-wrapper-scroll {
  1248. height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem);
  1249. overflow-y: auto;
  1250. &.btobapCheck-wrapper-scroll2 {
  1251. height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem - 1.6rem);
  1252. }
  1253. }
  1254. .filter-wrapper{
  1255. width: 7.1rem;
  1256. margin: 0 auto 0.27rem;
  1257. background: #fff;
  1258. padding: 0.27rem 0.2rem;
  1259. border-radius: 0.05rem;
  1260. }
  1261. .invoice-btob-list {
  1262. width: 7.1rem;
  1263. margin: 0 auto 0.2rem;
  1264. background: #FFFFFF;
  1265. border-radius: 0.05rem;
  1266. padding: 0 0.24rem;
  1267. }
  1268. .invoice-btob-wrapper-top {
  1269. height: 0.8rem;
  1270. span{
  1271. margin-top: 0.24rem;
  1272. display: inline-block;
  1273. font-size: 0.28rem;
  1274. color: #333333;
  1275. height:0.25rem;
  1276. &.read {
  1277. color: #15B262;
  1278. }
  1279. &.noread {
  1280. color: #DE4545;
  1281. }
  1282. &.isPut {
  1283. background: #15B262;
  1284. color: #FFFFFF;
  1285. font-size: 0.24rem;
  1286. border-radius: 0.04rem;
  1287. }
  1288. &.noPut {
  1289. font-size: 0.24rem;
  1290. background: #DE4545;
  1291. color: #FFFFFF;
  1292. border-radius: 0.04rem;
  1293. }
  1294. }
  1295. }
  1296. .invoice-btob-wrapper-middle {
  1297. border-top: 1px solid #D9D9D9;
  1298. @include overFlowHidden();
  1299. padding-top: 0.15rem;
  1300. font-size: 0.28rem;
  1301. color: #151515;
  1302. line-height: 0.5rem;
  1303. padding-bottom: 0.15rem;
  1304. span {
  1305. color: #666666;
  1306. }
  1307. .invoice-btob-wrapper-middle .tilte{
  1308. color: #333333;
  1309. }
  1310. .middle_btn {
  1311. text-align: center;
  1312. font-size: 0.26rem;
  1313. color: #333333;
  1314. }
  1315. }
  1316. .invoice-btob-wrapper-content {
  1317. border-top: 1px solid #D9D9D9;
  1318. @include overFlowHidden();
  1319. padding-top: 0.15rem;
  1320. font-size: 0.28rem;
  1321. color: #151515;
  1322. line-height: 0.5rem;
  1323. padding-bottom: 0.15rem;
  1324. span {
  1325. color: #666666;
  1326. }
  1327. }
  1328. }
  1329. .btobapCheck-modal {
  1330. .search-content input {border: 1px solid #3f84f6;}
  1331. .date-wrap{
  1332. text-align: center;
  1333. display: inline-block;
  1334. label {
  1335. width: 2.3rem;
  1336. height: .5rem;
  1337. line-height: .5rem;
  1338. border-radius: .04rem;
  1339. border: 1px solid #bfbfbf;
  1340. background: url(/images/mobile/select-arrow.png) no-repeat;
  1341. background-size: .12rem .06rem;
  1342. vertical-align: middle;
  1343. background-color: #fff;
  1344. background-position: 2.1rem .2rem;
  1345. position: relative;
  1346. margin: .2rem 0 0 0;
  1347. i {
  1348. font-size: .28rem;
  1349. color: #3f84f6;
  1350. margin-left: .1rem;
  1351. float: left;
  1352. }
  1353. input {
  1354. opacity: 0;
  1355. width: 2.22rem;
  1356. height: .5rem;
  1357. position: absolute;
  1358. left: 0;
  1359. z-index: 1;
  1360. }
  1361. p {
  1362. font-weight: normal;
  1363. font-size: .22rem;
  1364. color: #3E81F6;
  1365. text-align: left;
  1366. text-indent: 10px;
  1367. }
  1368. }
  1369. span {
  1370. color: #a0a0a0;
  1371. margin: 0.3rem .05rem 0;
  1372. width: .3rem;
  1373. display: inline-block;
  1374. text-align: center;
  1375. vertical-align: top;
  1376. }
  1377. }
  1378. .choosescreen {
  1379. padding: 0 0.15rem;
  1380. font-size: 0.28rem;
  1381. color: #418DF6;
  1382. line-height: 0.52rem;
  1383. i {
  1384. font-size: 0.28rem;
  1385. }
  1386. }
  1387. .choosescreen-list {
  1388. margin: 0 0.15rem;
  1389. padding-bottom: 0.28rem;;
  1390. border-bottom: 1px solid #D9D9D9;
  1391. div {
  1392. line-height: 0.76rem;
  1393. span {
  1394. font-size: 0.28rem;
  1395. color: #666666;
  1396. display: inline-block;
  1397. width: 1.68rem;
  1398. }
  1399. input {
  1400. height: 0.5rem;
  1401. line-height: 0.5rem;
  1402. width: 4.44rem;
  1403. margin-left: 0.18rem;
  1404. font-size: 0.28rem;
  1405. color: #333;
  1406. border: 1px solid #AEAEAE;
  1407. text-indent: 0.12rem;
  1408. }
  1409. }
  1410. }
  1411. .choosescreen-result {
  1412. .choosescreen-result-list {
  1413. /*padding: 0 0.15rem 0rem;*/
  1414. background: #fff;
  1415. margin:0 0 0.2rem;
  1416. }
  1417. .choosescreen-details{
  1418. background: #fff;
  1419. border-bottom: 1px solid rgb(211, 211, 211);
  1420. padding: .2rem;
  1421. }
  1422. .choosescreen-result-list-content {
  1423. /*display: inline-block;*/
  1424. vertical-align: middle;
  1425. margin: 0 0.15rem;
  1426. div.OverHidden {
  1427. @include overFlowHidden();
  1428. width: 5.5rem;
  1429. }
  1430. padding-top: 0.15rem;
  1431. font-size: 0.28rem;
  1432. color: #151515;
  1433. line-height: 0.5rem;
  1434. padding-bottom: 0.15rem;
  1435. span {
  1436. color: #666666;
  1437. }
  1438. }
  1439. }
  1440. }
  1441. .timeLine-wrapper {
  1442. background: #fff;
  1443. border-radius: 0.05rem;
  1444. height: 1.1rem;
  1445. width: 7.1rem;
  1446. margin: 0 auto 0.2rem;
  1447. padding: 0.3rem 0 0 2rem;
  1448. position: relative;
  1449. .left {
  1450. background: #fff;
  1451. color: #333;
  1452. padding: 0rem 0.1rem;
  1453. /*box-shadow: 0 0 2px #a0a0a0;*/
  1454. text-align: center;
  1455. margin-right: 0.2rem;
  1456. height: 0.5rem;
  1457. line-height: 0.5rem;
  1458. border: 1px solid #BFBFBF;
  1459. }
  1460. .right {
  1461. text-align: center;
  1462. background: #fff;
  1463. color: #333;
  1464. padding: 0rem 0.1rem;
  1465. /*box-shadow: 0 0 2px #a0a0a0;*/
  1466. margin-left: 0.2rem;
  1467. height: 0.5rem;
  1468. line-height: 0.5rem;
  1469. border: 1px solid #BFBFBF;
  1470. }
  1471. .rightBtn {
  1472. margin: 0.1rem 0.2rem 0 0;
  1473. }
  1474. }
  1475. .modal-h {
  1476. background: #F3F3F3;
  1477. .modal-h-top {
  1478. padding: 0.15rem;
  1479. }
  1480. .overflowhidden {
  1481. @include overFlowHidden();
  1482. width: 5.9rem;
  1483. font-size: 0.28rem;
  1484. color: #333333;
  1485. margin-left: 0.1rem;
  1486. }
  1487. .timeLine-wrapper {
  1488. width: 100%;
  1489. padding: 0.1rem 0 0.1rem 0rem;
  1490. height: 1.4rem;
  1491. margin: 0
  1492. }
  1493. }
  1494. div.timeLine {
  1495. background: #FFFFFF;
  1496. border: 1px solid #BFBFBF;
  1497. border-radius: 4px;
  1498. font-size: 0.28rem;
  1499. color: #3E81F6;
  1500. width: 1.7rem;
  1501. display: inline-block;
  1502. height: 0.5rem;
  1503. line-height: 0.5rem
  1504. }
  1505. .footerBtn {
  1506. padding: 0 0 0 0.15rem;
  1507. height: 1rem;
  1508. line-height: 1rem;
  1509. background: #fff;
  1510. font-size: 0.26rem;
  1511. color: #666666;
  1512. border-top: 1px solid #D3D3D3;
  1513. .bbgoresult {
  1514. background: #008BF7;
  1515. color: #fff;
  1516. width: 1.3rem;
  1517. text-align: center;
  1518. }
  1519. .cancel {
  1520. background: #fff;
  1521. color: #333;
  1522. height: 0.98rem;
  1523. }
  1524. }
  1525. </style>