btobapCheck.vue 56 KB

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