btobarCheck.vue 53 KB

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