btobarCheck.vue 54 KB

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