acquisitionInspection.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <u-search placeholder="输入编号/客户号/车牌号" v-model="inputKeyword" @search="getList(true)"></u-search>
  5. <view class="dropdown">
  6. <view class="left" @click="selectWarehouse">
  7. <view>{{warehouseName}}</view>
  8. <u-icon name="arrow-down" color=""></u-icon>
  9. </view>
  10. <!-- <view class="right">
  11. <u-icon name="checkmark-circle-fill" color="#22C572"></u-icon>
  12. <view class="default">默认</view>
  13. </view> -->
  14. </view>
  15. <u-select v-model="isShowWarehouse" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
  16. </u-select>
  17. </view>
  18. <view class="middle">
  19. <view class="item-style" v-for="(item,index) in dataList" :key="index">
  20. <view class="row1">
  21. <view class="row1-left">
  22. <view class="left status1" v-if="item.status=='已质检'">检</view>
  23. <view class="left status2" v-if="item.status=='已称皮重'">皮</view>
  24. <view class="left status3" v-if="item.status=='已称毛重'">毛</view>
  25. <view>
  26. <view class="top-title">
  27. {{item.number}}
  28. </view>
  29. <view class="bottom">{{item.updateDate}}</view>
  30. </view>
  31. </view>
  32. <view class="right">{{item.customer}}</view>
  33. </view>
  34. <view class="row2" v-if="item.paymentManagement">
  35. <view>{{item.paymentManagement.customerName}}</view>
  36. <view>{{item.paymentManagement.carNo}}</view>
  37. <view>{{item.paymentManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)</view>
  38. </view>
  39. <view class="row3">
  40. <view class="row3-item">
  41. <view class="left">毛</view>
  42. <view>{{item.grossWeight?item.grossWeight:'未称重'}}</view>
  43. </view>
  44. <view class="row3-item">
  45. <view class="left">皮</view>
  46. <view>{{item.tare?item.tare:'未称重'}}</view>
  47. </view>
  48. <view class="row3-item">
  49. <view class="left">净</view>
  50. <view>{{item.netWeight?item.netWeight:'未称重'}}</view>
  51. </view>
  52. </view>
  53. <view class="row4">
  54. <view v-if="item.status!='已称皮重'" class="right" @click="grossWeightClick(item)">毛重</view>
  55. <view v-if="(!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
  56. !(item.paymentManagement&&item.paymentManagement.status=='部分收款')) && item.status!='已质检'"
  57. class="right" @click="tareClick(item)">皮重</view>
  58. </view>
  59. </view>
  60. </view>
  61. <view v-show="isContent">
  62. <uni-load-more :status="loadStatus"></uni-load-more>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import {
  68. mapState
  69. } from 'vuex';
  70. export default {
  71. data() {
  72. return {
  73. inputKeyword: '',
  74. warehouseName: '',
  75. warehouseId: '',
  76. isShowWarehouse: false,
  77. warehouseList: [],
  78. isContent:false,
  79. loadStatus:'noMore',
  80. dataList: [],
  81. pageSize:10,
  82. currentPage:1,
  83. }
  84. },
  85. onShow() {
  86. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  87. if (res.data.data == "INVALID") {
  88. uni.showModal({
  89. title: "登录提示",
  90. content: "Session过期需要重新登录,是否立即登录",
  91. showCancel: true,
  92. confirmText: '登录',
  93. success(e) {
  94. if (e.confirm) {
  95. uni.navigateTo({
  96. url: '/pages/public/login'
  97. })
  98. }
  99. }
  100. })
  101. } else {
  102. this.compId = uni.getStorageSync('pcUserInfo').compId
  103. console.log("compId", this.compId)
  104. this.loadData()
  105. }
  106. })
  107. .catch(res => {
  108. if (res.message) {
  109. uni.showToast({
  110. title: res.message,
  111. icon: 'none',
  112. duration: 2000
  113. })
  114. }
  115. });
  116. },
  117. computed: {
  118. ...mapState(['hasLogin', 'userInfo'])
  119. },
  120. onPullDownRefresh() {
  121. this.currentPage=1
  122. this.gridList=[]
  123. this.getList(true)
  124. setTimeout(function () {
  125. uni.stopPullDownRefresh();
  126. }, 1000);
  127. },
  128. onReachBottom() {
  129. this.currentPage+=1
  130. this.getList(false)
  131. // this.getMoreNews()
  132. },
  133. methods: {
  134. loadData() {
  135. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
  136. compId: '',
  137. personCharge:this.userInfo.phone
  138. }).then(res => {
  139. console.log("warehouseBaseInfo", res)
  140. let _resData = res.data.data
  141. this.warehouseList = []
  142. for (let i = 0; i < _resData.length; i++) {
  143. let _obj = {
  144. "label": _resData[i].warehouseName,
  145. "value": _resData[i].id,
  146. }
  147. this.warehouseList.push(_obj)
  148. }
  149. this.warehouseName = this.warehouseList[0].label
  150. this.warehouseId = this.warehouseList[0].value
  151. this.getList(true)
  152. })
  153. },
  154. //获取列表
  155. getList(flag) {
  156. this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
  157. compId: '',
  158. currentPage: this.currentPage,
  159. pageSize:this.pageSize,
  160. searchKeyWord: this.inputKeyword,
  161. warehouseName: this.warehouseName,
  162. managementType: 1,
  163. }).then(res => {
  164. var data=res.data.data.records
  165. if(flag){
  166. this.dataList = data
  167. }
  168. else{
  169. this.dataList = this.dataList.concat(data)
  170. }
  171. if(res.data.data.records.length==0){
  172. this.isContent=true
  173. }
  174. console.log("--------------------------------")
  175. console.log("this.dataList",this.dataList)
  176. })
  177. },
  178. selectWarehouse() {
  179. this.isShowWarehouse = true
  180. },
  181. confirmWarehouse(e) {
  182. console.log(e)
  183. this.warehouseName = e[0].label
  184. this.dataList.warehouseName = e[0].label;
  185. this.getList(true)
  186. },
  187. //毛重
  188. grossWeightClick(val) {
  189. console.log(val)
  190. val.warehouseName = this.warehouseName
  191. val.warehouseId = this.warehouseId
  192. uni.navigateTo({
  193. url: './grossWeightDetail?detailData=' + JSON.stringify(val)
  194. })
  195. },
  196. tareClick(val) {
  197. val.warehouseName = this.warehouseName
  198. val.warehouseId = this.warehouseId
  199. uni.navigateTo({
  200. url: './tareDetail?detailData=' + JSON.stringify(val)
  201. })
  202. }
  203. }
  204. }
  205. </script>
  206. <style scoped lang="scss">
  207. .top {
  208. background: white;
  209. padding: 20rpx;
  210. border-radius: 0 0 20rpx 40rpx;
  211. }
  212. .dropdown {
  213. display: flex;
  214. justify-content: space-between;
  215. align-items: center;
  216. position: relative;
  217. margin: 20rpx 0;
  218. padding: 0 13rpx;
  219. .right,
  220. .left {
  221. display: flex;
  222. align-items: center;
  223. }
  224. }
  225. .item-style {
  226. background: white;
  227. margin: 20rpx;
  228. padding: 20rpx;
  229. .row1 {
  230. display: flex;
  231. align-items: center;
  232. justify-content: space-between;
  233. .row1-left {
  234. display: flex;
  235. justify-content: flex-start;
  236. align-items: center;
  237. .left {
  238. margin-right: 20rpx;
  239. }
  240. .top-title {
  241. font-size: 32rpx;
  242. font-weight: 600;
  243. color: #333333;
  244. }
  245. .bottom {
  246. color: #878C9C;
  247. }
  248. .right {
  249. font-size: 28rpx;
  250. font-weight: 600;
  251. color: #333333;
  252. }
  253. }
  254. }
  255. .row2 {
  256. display: flex;
  257. background: #F9F9FA;
  258. border-radius: 10rpx;
  259. padding: 10rpx 0;
  260. justify-content: space-around;
  261. margin: 20rpx 0;
  262. color: #878C9C;
  263. padding-left: 24rpx;
  264. align-items: center;
  265. }
  266. .row3 {
  267. display: flex;
  268. margin-top: 30rpx;
  269. padding-left: 14rpx;
  270. .row3-item {
  271. display: flex;
  272. margin-right: 40rpx;
  273. align-items: center;
  274. .left {
  275. background: #22C572;
  276. border-radius: 10rpx;
  277. padding: 2rpx 10rpx;
  278. box-sizing: border-box;
  279. color: white;
  280. font-size: 12px;
  281. margin-right: 15rpx;
  282. }
  283. }
  284. }
  285. .row4 {
  286. display: flex;
  287. justify-content: flex-end;
  288. margin-top: 10px;
  289. .right {
  290. border: 1px solid #CDCDCD;
  291. border-radius: 45rpx;
  292. padding: 10rpx 30rpx;
  293. margin-left: 20rpx;
  294. }
  295. }
  296. }
  297. .status1,.status2,.status3{
  298. padding: 8rpx 12rpx;
  299. border-radius: 50%;
  300. color: white;
  301. }
  302. .status1{
  303. background: #FD714F;
  304. }
  305. .status2{
  306. background: #22C572;
  307. }
  308. .status3{
  309. background: #3296FA;
  310. }
  311. </style>