btobapCheck.vue 57 KB

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