acquisitionInspection.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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.secretaryWeigher}}</view>
  33. </view>
  34. <view class="row2" v-if="item.qualityInspectionManagement">
  35. <view>{{item.qualityInspectionManagement.customerName}}</view>
  36. <view>{{item.qualityInspectionManagement.carNo}}</view>
  37. <view>{{item.qualityInspectionManagement.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. cangid:''
  84. }
  85. },
  86. onShow() {
  87. if(this.cangid){
  88. uni.setStorageSync("cangid",this.cangid)
  89. }
  90. else{
  91. this.cangid = uni.getStorageSync("cangid")
  92. }
  93. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  94. if (res.data.data == "INVALID") {
  95. uni.showModal({
  96. title: "登录提示",
  97. content: "Session过期需要重新登录,是否立即登录",
  98. showCancel: true,
  99. confirmText: '登录',
  100. success(e) {
  101. if (e.confirm) {
  102. uni.navigateTo({
  103. url: '/pages/public/login'
  104. })
  105. }
  106. }
  107. })
  108. } else {
  109. this.compId = uni.getStorageSync('pcUserInfo').compId
  110. console.log("compId", this.compId)
  111. this.loadData()
  112. }
  113. })
  114. .catch(res => {
  115. if (res.message) {
  116. uni.showToast({
  117. title: res.message,
  118. icon: 'none',
  119. duration: 2000
  120. })
  121. }
  122. });
  123. },
  124. computed: {
  125. ...mapState(['hasLogin', 'userInfo'])
  126. },
  127. onPullDownRefresh() {
  128. this.currentPage=1
  129. this.gridList=[]
  130. this.getList(true)
  131. setTimeout(function () {
  132. uni.stopPullDownRefresh();
  133. }, 1000);
  134. },
  135. onReachBottom() {
  136. this.currentPage+=1
  137. this.getList(false)
  138. // this.getMoreNews()
  139. },
  140. methods: {
  141. loadData() {
  142. var that = this
  143. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
  144. compId: '',
  145. personCharge:this.userInfo.phone
  146. }).then(res => {
  147. console.log("warehouseBaseInfo", res)
  148. let _resData = res.data.data
  149. that.warehouseList = []
  150. for (let i = 0; i < _resData.length; i++) {
  151. let _obj = {
  152. "label": _resData[i].warehouseName,
  153. "value": _resData[i].id,
  154. }
  155. that.warehouseList.push(_obj)
  156. if (that.cangid&&that.cangid == _resData[i].id) {
  157. that.warehouseName = _resData[i].warehouseName
  158. that.warehouseId = _resData[i].id
  159. }
  160. }
  161. if(that.warehouseList.length > 0 && !that.cangid){
  162. that.warehouseName = that.warehouseList[0].label
  163. that.warehouseId = that.warehouseList[0].value
  164. that.cangid = that.warehouseList[0].value
  165. }
  166. this.getList(true)
  167. })
  168. },
  169. //获取列表
  170. getList(flag) {
  171. this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
  172. compId: '',
  173. currentPage: this.currentPage,
  174. pageSize:this.pageSize,
  175. searchKeyWord: this.inputKeyword,
  176. warehouseName: this.warehouseName,
  177. managementType: 1,
  178. }).then(res => {
  179. var data=res.data.data.records
  180. if(flag){
  181. this.dataList = data
  182. }
  183. else{
  184. this.dataList = this.dataList.concat(data)
  185. }
  186. if(res.data.data.records.length==0){
  187. this.isContent=true
  188. }
  189. console.log("--------------------------------")
  190. console.log("this.dataList",this.dataList)
  191. })
  192. },
  193. selectWarehouse() {
  194. this.isShowWarehouse = true
  195. },
  196. confirmWarehouse(e) {
  197. console.log(e)
  198. this.warehouseName = e[0].label
  199. this.dataList.warehouseName = e[0].label;
  200. this.cangid=e[0].value
  201. uni.setStorageSync("cangid",this.cangid)
  202. this.getList(true)
  203. },
  204. //毛重
  205. grossWeightClick(val) {
  206. console.log(val)
  207. val.warehouseName = this.warehouseName
  208. val.warehouseId = this.warehouseId
  209. uni.navigateTo({
  210. url: './grossWeightDetail?detailData=' + JSON.stringify(val)
  211. })
  212. },
  213. tareClick(val) {
  214. val.warehouseName = this.warehouseName
  215. val.warehouseId = this.warehouseId
  216. uni.navigateTo({
  217. url: './tareDetail?detailData=' + JSON.stringify(val)
  218. })
  219. }
  220. }
  221. }
  222. </script>
  223. <style scoped lang="scss">
  224. .top {
  225. background: white;
  226. padding: 20rpx;
  227. border-radius: 0 0 20rpx 40rpx;
  228. }
  229. .dropdown {
  230. display: flex;
  231. justify-content: space-between;
  232. align-items: center;
  233. position: relative;
  234. margin: 20rpx 0;
  235. padding: 0 13rpx;
  236. .right,
  237. .left {
  238. display: flex;
  239. align-items: center;
  240. }
  241. }
  242. .item-style {
  243. background: white;
  244. margin: 20rpx;
  245. padding: 20rpx;
  246. .row1 {
  247. display: flex;
  248. align-items: center;
  249. justify-content: space-between;
  250. .row1-left {
  251. display: flex;
  252. justify-content: flex-start;
  253. align-items: center;
  254. .left {
  255. margin-right: 20rpx;
  256. }
  257. .top-title {
  258. font-size: 32rpx;
  259. font-weight: 600;
  260. color: #333333;
  261. }
  262. .bottom {
  263. color: #878C9C;
  264. }
  265. .right {
  266. font-size: 28rpx;
  267. font-weight: 600;
  268. color: #333333;
  269. }
  270. }
  271. }
  272. .row2 {
  273. display: flex;
  274. background: #F9F9FA;
  275. border-radius: 10rpx;
  276. padding: 10rpx 0;
  277. justify-content: space-around;
  278. margin: 20rpx 0;
  279. color: #878C9C;
  280. padding-left: 24rpx;
  281. align-items: center;
  282. }
  283. .row3 {
  284. display: flex;
  285. margin-top: 30rpx;
  286. padding-left: 14rpx;
  287. .row3-item {
  288. display: flex;
  289. margin-right: 40rpx;
  290. align-items: center;
  291. .left {
  292. background: #22C572;
  293. border-radius: 10rpx;
  294. padding: 2rpx 10rpx;
  295. box-sizing: border-box;
  296. color: white;
  297. font-size: 12px;
  298. margin-right: 15rpx;
  299. }
  300. }
  301. }
  302. .row4 {
  303. display: flex;
  304. justify-content: flex-end;
  305. margin-top: 10px;
  306. .right {
  307. border: 1px solid #CDCDCD;
  308. border-radius: 45rpx;
  309. padding: 10rpx 30rpx;
  310. margin-left: 20rpx;
  311. }
  312. }
  313. }
  314. .status1,.status2,.status3{
  315. padding: 8rpx 12rpx;
  316. border-radius: 50%;
  317. color: white;
  318. }
  319. .status1{
  320. background: #FD714F;
  321. }
  322. .status2{
  323. background: #22C572;
  324. }
  325. .status3{
  326. background: #3296FA;
  327. }
  328. </style>