grossWeightDetail.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="warp">
  3. <view class="title">
  4. 基本信息
  5. </view>
  6. <view class="content">
  7. <view class="row">
  8. <view class="left">入库类型</view>
  9. <view class="right" v-if='detailData.serviceManagementType==3'>收购入库</view>
  10. <view class="right" v-if='detailData.serviceManagementType==1'>贸易入库</view>
  11. </view>
  12. <view class="row">
  13. <view class="left">仓库</view>
  14. <view class="right">{{detailData.warehouseName}}</view>
  15. </view>
  16. <view class="row">
  17. <view class="left">编号</view>
  18. <view class="right">{{detailData.number}}</view>
  19. </view>
  20. <view class="row">
  21. <view class="left">客户</view>
  22. <view class="right">{{detailData.customer}}</view>
  23. </view>
  24. <view class="row">
  25. <view class="left">车牌号</view>
  26. <view class="right">{{detailData.carNumber}}</view>
  27. </view>
  28. <view class="row">
  29. <view class="left">仓位号</view>
  30. <view class="right">{{detailData.binNumber}}</view>
  31. </view>
  32. <view class="row">
  33. <view class="left">囤位号</view>
  34. <view class="right">{{detailData.storageNumber}}</view>
  35. </view>
  36. <view class="row">
  37. <view class="left">货名</view>
  38. <view class="right">{{detailData.goodsName}}</view>
  39. </view>
  40. <view class="row">
  41. <view class="left">运输方式</view>
  42. <view class="right">{{detailData.outType}}</view>
  43. </view>
  44. <view class="row">
  45. <view class="left">箱号-1</view>
  46. <view class="right">{{detailData.qualityInspectionManagement.boxNo}}</view>
  47. </view>
  48. <view class="row">
  49. <view class="left">箱号-2</view>
  50. <view class="right">{{detailData.qualityInspectionManagement.boxNoOther}}</view>
  51. </view>
  52. <view class="row">
  53. <view class="left">封号-1</view>
  54. <view class="right">{{detailData.qualityInspectionManagement.titleNo}}</view>
  55. </view>
  56. <view class="row">
  57. <view class="left">封号-2</view>
  58. <view class="right">{{detailData.qualityInspectionManagement.titleNoOther}}</view>
  59. </view>
  60. <view class="row row-bottom">
  61. <view class="left">毛重(公斤)</view>
  62. <input class="right-bottom" placeholder="输入毛重" v-model="detailData.grossWeight"></input>
  63. </view>
  64. </view>
  65. <u-button v-if='tabbar' type="primary" class="submit" @click="submit">提交</u-button>
  66. <u-toast ref="uToast" />
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. data() {
  72. return {
  73. tabbar: true,
  74. windowHeight: '',
  75. detailData: {
  76. grossWeight: ''
  77. },
  78. purchasePriceList: []
  79. }
  80. },
  81. onShow() {
  82. this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
  83. warehouseId: this.detailData.warehouseId
  84. }).then(res => {
  85. if (res.data.code == 200) {
  86. this.purchasePriceList = res.data.data
  87. }
  88. })
  89. },
  90. onLoad(options) {
  91. uni.onWindowResize((res) => {
  92. if (res.size.windowHeight < this.windowHeight) {
  93. this.tabbar = false
  94. } else {
  95. this.tabbar = true
  96. }
  97. })
  98. this.detailData = JSON.parse(options.detailData)
  99. console.log(this.detailData)
  100. uni.getSystemInfo({
  101. success: (res) => {
  102. this.windowHeight = res.windowHeight;
  103. // console.log(res)
  104. this.system = res.system // ios
  105. this.platform = res.platform // 14.3
  106. }
  107. })
  108. console.log(this.detailData)
  109. },
  110. methods: {
  111. submit() {
  112. let that = this
  113. uni.showModal({
  114. content: "确定提交检斤信息?",
  115. success: function(res) {
  116. if (res.confirm) {
  117. if(that.detailData.serviceManagementType==1){
  118. that.$api.doRequest('post',
  119. '/weighingManagement/api/editGrossWeight', that
  120. .detailData).then(res => {
  121. that.detailData.inOutFlag = 2
  122. that.detailData.statusFlag=1
  123. that.detailData.grossWeight=that.detailData.grossWeight/1000
  124. that.detailData.warehouseInOutDetail={
  125. id:that.detailData.inOutDetailId,
  126. grade:that.detailData.qualityInspectionManagement.grade,
  127. reGrade:that.detailData.qualityInspectionManagement.reGrade,
  128. imperfectGrain:that.detailData.qualityInspectionManagement.imperfectGrain,
  129. reImperfectGrain:that.detailData.qualityInspectionManagement.reImperfectGrain,
  130. impurity:that.detailData.qualityInspectionManagement.impurity,
  131. reImpurity:that.detailData.qualityInspectionManagement.reImpurity,
  132. jiaorenli:that.detailData.qualityInspectionManagement.jiaorenli,
  133. reJiaorenli:that.detailData.qualityInspectionManagement.reJiaorenli,
  134. bulkDensity:that.detailData.qualityInspectionManagement.bulkDensity,
  135. reBulkDensity:that.detailData.qualityInspectionManagement.reBulkDensity,
  136. mildewGrain:that.detailData.qualityInspectionManagement.mildewGrain,
  137. reMildewGrain:that.detailData.qualityInspectionManagement.reMildewGrain,
  138. },
  139. that.$api.doRequest('post',
  140. '/warehouseInOutInfo/InOutWarehouse', that
  141. .detailData).then(res => {
  142. if (res.data.code == 200) {
  143. that.$refs.uToast.show({
  144. title: '提交成功',
  145. type: 'success'
  146. })
  147. uni.navigateBack({})
  148. } else {
  149. that.$refs.uToast.show({
  150. title: '提交失败',
  151. type: 'error',
  152. })
  153. }
  154. })
  155. })
  156. }else{
  157. that.$api.doRequest('get', '/paymentManagement/cumulant', {
  158. // compId: JSON.parse(localStorage.getItem('pcUserInfo')).data.compId,
  159. compId: uni.getStorageSync('pcUserInfo').compId,
  160. customerNumberCard: that.detailData.customerNumberCard,
  161. goodsName: that.detailData.goodsName,
  162. }).then(res => {
  163. if (res.data.code == 200) {
  164. for (let i = 0; i < that.purchasePriceList.length; i++) {
  165. if (
  166. that.detailData.goodsName == that.purchasePriceList[i]
  167. .goodsName
  168. ) {
  169. let count = (that.purchasePriceList[i].saleLimit -
  170. res.data.data / 1000).toFixed(2)
  171. if (Number(count) - that.detailData.grossWeight / 1000 <= 0) {
  172. that.$api.msg('该客户累计销售' + that.detailData.goodsName + (
  173. res.data.data / 1000).toFixed(2) +
  174. '吨,还可售粮' +
  175. count + '吨', )
  176. } else {
  177. that.$api.doRequest('post',
  178. '/weighingManagement/api/editGrossWeight', that
  179. .detailData).then(res => {
  180. if (res.data.code == 200) {
  181. that.$refs.uToast.show({
  182. title: '提交成功',
  183. type: 'success'
  184. })
  185. uni.navigateBack({})
  186. } else {
  187. that.$refs.uToast.show({
  188. title: '提交失败',
  189. type: 'error',
  190. })
  191. }
  192. })
  193. }
  194. }
  195. }
  196. }
  197. })
  198. }
  199. } else if (res.cancel) {
  200. console.log('用户点击取消');
  201. }
  202. }
  203. })
  204. }
  205. }
  206. }
  207. </script>
  208. <style scoped lang="scss">
  209. uni-page-body {
  210. overflow: hidden;
  211. }
  212. .warp {
  213. background: white;
  214. margin: 20rpx;
  215. padding: 20rpx;
  216. border-radius: 20rpx;
  217. .title {
  218. font-size: 28rpx;
  219. font-weight: 500;
  220. color: #333333;
  221. }
  222. }
  223. .content {
  224. margin-bottom:50px;
  225. .row {
  226. display: flex;
  227. justify-content: space-between;
  228. padding: 31rpx 0;
  229. .right {
  230. font-size: 28rpx;
  231. font-weight: 600;
  232. color: #333333;
  233. }
  234. }
  235. .row-bottom {
  236. border: 0;
  237. .right-bottom {
  238. width: 300rpx;
  239. text-align: right;
  240. font-size: 28rpx;
  241. font-weight: 600;
  242. color: #333333;
  243. }
  244. }
  245. }
  246. .submit {
  247. position: fixed;
  248. bottom: 40rpx;
  249. width: 90%;
  250. background: #22C572;
  251. border-radius: 50rpx;
  252. }
  253. </style>