warehouseWeighing.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <u-search placeholder="输入编号/客户号/车牌号" v-model="inputKeyword" @search="getList()"></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" :list="warehouseList" @confirm="confirmWarehouse"></u-select>
  16. </view>
  17. <view class="middle">
  18. <view class="item-style" v-for="(item,index) in dataList" :key="index" @click="toDetail(item)">
  19. <view class="row1">
  20. <view class="row1-left">
  21. <view class="left status1" v-if="item.status=='已质检'">检</view>
  22. <view class="left status2" v-if="item.status=='已称皮重'">皮</view>
  23. <view class="left status3" v-if="item.status=='已称毛重'">毛</view>
  24. <view>
  25. <view class="top-title">
  26. {{item.contractNo}}
  27. </view>
  28. <view class="bottom">{{item.updateDate}}</view>
  29. </view>
  30. </view>
  31. <view class="right">{{item.customer}}</view>
  32. </view>
  33. <view class="row2" v-if="item.paymentManagement">
  34. <view>{{item.paymentManagement.customerName}}</view>
  35. <view>{{item.paymentManagement.carNo}}</view>
  36. <view>{{item.paymentManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)</view>
  37. </view>
  38. <view class="row3">
  39. <view class="row3-item">
  40. <view class="left">皮</view>
  41. <view>{{item.tare?item.tare:'未称重'}}</view>
  42. </view>
  43. <view class="row3-item">
  44. <view class="left">毛</view>
  45. <view>{{item.grossWeight?item.grossWeight:'未称重'}}</view>
  46. </view>
  47. <view class="row3-item">
  48. <view class="left">净</view>
  49. <view>{{item.netWeight?item.netWeight:'未称重'}}</view>
  50. </view>
  51. </view>
  52. <view class="row4">
  53. <view v-if="item.status!='已称毛重'" class="right" @click.stop="tareClick(item)">皮重</view>
  54. <view v-if="!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
  55. !(item.paymentManagement&&item.paymentManagement.status=='部分收款')
  56. " class="right" :class="item.status=='已质检'?'gray':''" @click.stop="grossWeightClick(item)">毛重</view>
  57. <view class="right" @click.stop="delClick(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. <u-toast ref="uToast" />
  65. <view class="footer">
  66. <view @click='add' class="button">新增</view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import {
  72. mapState
  73. } from 'vuex';
  74. import helper from '@/common/helper.js';
  75. export default {
  76. data() {
  77. return {
  78. inputKeyword: '',
  79. warehouseName: '',
  80. isShowWarehouse: false,
  81. warehouseList: [],
  82. isContent:false,
  83. loadStatus:'noMore',
  84. dataList: [],
  85. pageSize:10,
  86. currentPage:1,
  87. cangId:''
  88. }
  89. },
  90. computed: {
  91. ...mapState(['hasLogin', 'userInfo'])
  92. },
  93. onShow() {
  94. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  95. if (res.data.data == "INVALID") {
  96. uni.showModal({
  97. title: "登录提示",
  98. content: "Session过期需要重新登录,是否立即登录",
  99. showCancel: true,
  100. confirmText: '登录',
  101. success(e) {
  102. if (e.confirm) {
  103. uni.navigateTo({
  104. url: '/pages/public/login'
  105. })
  106. }
  107. }
  108. })
  109. } else {
  110. this.compId = uni.getStorageSync('pcUserInfo').compId
  111. console.log("compId", this.compId)
  112. this.loadData()
  113. }
  114. })
  115. .catch(res => {
  116. if (res.message) {
  117. uni.showToast({
  118. title: res.message,
  119. icon: 'none',
  120. duration: 2000
  121. })
  122. }
  123. });
  124. },
  125. onPullDownRefresh() {
  126. this.currentPage=1
  127. this.gridList=[]
  128. this.getList()
  129. },
  130. onReachBottom() {
  131. this.currentPage+=1
  132. this.getList()
  133. // this.getMoreNews()
  134. },
  135. methods: {
  136. add(){
  137. uni.navigateTo({
  138. url:'/pages/erpbusiness/acquisitionInspection/add_check_the_weight?cangId='+this.cangId+'&warehouseName='+this.warehouseName
  139. })
  140. },
  141. loadData() {
  142. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
  143. compId: '',
  144. personCharge:this.userInfo.phone
  145. }).then(res => {
  146. console.log("warehouseBaseInfo", res)
  147. let _resData = res.data.data
  148. for (let i = 0; i < _resData.length; i++) {
  149. let _obj = {
  150. "label": _resData[i].warehouseName,
  151. "value": _resData[i].id,
  152. }
  153. this.warehouseList.push(_obj)
  154. }
  155. this.warehouseName = this.warehouseList[0].label
  156. this.cangId = this.warehouseList[0].value
  157. this.getList()
  158. })
  159. },
  160. //获取列表
  161. getList() {
  162. this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
  163. compId: '',
  164. currentPage: this.currentPage,
  165. pageSize: this.pageSize,
  166. searchKeyWord: this.inputKeyword,
  167. warehouseName: this.warehouseName,
  168. managementType: 3,
  169. }).then(res => {
  170. var data=res.data.data.records
  171. this.dataList = this.dataList.concat(data)
  172. console.log(res.data.data.records)
  173. if(res.data.data.records.length==0){
  174. this.isContent=true
  175. }
  176. // console.log("--------------------------------")
  177. // console.log("this.dataList",this.dataList)
  178. })
  179. },
  180. selectWarehouse() {
  181. this.isShowWarehouse = true
  182. },
  183. confirmWarehouse(e) {
  184. console.log(e)
  185. this.warehouseName = e[0].label
  186. this.cangId = e[0].value
  187. },
  188. //毛重
  189. grossWeightClick(item) {
  190. if (item.status == "已质检") return;
  191. console.log(item)
  192. uni.navigateTo({
  193. url: './grossWeightDetail1?id=' + item.id+'&cangId='+this.cangId
  194. })
  195. },
  196. tareClick(item) {
  197. //
  198. uni.navigateTo({
  199. url: './tareDetail1?id=' + item.id+'&cangId='+this.cangId
  200. })
  201. },
  202. delClick(val) {
  203. console.log(val)
  204. let that = this;
  205. uni.showModal({
  206. content: "确定删除检斤信息?",
  207. success: function(res) {
  208. if (res.confirm) {
  209. console.log(that.detailData)
  210. that.$api.doRequest('post', '/weighingManagement/api/deleteWeightcheck', {
  211. id: val.id
  212. }).then(res => {
  213. if (res.data.code == 200) {
  214. that.$refs.uToast.show({
  215. title: '删除成功',
  216. type: 'success',
  217. url: '/pages/erpbusiness/acquisitionInspection/warehouseWeighing'
  218. })
  219. } else {
  220. that.$refs.uToast.show({
  221. title: '删除失败',
  222. type: 'error',
  223. })
  224. }
  225. })
  226. } else if (res.cancel) {
  227. console.log('用户点击取消');
  228. }
  229. //
  230. }
  231. })
  232. },
  233. toDetail(item) {
  234. uni.navigateTo({
  235. url: './tareDetail2?id=' + item.id+'&cangId='+this.cangId
  236. })
  237. }
  238. }
  239. }
  240. </script>
  241. <style scoped lang="scss">
  242. .top {
  243. background: white;
  244. padding: 20rpx;
  245. border-radius: 0 0 20rpx 40rpx;
  246. }
  247. .dropdown {
  248. display: flex;
  249. justify-content: space-between;
  250. align-items: center;
  251. position: relative;
  252. margin: 20rpx 0;
  253. padding: 0 13rpx;
  254. .right,
  255. .left {
  256. display: flex;
  257. align-items: center;
  258. }
  259. }
  260. .item-style {
  261. background: white;
  262. margin: 20rpx;
  263. padding: 20rpx;
  264. .row1 {
  265. display: flex;
  266. align-items: center;
  267. justify-content: space-between;
  268. .row1-left {
  269. display: flex;
  270. justify-content: flex-start;
  271. align-items: center;
  272. .left {
  273. margin-right: 20rpx;
  274. }
  275. .top-title {
  276. font-size: 32rpx;
  277. font-weight: 600;
  278. color: #333333;
  279. }
  280. .bottom {
  281. color: #878C9C;
  282. }
  283. .right {
  284. font-size: 28rpx;
  285. font-weight: 600;
  286. color: #333333;
  287. }
  288. }
  289. }
  290. .row2 {
  291. display: flex;
  292. background: #F9F9FA;
  293. border-radius: 10rpx;
  294. padding: 10rpx 0;
  295. justify-content: space-evenly;
  296. margin: 20rpx;
  297. color: #878C9C;
  298. }
  299. .row3 {
  300. display: flex;
  301. margin-top: 20rpx;
  302. .row3-item {
  303. display: flex;
  304. margin-right: 40rpx;
  305. .left {
  306. background: #22C572;
  307. border-radius: 10rpx;
  308. padding: 2rpx 10rpx;
  309. box-sizing: border-box;
  310. color: white;
  311. font-size: 12px;
  312. margin-right: 15rpx;
  313. }
  314. }
  315. }
  316. .row4 {
  317. margin-top: 10px;
  318. display: flex;
  319. justify-content: flex-end;
  320. .right {
  321. border: 1px solid #CDCDCD;
  322. border-radius: 45rpx;
  323. padding: 10rpx 30rpx;
  324. margin-left: 20rpx;
  325. }
  326. }
  327. }
  328. .status1,
  329. .status2,
  330. .status3 {
  331. padding: 8rpx 12rpx;
  332. border-radius: 50%;
  333. color: white;
  334. }
  335. .status1 {
  336. background: #FD714F;
  337. }
  338. .status2 {
  339. background: #22C572;
  340. }
  341. .status3 {
  342. background: #3296FA;
  343. }
  344. .gray {}
  345. .footer{
  346. background:#fff;
  347. position:fixed;
  348. bottom:0;
  349. width:100%;
  350. padding:20px 10px;
  351. z-index:10;
  352. .button{
  353. background:#22C572;
  354. width:90%;
  355. margin:0 auto;
  356. padding:10px;
  357. color:#fff;
  358. text-align:center;
  359. border-radius: 30px;
  360. }
  361. }
  362. </style>