acquisitionInspection.vue 10.0 KB

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