acquisitionInspection.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  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>
  38. {{item.qualityInspectionManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)
  39. </view>
  40. </view>
  41. <view class="row3">
  42. <view class="row3-item">
  43. <view class="left">毛</view>
  44. <view>{{item.grossWeight?item.grossWeight:'未称重'}}</view>
  45. </view>
  46. <view class="row3-item">
  47. <view class="left">皮</view>
  48. <view>{{item.tare?item.tare:'未称重'}}</view>
  49. </view>
  50. <view class="row3-item">
  51. <view class="left">净</view>
  52. <view>{{item.netWeight?item.netWeight:'未称重'}}</view>
  53. </view>
  54. </view>
  55. <view class="row4">
  56. <view v-if="getRoles('acquisitionWeight.mao')&&item.status!='已称皮重'" class="right"
  57. @click="grossWeightClick(item)">毛重</view>
  58. <view v-if="getRoles('acquisitionWeight.weight')&&(!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
  59. !(item.paymentManagement&&item.paymentManagement.status=='部分收款')) && item.status!='已质检' && item.allow != 2"
  60. class="right" @click="tareClick(item)">皮重</view>
  61. </view>
  62. </view>
  63. </view>
  64. <view v-show="isContent">
  65. <uni-load-more :status="loadStatus"></uni-load-more>
  66. </view>
  67. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  68. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  69. showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
  70. </view>
  71. </template>
  72. <script>
  73. import {
  74. mapState
  75. } from 'vuex';
  76. export default {
  77. data() {
  78. return {
  79. isShowAlert: false,
  80. content: '登录信息过期需要重新登录,是否立即登录?',
  81. inputKeyword: '',
  82. warehouseName: '',
  83. warehouseId: '',
  84. isShowWarehouse: false,
  85. warehouseList: [],
  86. isContent: false,
  87. loadStatus: 'noMore',
  88. dataList: [],
  89. pageSize: 10,
  90. currentPage: 1,
  91. cangid: ''
  92. }
  93. },
  94. onShow() {
  95. if (this.cangid) {
  96. uni.setStorageSync("cangid", this.cangid)
  97. } else {
  98. this.cangid = uni.getStorageSync("cangid")
  99. }
  100. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  101. if (res.data.data == "INVALID") {
  102. this.isShowAlert = true;
  103. // uni.showModal({
  104. // title: "提示",
  105. // content: "Session过期需要重新登录,是否立即登录",
  106. // showCancel: true,
  107. // confirmText: '登录',
  108. // success(e) {
  109. // if (e.confirm) {
  110. // uni.navigateTo({
  111. // url: '/pages/public/login'
  112. // })
  113. // }
  114. // }
  115. // })
  116. } else {
  117. this.compId = uni.getStorageSync('pcUserInfo').compId
  118. console.log("compId", this.compId)
  119. this.loadData()
  120. }
  121. })
  122. .catch(res => {
  123. if (res.message) {
  124. uni.showToast({
  125. title: res.message,
  126. icon: 'none',
  127. duration: 2000
  128. })
  129. }
  130. });
  131. },
  132. computed: {
  133. ...mapState(['hasLogin', 'userInfo'])
  134. },
  135. onPullDownRefresh() {
  136. this.currentPage = 1
  137. this.gridList = []
  138. this.getList(true)
  139. setTimeout(function() {
  140. uni.stopPullDownRefresh();
  141. }, 1000);
  142. },
  143. onReachBottom() {
  144. this.currentPage += 1
  145. this.getList(false)
  146. // this.getMoreNews()
  147. },
  148. methods: {
  149. alertBtn() {
  150. uni.navigateTo({
  151. url: '/pages/public/login'
  152. })
  153. },
  154. cancelClick() {
  155. this.isShowAlert = false
  156. },
  157. //获取当前按钮权限
  158. getRoles: function(role) {
  159. let _roles = uni.getStorageSync('rolesList')
  160. for (let i = 0; i < _roles.length; i++) {
  161. if (_roles[i] == role) {
  162. return true
  163. }
  164. }
  165. return false
  166. },
  167. loadData() {
  168. var that = this
  169. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
  170. compId: '',
  171. personCharge: this.userInfo.phone
  172. }).then(res => {
  173. console.log("warehouseBaseInfo", res)
  174. let _resData = res.data.data
  175. that.warehouseList = []
  176. for (let i = 0; i < _resData.length; i++) {
  177. let _obj = {
  178. "label": _resData[i].warehouseName,
  179. "value": _resData[i].id,
  180. }
  181. that.warehouseList.push(_obj)
  182. if (that.cangid && that.cangid == _resData[i].id) {
  183. that.warehouseName = _resData[i].warehouseName
  184. that.warehouseId = _resData[i].id
  185. }
  186. }
  187. if (that.warehouseList.length > 0 && !that.cangid) {
  188. that.warehouseName = that.warehouseList[0].label
  189. that.warehouseId = that.warehouseList[0].value
  190. that.cangid = that.warehouseList[0].value
  191. }
  192. this.getList(true)
  193. })
  194. },
  195. //获取列表
  196. getList(flag) {
  197. uni.showLoading({
  198. title: "正在加载"
  199. })
  200. this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
  201. compId: '',
  202. currentPage: this.currentPage,
  203. pageSize: this.pageSize,
  204. searchKeyWord: this.inputKeyword,
  205. warehouseName: this.warehouseName,
  206. managementType: 1,
  207. }).then(res => {
  208. var data = res.data.data.records
  209. for (let i = 0; i < data.length; i++) {
  210. if (data[i].paymentManagement) {
  211. if (data[i].paymentManagement.approveStatus || data[i].paymentManagement.status !=
  212. '待结算') {
  213. data[i].allow = 2
  214. }
  215. } else {
  216. data[i].allow = 1
  217. }
  218. }
  219. if (flag) {
  220. this.dataList = data
  221. } else {
  222. this.dataList = this.dataList.concat(data)
  223. }
  224. if (res.data.data.records.length == 0) {
  225. this.isContent = true
  226. }
  227. console.log("--------------------------------")
  228. console.log("this.dataList", this.dataList)
  229. uni.hideLoading()
  230. })
  231. .catch(res => {
  232. uni.showToast({
  233. title: '系统异常,请联系管理员',
  234. icon: 'none',
  235. duration: 2000
  236. })
  237. uni.hideLoading()
  238. })
  239. },
  240. selectWarehouse() {
  241. this.isShowWarehouse = true
  242. },
  243. confirmWarehouse(e) {
  244. console.log(e)
  245. this.warehouseName = e[0].label
  246. this.dataList.warehouseName = e[0].label;
  247. this.cangid = e[0].value
  248. uni.setStorageSync("cangid", this.cangid)
  249. this.getList(true)
  250. },
  251. //毛重
  252. grossWeightClick(val) {
  253. console.log(val)
  254. val.warehouseName = this.warehouseName
  255. val.warehouseId = this.warehouseId
  256. uni.navigateTo({
  257. url: './grossWeightDetail?detailData=' + JSON.stringify(val)
  258. })
  259. },
  260. tareClick(val) {
  261. val.warehouseName = this.warehouseName
  262. val.warehouseId = this.warehouseId
  263. uni.navigateTo({
  264. url: './tareDetail?detailData=' + JSON.stringify(val)
  265. })
  266. }
  267. }
  268. }
  269. </script>
  270. <style scoped lang="scss">
  271. .top {
  272. background: white;
  273. padding: 20rpx;
  274. border-radius: 0 0 20rpx 40rpx;
  275. }
  276. .dropdown {
  277. display: flex;
  278. justify-content: space-between;
  279. align-items: center;
  280. position: relative;
  281. margin: 20rpx 0;
  282. padding: 0 13rpx;
  283. .right,
  284. .left {
  285. display: flex;
  286. align-items: center;
  287. }
  288. }
  289. .item-style {
  290. background: white;
  291. margin: 20rpx;
  292. padding: 20rpx;
  293. .row1 {
  294. display: flex;
  295. align-items: center;
  296. justify-content: space-between;
  297. .row1-left {
  298. display: flex;
  299. justify-content: flex-start;
  300. align-items: center;
  301. .left {
  302. margin-right: 20rpx;
  303. }
  304. .top-title {
  305. font-size: 32rpx;
  306. font-weight: 600;
  307. color: #333333;
  308. }
  309. .bottom {
  310. color: #878C9C;
  311. }
  312. .right {
  313. font-size: 28rpx;
  314. font-weight: 600;
  315. color: #333333;
  316. }
  317. }
  318. }
  319. .row2 {
  320. display: flex;
  321. background: #F9F9FA;
  322. border-radius: 10rpx;
  323. padding: 10rpx 0;
  324. justify-content: space-around;
  325. margin: 20rpx 0;
  326. color: #878C9C;
  327. padding-left: 24rpx;
  328. align-items: center;
  329. }
  330. .row3 {
  331. display: flex;
  332. margin-top: 30rpx;
  333. padding-left: 14rpx;
  334. .row3-item {
  335. display: flex;
  336. margin-right: 40rpx;
  337. align-items: center;
  338. .left {
  339. background: #22C572;
  340. border-radius: 10rpx;
  341. padding: 2rpx 10rpx;
  342. box-sizing: border-box;
  343. color: white;
  344. font-size: 12px;
  345. margin-right: 15rpx;
  346. }
  347. }
  348. }
  349. .row4 {
  350. display: flex;
  351. justify-content: flex-end;
  352. margin-top: 10px;
  353. .right {
  354. border: 1px solid #CDCDCD;
  355. border-radius: 45rpx;
  356. padding: 10rpx 30rpx;
  357. margin-left: 20rpx;
  358. }
  359. }
  360. }
  361. .status1,
  362. .status2,
  363. .status3 {
  364. padding: 8rpx 12rpx;
  365. border-radius: 50%;
  366. color: white;
  367. }
  368. .status1 {
  369. background: #FD714F;
  370. }
  371. .status2 {
  372. background: #22C572;
  373. }
  374. .status3 {
  375. background: #3296FA;
  376. }
  377. </style>