warehouseWeighing.vue 8.4 KB

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