btobapCheck.vue 57 KB

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