btobarCheck.vue 55 KB

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