index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <div class="order-wrapper">
  3. <div class="order-tab">
  4. <div class="order-tab-wrapper clearfix">
  5. <nuxt-link class="fl tab" to="/mobile/center/vendor/sample" tag="div" >
  6. 客户打样申请
  7. </nuxt-link>
  8. <div class="fl active tab">客户认定单</div>
  9. </div>
  10. </div>
  11. <div class="order-nav">
  12. <div :class="activeType === 'all' ? 'active': ''" @click="ChangeList('all')"><span>全部</span></div>
  13. <div :class="activeType === 'agreed' ? 'active': ''" @click="ChangeList('agreed')"><span>合格</span></div>
  14. <div :class="activeType === 'refused' ? 'active' : ''" @click="ChangeList('refused')"><span>不合格</span></div>
  15. </div>
  16. <div class="search-content search-content2">
  17. <input type="text" placeholder="单据编号/客户名称/物料名称" v-model="keyword" @keyup.13="searchOrderlist">
  18. <span @click="searchOrderlist">
  19. <i class="iconfont icon-sousuo"></i>
  20. </span>
  21. </div>
  22. <div class="filters-wrap">
  23. <base-filter
  24. v-for="filterOption in filterOptions"
  25. :key="filterOption.selectOption"
  26. :selectItems="filterOption.selectItems"
  27. :defaultVal="filterOption.defaultVal"
  28. :selectOption="filterOption.selectOption"
  29. @selectAction="onSelectAction"
  30. @valueAction="onValueAction"
  31. :title="filterOption.title">
  32. </base-filter>
  33. </div>
  34. <ul class="order-list-wrap" id="b2border-wrapper" v-show="orderList.length > 0">
  35. <li v-for="item in orderList">
  36. <div class="list-title">
  37. <span>{{item.inDate | timeDay}}</span>
  38. <span class="leave-active" v-if="item.finalresult && item.finalresult === '合格'"><i class="fa fa-legal"></i>合格</span>
  39. <span class="over-active" v-if="!item.finalresult || item.finalresult !== '合格'"><i class="fa fa-legal"></i>不合格</span>
  40. </div>
  41. <div class="list-content">
  42. <div class="item">
  43. {{item.enterprise.enName}}
  44. </div>
  45. <div class="item">
  46. <span>单号:</span>
  47. <label v-html="item.code" style="color: #3F84F6;font-weight: 500"></label>
  48. </div>
  49. </div>
  50. <div class="list-content">
  51. <div class="item">
  52. <span>物料型号:</span>
  53. <label v-html="item.prodCode || '-'" style="color: #333;font-weight: 500"></label>
  54. </div>
  55. <div class="item">
  56. <span>物料名称:</span>
  57. <label v-html="item.prodDetail || '-'" style="color: #333;font-weight: 500"></label>
  58. </div>
  59. <div class="item">
  60. <span>物料规格:</span>
  61. <label v-html="item.prodSpec || '-'" style="color: #333;font-weight: 500"></label>
  62. </div>
  63. <div class="item">
  64. <span>样品数量:</span>
  65. <label v-html="item.prodUnit || '-'" style="color: #333;font-weight: 500"></label>
  66. </div>
  67. <div class="item">
  68. <span>申请单:</span>
  69. <label v-html="item.pscode" style="color: #333;font-weight: 500"></label>
  70. </div>
  71. <!--<div class="item">-->
  72. <!--<span>附件:</span>-->
  73. <!--<label v-html="item.code" style="color: #333;font-weight: 500"></label>-->
  74. <!--</div>-->
  75. <div class="item">
  76. <span>最终认定:</span>
  77. <label v-html="item.finalresultremark || '-'" style="color: #333;font-weight: 500"></label>
  78. </div>
  79. <div class="item">
  80. <span>材料:</span>
  81. <label v-html="item.material || '-'" style="color: #333;font-weight: 500"></label>
  82. </div>
  83. <div class="item">
  84. <span>材质:</span>
  85. <label v-html="item.materialquality || '-'" style="color: #333;font-weight: 500"></label>
  86. </div>
  87. <div class="item">
  88. <span>单重:</span>
  89. <label style="color: #333;font-weight: 500">{{item.height || '-'}}g</label>
  90. </div>
  91. </div>
  92. <!--<div class="list-content">-->
  93. <!--<div class="item">-->
  94. <!--<span>研发认定</span>-->
  95. <!--<label v-html="item.height || '-'" style="color: #333;font-weight: 500"></label>-->
  96. <!--</div>-->
  97. <!--<div class="item">-->
  98. <!--<span>IQC认定</span>-->
  99. <!--<label v-html="item.height || '-'" style="color: #333;font-weight: 500"></label>-->
  100. <!--</div>-->
  101. <!--<div class="item">-->
  102. <!--<span>工程认定</span>-->
  103. <!--<label v-html="item.height || '-'" style="color: #333;font-weight: 500"></label>-->
  104. <!--</div>-->
  105. <!--</div>-->
  106. </li>
  107. </ul>
  108. <div v-if="orderList.length === 0" class="com-none-state">
  109. <img src="/images/mobile/@2x/search-empty.png">
  110. <p>抱歉,暂无订单消息</p>
  111. <nuxt-link to="/">返回首页</nuxt-link>
  112. </div>
  113. <pull-up :fixId="'b2border-wrapper'"
  114. :allPage="allPage"
  115. :page="page"
  116. :FixedEl="true"
  117. @pullUpAction="getMoreSearch"></pull-up>
  118. </div>
  119. </template>
  120. <script>
  121. import { RemindBox, PullUp } from '~components/mobile/common'
  122. import { ModalWrapper, BaseFilter } from '~components/mobile/base'
  123. export default {
  124. name: 'sample',
  125. layout: 'mobile',
  126. middleware: 'authenticated',
  127. data() {
  128. return {
  129. filterOptions: [
  130. {
  131. title: '交易时间',
  132. selectOption: 'date',
  133. selectItems: [{
  134. key: '30天',
  135. val: 1
  136. }, {
  137. key: '90天',
  138. val: 2
  139. }, {
  140. key: '180天',
  141. val: 3
  142. }, {
  143. key: '自定义',
  144. val: 4
  145. }],
  146. defaultVal: 1
  147. }
  148. ],
  149. activeType: 'all',
  150. page: 1,
  151. orderList: [],
  152. keyword: '',
  153. allPage: 0,
  154. filterParams: {
  155. count: 10,
  156. endDate: new Date().getTime(),
  157. fromDate: null,
  158. sorting: {'inDate': 'desc'}
  159. },
  160. }
  161. },
  162. created() {
  163. this.getResource()
  164. },
  165. methods: {
  166. setSelect (type, val, isReload) {
  167. if (type === 'date') {
  168. if (val) {
  169. this.filterParams.fromDate = val.fromDate
  170. this.filterParams.toDate = val.toDate
  171. } else {
  172. this.filterParams.fromDate = null
  173. this.filterParams.toDate = null
  174. }
  175. } else {
  176. this.filterParams[type] = val
  177. }
  178. isReload && this.filterRecord()
  179. },
  180. initFilterParams () {
  181. this.filterParams = {
  182. keyword: '',
  183. fromDate: '',
  184. toDate: '',
  185. type: ''
  186. }
  187. },
  188. filterRecord () {
  189. this.page = 1
  190. this.getResource(true)
  191. },
  192. onSelectAction (selectObj) {
  193. this.setSelect(selectObj.key, selectObj.value, true)
  194. },
  195. onValueAction (selectObj) {
  196. this.setSelect(selectObj.key, selectObj.value, false)
  197. },
  198. getResource(Reset) {
  199. if (this.activeType !== 'all') {
  200. this.filterParams._state = this.activeType
  201. }
  202. this.filterParams.page = this.page
  203. this.filterParams.keyword = this.keyword
  204. this.$http.get('/sale/sample/approval/info/search', {params: this.filterParams})
  205. .then(res => {
  206. if (Reset) {
  207. this.orderList = []
  208. }
  209. this.orderList.push(...res.data.content)
  210. this.allPage = Math.floor(res.data.totalElement / 10)
  211. console.log(this.orderList)
  212. })
  213. },
  214. ChangeList(_tp) {
  215. this.activeType = _tp
  216. this.getResource(true)
  217. },
  218. getMoreSearch() {
  219. this.page++
  220. this.getResource()
  221. },
  222. searchOrderlist() {
  223. this.page = 1
  224. this.getResource(true)
  225. }
  226. },
  227. components: {
  228. RemindBox, PullUp, ModalWrapper, BaseFilter
  229. },
  230. filters: {
  231. timeDay: function(time) {
  232. if (typeof time === 'number') {
  233. if (!time) {
  234. return '无'
  235. } else {
  236. let d = new Date(time)
  237. let year = d.getFullYear()
  238. let month = d.getMonth() + 1
  239. let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  240. return year + '-' + month + '-' + day
  241. }
  242. }
  243. }
  244. }
  245. }
  246. </script>
  247. <style scoped lang="scss">
  248. @mixin overFlowHidden {
  249. overflow: hidden;
  250. text-overflow: ellipsis;
  251. white-space: nowrap;
  252. }
  253. @mixin lineHeight($value) {
  254. height: $value;
  255. line-height: $value;
  256. }
  257. .order-wrapper {
  258. background: #f1f3f6;
  259. margin: 1.26rem 0 0.98rem 0;
  260. height: calc(100vh - 1.26rem - 0.98rem);
  261. .filters-wrap{
  262. background: #fff;
  263. margin: 0 auto .13rem;
  264. width: 7.1rem;
  265. overflow: hidden;
  266. padding: .1rem;
  267. }
  268. .order-tab {
  269. background: #3f84f6;
  270. padding-bottom: 0.2rem;
  271. .order-tab-wrapper {
  272. border: solid 1px #ffffff;
  273. width: 7.06rem;
  274. margin: 0 auto;
  275. border-radius: 0.04rem;
  276. line-height: 0.72rem;
  277. height: 0.72rem;
  278. overflow: hidden;
  279. div {
  280. color: #ffffff;
  281. font-size: 0.28rem;
  282. text-align: center;
  283. width: 50%;
  284. &.active {
  285. background-color: #ffffff;
  286. color: #3f84f6;
  287. }
  288. }
  289. }
  290. }
  291. .order-nav {
  292. background: #fff;
  293. div {
  294. height: 0.82rem;
  295. line-height: 0.82rem;
  296. display: inline-block;
  297. width: 33.3%;
  298. text-align: center;
  299. font-size: .28rem;
  300. color: #666;
  301. &.active span{
  302. color: #3f84f6;
  303. border-bottom: 0.04rem solid #3f84f6;
  304. padding-bottom: 0.2rem;
  305. }
  306. }
  307. }
  308. .search-content2 {
  309. text-align: center;
  310. padding: .25rem 0 0 0;
  311. margin-top: 0 !important;
  312. margin-bottom:.25rem;
  313. input {
  314. width: 7.1rem;
  315. border: 1px solid #376ff3;
  316. }
  317. }
  318. .order-list-wrap {
  319. height: calc(90vh - 1.26rem - 0.96rem - 0.84rem - 1rem - 0.92rem);
  320. overflow-y: scroll;
  321. margin-top: 0.2rem;
  322. li {
  323. background: #fff;
  324. width: 7.1rem;
  325. margin: 0 auto 0.2rem;
  326. border-radius: 0.04rem;
  327. border: 1px solid #e4e4e4;
  328. padding: 0 0.24rem;
  329. .over-active{
  330. @include lineHeight(.4rem);
  331. padding:.05rem;
  332. margin:0 .5rem;
  333. background: #F0AD4E;
  334. color:#fff;
  335. border-radius:.05rem;
  336. }
  337. .leave-active{
  338. @include lineHeight(.4rem);
  339. padding:.05rem;
  340. margin:0 .5rem;
  341. background: #15B262;
  342. color:#fff;
  343. border-radius:.05rem;
  344. }
  345. .list-title {
  346. @include lineHeight(0.91rem);
  347. @include overFlowHidden();
  348. font-size: 0.28rem;
  349. color: #3a3a3a;
  350. }
  351. .list-bottom{
  352. @include lineHeight(1rem);
  353. text-align: center;
  354. font-size: 0.26rem;
  355. color: #333;
  356. }
  357. .list-content {
  358. border-top: 1px solid #d3d3d3;
  359. padding-top: 0.23rem;
  360. .item {
  361. font-size: 0.28rem;
  362. color: #333;
  363. @include overFlowHidden();
  364. margin-bottom: 0.15rem;
  365. span {
  366. color: #666;
  367. }
  368. &.pric {
  369. color: #e6353d;
  370. }
  371. }
  372. }
  373. }
  374. }
  375. .com-none-state{
  376. background: #f1f3f6
  377. }
  378. }
  379. </style>