quality_testing.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. <template>
  2. <view>
  3. <view class="header">
  4. <view style='background:#fff;display:flex;' class="cu-bar search">
  5. <view style='flex:6;' class="search-form round Medium">
  6. <text style='color: #ccc;text-indent:6px;' class="cuIcon-search"></text>
  7. <input v-if='managementType==1' type="text" maxlength="20" :focus="true" v-model="searchKeyWord" @confirm="doSearch()"
  8. placeholder="输入编号、客户名、车牌号" confirm-type="search"></input>
  9. <input v-if='managementType==3' type="text" maxlength="20" :focus="true" v-model="searchKeyWord" @confirm="doSearch()"
  10. placeholder="输入合同编号、车牌号" confirm-type="search"></input>
  11. </view>
  12. <view @click='doSearch()' class="Regular" style="width:4%;flex:1;">搜索</view>
  13. <u-icon @click='emptysearch' class="cuIcon" v-if='searchKeyWord.length>0' size="34" name="close-circle-fill" color="#D6D9E0"></u-icon>
  14. <!-- <text @click='emptysearch' v-if='searchKeyWord.length>0' class='tip_text cuIcon-roundclosefill'></text> -->
  15. </view>
  16. <view class='changewarehouse'>
  17. <view @click='show=true'>{{warehouseName}}<text class='cuIcon-unfold'></text></view>
  18. <u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show" :range="selector"></u-picker>
  19. </view>
  20. </view>
  21. <view class='wrap' v-for='item in gridList'>
  22. <view class='flex justify-between'>
  23. <view v-if='item.status=="已质检"'>
  24. <view class='type type-zhi'>质</view>
  25. </view>
  26. <view v-if='item.status=="已称毛重"'>
  27. <view class='type type-mao'>毛</view>
  28. </view>
  29. <view v-if='item.status=="已称皮重"'>
  30. <view class='type type-pi'>皮</view>
  31. </view>
  32. <view>
  33. <view v-if='managementType==1' class='qualityNo'>{{item.qualityNo}}</view>
  34. <view v-if='managementType==3' class='qualityNo'>{{item.contractNo}}</view>
  35. <view class='time'>{{item.updateDate}}</view>
  36. </view>
  37. <view v-if='item.status=="已质检"' class='qualityInspector'>{{item.qualityInspector}}</view>
  38. <view v-else></view>
  39. </view>
  40. <view class="flex justify-around customerinformation">
  41. <view v-if='managementType==1'>{{item.customerName}}</view>
  42. <view>{{item.carNumber}}</view>
  43. <view>{{item.goodsName}}({{item.waterContent}}水)</view>
  44. </view>
  45. <view class='flex buttons'>
  46. <view v-if='item.status=="已质检"&&managementType==1' @click='del(item)' class='button'>删除</view>
  47. <view v-if='item.status!="已称皮重"&&managementType==1' @click='edit(item)' class='button'>编辑</view>
  48. <view v-if='item.status=="已称毛重"&&managementType==3' class='button'>质检</view>
  49. </view>
  50. </view>
  51. <view v-show="isContent">
  52. <uni-load-more :status="loadStatus"></uni-load-more>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import dragButton from "@/components/drag-button/drag-button.vue";
  58. import {
  59. mapState
  60. } from 'vuex';
  61. let startY = 0,
  62. moveY = 0,
  63. pageAtTop = true;
  64. export default {
  65. components: {
  66. dragButton
  67. },
  68. data() {
  69. return {
  70. inputShow: false,
  71. modalName: '',
  72. mycarStyle: '',
  73. feild: undefined,
  74. params:{},
  75. isContent:false,
  76. loadStatus:'noMore',
  77. inputContent: '',
  78. coverTransform: 'translateY(0px)',
  79. coverTransition: '0s',
  80. moving: false,
  81. footprintList: [],
  82. searchKeyWord:'',
  83. isVip: false,
  84. userInfoTmp: [],
  85. inputStatus: 'none',
  86. carInfo: [],
  87. gridCol: 4,
  88. show:false,
  89. pageSize:10,
  90. currentPage:1,
  91. gridBorder: false,
  92. headUrl:"../../static/img/myimg/YongHu@3x.png",
  93. userphone:"",
  94. username:"请更改昵称",
  95. gridList: [],
  96. managementType:'',
  97. warehouseName: '',
  98. showTran: true,
  99. companyId: 1,
  100. current: 4,
  101. cangid:''
  102. }
  103. },
  104. onLoad() {
  105. },
  106. // #ifndef MP
  107. onNavigationBarButtonTap(e) {
  108. const index = e.index;
  109. if (index === 0) {
  110. this.navTo('/pages/set/set');
  111. } else if (index === 1) {
  112. // #ifdef APP-PLUS
  113. const pages = getCurrentPages();
  114. const page = pages[pages.length - 1];
  115. const currentWebview = page.$getAppWebview();
  116. currentWebview.hideTitleNViewButtonRedDot({
  117. index
  118. });
  119. // #endif
  120. uni.navigateTo({
  121. url: '/pages/notice/notice'
  122. })
  123. }
  124. },
  125. // #endif
  126. computed: {
  127. ...mapState(['hasLogin', 'userInfo']),
  128. // 手机号中间4位加*
  129. starUserphone(){
  130. let reg = /^(\d{3})\d{4}(\d{4})$/;
  131. if(this.userphone){
  132. return this.userphone.replace(reg, "$1****$2");
  133. }
  134. }
  135. },
  136. onLoad(options){
  137. this.managementType=options.managementType
  138. },
  139. onShow() {
  140. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf',{
  141. compId:'',
  142. personCharge:this.userInfo.phone
  143. }).then(res => {
  144. if(res.data.data){
  145. this.warehouseName=res.data.data[0].warehouseName
  146. this.cangid=res.data.data[0].id
  147. this.selector=res.data.data
  148. this.getList()
  149. }
  150. })
  151. },
  152. methods: {
  153. emptysearch(){
  154. this.searchKeyWord=''
  155. this.gridList=[]
  156. this.currentPage=1
  157. this.getList()
  158. },
  159. doSearch(){
  160. this.gridList=[]
  161. this.currentPage=1
  162. this.getList()
  163. },
  164. warehousechange(e){
  165. this.warehouseName=this.selector[e[0]].warehouseName
  166. this.cangid=this.selector[e[0]].id
  167. this.getList()
  168. console.log(e)
  169. },
  170. getList(){
  171. var that = this
  172. this.$api.doRequest('get', 'qualityInspectionManagement/selectQualityInspection',{
  173. pageSize: this.pageSize,
  174. currentPage: this.currentPage,
  175. searchKeyWord: this.searchKeyWord,
  176. searchType: this.searchType,
  177. managementType:this.managementType,
  178. warehouseName: this.warehouseName,
  179. compId:'2710b21efc1e4393930c5dc800010dc4',
  180. // pcFlag:1
  181. }).then(res => {
  182. if(res.data.data){
  183. let data = res.data.data.records
  184. //采购信息
  185. if (data.length > 0) {
  186. that.gridList = that.gridList.concat(data)
  187. }else{
  188. if(this.currentPage==1){
  189. that.gridList=[]
  190. }
  191. this.isContent=true
  192. }
  193. }
  194. console.log(that.gridList)
  195. })
  196. },
  197. edit(item){
  198. uni.navigateTo({
  199. url:'/pages/erpbusiness/edit_quality_testing?id='+item.id+'&managementType='+this.managementType+'&cangid='+this.cangid
  200. })
  201. },
  202. del(item){
  203. this.$api.doRequest('get', '/qualityInspectionManagement/api/deleteQualityInspection',{
  204. id:item.id
  205. }).then(res => {
  206. if(res.data.code==200){
  207. this.$api.msg('删除成功')
  208. }else{
  209. this.$api.msg('系统异常,请联系管理员')
  210. }
  211. })
  212. },
  213. fankui(){
  214. uni.navigateTo({
  215. url: `/pages/user/fankui`
  216. })
  217. },
  218. zhibo() {
  219. uni.navigateTo({
  220. url: `/pageB/video/broadcast`
  221. })
  222. },
  223. look() {
  224. uni.navigateTo({
  225. url: `/pageB/video/look`
  226. })
  227. },
  228. contactUs() {
  229. const that = this
  230. uni.makePhoneCall({
  231. // 手机号
  232. phoneNumber: '18241771147',
  233. // 成功回调
  234. success: (res) => {},
  235. // 失败回调
  236. fail: (res) => {}
  237. });
  238. },
  239. loadData() {
  240. // const that = this
  241. // if(uni.getStorageSync("PageCur")){
  242. // that.PageCur = uni.getStorageSync("PageCur");
  243. // }
  244. // that.userInfoTmp = uni.getStorageSync("userInfo")
  245. // uni.showLoading({
  246. // title: '正在加载',
  247. // mask:true
  248. // })
  249. // that.$api.request('integral', 'getIndexData', failres => {
  250. // that.$api.msg(failres.errmsg)
  251. // uni.hideLoading()
  252. // }).then(res => {
  253. // let data = res.data
  254. // uni.setStorageSync("message", data.message);
  255. // uni.setStorageSync("task", data.task);
  256. // uni.setStorageSync("contract", data.contract);
  257. // uni.setStorageSync('showTran', data.showTran);
  258. // that.showTran = data.showTran
  259. // that.gridList[4].tips = data.task
  260. // that.gridList[2].tips = data.contract
  261. // that.companyId = data.companyId
  262. // uni.hideLoading()
  263. // })
  264. },
  265. confirm() {
  266. const that = this
  267. if (!that.inputContent) {
  268. that.$api.msg('输入不能为空')
  269. return
  270. }
  271. let obj = {}
  272. obj[that.feild] = that.inputContent
  273. that.$api.request('user', 'syncUserInfo', obj).then(res => {
  274. that.userInfo.nickname = that.inputContent
  275. that.inputContent = ''
  276. that.$store.commit('login', that.userInfo)
  277. })
  278. },
  279. cancel() {
  280. this.inputShow = false
  281. this.inputStatus = 'none'
  282. this.genderShow = false
  283. },
  284. myAccount() {
  285. uni.navigateTo({
  286. url: `/pageA/pages/contract`
  287. })
  288. },
  289. /**
  290. * 统一跳转接口,拦截未登录路由
  291. * navigator标签现在默认没有转场动画,所以用view
  292. */
  293. navTo(url) {
  294. if (!this.hasLogin) {
  295. url = '/pages/public/login';
  296. }
  297. uni.navigateTo({
  298. url
  299. })
  300. },
  301. mycarClick(carNo) {
  302. this.modalName = null
  303. uni.navigateTo({
  304. url: `/pageB/car/mycar_detail?carNo=${carNo}`
  305. })
  306. },
  307. scanCode() {
  308. uni.scanCode({
  309. success: function(res) {
  310. uni.navigateTo({
  311. url: res.result
  312. })
  313. }
  314. })
  315. },
  316. hideModal(e) {
  317. this.modalName = null
  318. },
  319. }
  320. }
  321. </script>
  322. <style lang='scss' scoped>
  323. page{
  324. background:#F5F6FA;
  325. }
  326. .container {
  327. padding-top: 85px;
  328. padding-top: 35px;
  329. background-color: #F5F6FA;
  330. position: relative;
  331. width: 100vw;
  332. height: 100vh;
  333. overflow: hidden;
  334. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  335. background-size: 100% 100%;
  336. margin: 0 auto;
  337. }
  338. .cu-tag.badge {
  339. right: 26rpx;
  340. }
  341. .path {
  342. color: #007aff;
  343. display: inline-block;
  344. text-align: center;
  345. }
  346. .icon {
  347. margin-right: 10rpx;
  348. }
  349. .portrait-box {
  350. margin-top: 20rpx;
  351. }
  352. .qr-wrap {
  353. margin-top: 20upx;
  354. color: #fff;
  355. font-size: 32rpx;
  356. }
  357. @keyframes move_wave {
  358. 0% {
  359. transform: translateX(0) translateZ(0) scaleY(1)
  360. }
  361. 50% {
  362. transform: translateX(-25%) translateZ(0) scaleY(0.55)
  363. }
  364. 100% {
  365. transform: translateX(-50%) translateZ(0) scaleY(1)
  366. }
  367. }
  368. .bg {
  369. position: relative;
  370. height: 300rpx;
  371. /* background: linear-gradient(to bottom, #56ccf2, #2f80ed); */
  372. /*background: linear-gradient(to bottom, #0be9fe, #4bb0fe); */
  373. background: linear-gradient(to bottom, #d5f8ff, #56ccf2);
  374. }
  375. .bg_ware {
  376. position: absolute;
  377. left: 0;
  378. bottom: -2rpx;
  379. width: 100%;
  380. mix-blend-mode: screen;
  381. height: 224rpx;
  382. }
  383. %flex-center {
  384. display: flex;
  385. flex-direction: column;
  386. justify-content: center;
  387. align-items: center;
  388. }
  389. %section {
  390. display: flex;
  391. justify-content: space-around;
  392. align-content: center;
  393. background: #fff;
  394. border-radius: 10upx;
  395. }
  396. .cuIcon {
  397. position: absolute;
  398. right: 80px;
  399. }
  400. .grid-item-box {
  401. flex: 1;
  402. /* position: relative;
  403. */
  404. /* #ifndef APP-NVUE */
  405. display: flex;
  406. /* #endif */
  407. flex-direction: column;
  408. align-items: center;
  409. justify-content: center;
  410. padding: 15px 0;
  411. }
  412. .image {
  413. width: 80rpx;
  414. height: 80rpx;
  415. }
  416. .text {
  417. font-size: 26rpx;
  418. margin-top: 10rpx;
  419. }
  420. .user-section {
  421. height: 520upx;
  422. padding: 100upx 30upx 0;
  423. position: relative;
  424. .bg {
  425. position: absolute;
  426. left: 0;
  427. top: 0;
  428. width: 100%;
  429. height: 100%;
  430. filter: blur(1px);
  431. box-shadow: 0px 1px 8px #ccc;
  432. /* background:linear-gradient(#0eb0c9,#126bae); */
  433. /* opacity: .7; */
  434. }
  435. }
  436. .cover-container {
  437. padding: 1px 10px ;
  438. padding-bottom: 200upx;
  439. /* background-color: #F5F6FA; */
  440. /* border-radius: 20px; */
  441. margin-top: 60upx;
  442. .arc {
  443. position: absolute;
  444. left: 0;
  445. top: -34upx;
  446. width: 100%;
  447. height: 36upx;
  448. }
  449. }
  450. .tj-sction {
  451. @extend %section;
  452. .tj-item {
  453. @extend %flex-center;
  454. flex-direction: column;
  455. height: 140upx;
  456. font-size: $font-sm;
  457. color: #75787d;
  458. }
  459. .num {
  460. font-size: $font-lg;
  461. color: $font-color-dark;
  462. margin-bottom: 8upx;
  463. }
  464. }
  465. .order-section {
  466. @extend %section;
  467. padding: 28upx 0;
  468. margin-top: 20upx;
  469. .order-item {
  470. @extend %flex-center;
  471. width: 120upx;
  472. height: 120upx;
  473. border-radius: 10upx;
  474. font-size: $font-sm;
  475. color: $font-color-dark;
  476. }
  477. .yticon {
  478. font-size: 48upx;
  479. margin-bottom: 18upx;
  480. color: #fa436a;
  481. }
  482. .icon-shouhoutuikuan {
  483. font-size: 44upx;
  484. }
  485. }
  486. .history-section {
  487. padding: 30upx 0 0;
  488. margin-top: 20upx;
  489. background: #fff;
  490. border-radius: 10upx;
  491. .sec-header {
  492. display: flex;
  493. align-items: center;
  494. font-size: $font-base;
  495. color: $font-color-dark;
  496. line-height: 40upx;
  497. margin-left: 30upx;
  498. .yticon {
  499. font-size: 44upx;
  500. color: #5eba8f;
  501. margin-right: 16upx;
  502. line-height: 40upx;
  503. }
  504. }
  505. .h-list {
  506. white-space: nowrap;
  507. padding: 30upx 30upx 0;
  508. image {
  509. display: inline-block;
  510. width: 160upx;
  511. height: 160upx;
  512. margin-right: 20upx;
  513. border-radius: 10upx;
  514. }
  515. }
  516. }
  517. .search-form {
  518. background: #F5F6F9;
  519. }
  520. .line {
  521. display: inline-block;
  522. padding: 5px;
  523. position: relative;
  524. font-size: 17px;
  525. }
  526. .line.active {
  527. font-size: 19px;
  528. font-weight: 900;
  529. }
  530. .line.active:after {
  531. content: '';
  532. display: block;
  533. position: absolute;
  534. width: 36rpx;
  535. height: 6rpx;
  536. left: 50%;
  537. transform: translateX(-50%);
  538. bottom: 0;
  539. background: #22C572;
  540. /* border-bottom: 1px solid #22C572; */
  541. }
  542. .search-box {
  543. width: 100%;
  544. background-color: rgb(242, 242, 242);
  545. padding: 15upx 2.5%;
  546. display: flex;
  547. justify-content: space-between;
  548. }
  549. .search-box .mSearch-input-box {
  550. width: 100%;
  551. }
  552. .search-box .input-box {
  553. width: 85%;
  554. flex-shrink: 1;
  555. display: flex;
  556. justify-content: center;
  557. align-items: center;
  558. }
  559. .search-box .search-btn {
  560. width: 15%;
  561. margin: 0 0 0 2%;
  562. display: flex;
  563. justify-content: center;
  564. align-items: center;
  565. flex-shrink: 0;
  566. font-size: 28upx;
  567. color: #fff;
  568. background: linear-gradient(to right, #ff9801, #ff570a);
  569. border-radius: 60upx;
  570. }
  571. .search-box .input-box>input {
  572. width: 100%;
  573. height: 60upx;
  574. font-size: 32upx;
  575. border: 0;
  576. border-radius: 60upx;
  577. -webkit-appearance: none;
  578. -moz-appearance: none;
  579. appearance: none;
  580. padding: 0 3%;
  581. margin: 0;
  582. background-color: #ffffff;
  583. }
  584. .placeholder-class {
  585. color: #9e9e9e;
  586. }
  587. .search-keyword {
  588. width: 100%;
  589. background-color: rgb(242, 242, 242);
  590. }
  591. .grid {
  592. display: flex;
  593. align-items: center;
  594. flex-wrap: wrap;
  595. /* border-top: 2upx solid rgba(172,172,172,.2); */
  596. .grid-item-3 {
  597. box-sizing: border-box;
  598. width: calc(100% / 3);
  599. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  600. border-right: 2upx solid rgba(172, 172, 172, .2);
  601. text-align: center;
  602. padding: 40upx 0;
  603. position: relative;
  604. /* view{
  605. font-size: $font-sm;
  606. margin-top: 16upx;
  607. color: $font-color-dark;
  608. } */
  609. .grid_icon {
  610. font-size: 48upx;
  611. margin-bottom: 18upx;
  612. color: #fa436a;
  613. }
  614. .tip_text {
  615. display: block;
  616. padding: 4upx 8upx;
  617. text-align: center;
  618. border-radius: 36upx;
  619. font-size: 24upx;
  620. background-color: #fa436a;
  621. color: rgba(255, 255, 255, 1);
  622. position: absolute;
  623. right: 6upx;
  624. top: 6upx;
  625. }
  626. }
  627. .grid-item-3:nth-child(3n + 3),
  628. .grid-item-4:nth-child(4n + 4) {
  629. border-right: none;
  630. }
  631. }
  632. .headPortrait {
  633. width: 75px;
  634. height: 75px;
  635. border-radius: 40px;
  636. border: 2px solid #ffffff;
  637. }
  638. .information {
  639. font-size: 15px;
  640. font-weight: 600;
  641. height: 36px;
  642. }
  643. .cu-list>.cu-item:after{
  644. border:none;
  645. }
  646. .sign{
  647. width: 40px;
  648. height: 40px;
  649. top: 4px;
  650. margin-right: 6px;
  651. }
  652. .indexUp{
  653. padding:0 20px;
  654. align-items: center;
  655. }
  656. .wrap{
  657. background:#fff;
  658. margin:10px;
  659. border-radius:10px;
  660. padding:10px;
  661. }
  662. .qualityNo{
  663. font-size:16px;
  664. }
  665. .type{
  666. font-size:12px;
  667. color:#fff;
  668. padding:3px 5px;
  669. border-radius:50%;
  670. line-height:16px;
  671. }
  672. .type-zhi{
  673. background:#22C572;
  674. }
  675. .type-mao{
  676. background:#3296FA;
  677. }
  678. .type-pi{
  679. background:#FD714F;
  680. }
  681. .time{
  682. font-size:12px;
  683. color:#878C9C;
  684. }
  685. .qualityInspector{
  686. font-size:14px;
  687. }
  688. .customerinformation{
  689. background:#F9F9FA;
  690. padding:7px;
  691. margin:20px 0;
  692. border-radius:10px;
  693. color:#9698A2;
  694. }
  695. .buttons{
  696. flex-direction:row-reverse;
  697. }
  698. .button{
  699. padding:13rpx 30rpx;
  700. border:1px solid #CDCDCD;
  701. border-radius:15px;
  702. margin:0 10px;
  703. }
  704. .changewarehouse{
  705. padding:10px 20px;
  706. }
  707. .header{
  708. background:#fff;
  709. border-radius:0px 0px 16px 16px;
  710. }
  711. </style>