acquisitionInspection.vue 10 KB

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