acquisitionInspection.vue 9.3 KB

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