tareDetail.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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">{{detailData.warehouseName}}</view>
  10. </view>
  11. <view class="row">
  12. <view class="left">编号</view>
  13. <view class="right">{{detailData.number}}</view>
  14. </view>
  15. <view class="row">
  16. <view class="left">客户</view>
  17. <view class="right">{{detailData.customer}}</view>
  18. </view>
  19. <view class="row">
  20. <view class="left">车牌号</view>
  21. <view class="right">{{detailData.carNumber}}</view>
  22. </view>
  23. <view class="row">
  24. <view class="left">仓位号</view>
  25. <view class="right">{{detailData.binNumber}}</view>
  26. </view>
  27. <view class="row">
  28. <view class="left">囤位号</view>
  29. <view class="right">{{detailData.storageNumber}}</view>
  30. </view>
  31. <view class="row">
  32. <view class="left">货名</view>
  33. <view class="right">{{detailData.goodsName}}</view>
  34. </view>
  35. <view class="row row-bottom">
  36. <view class="left">毛重(公斤)</view>
  37. <view class="right">{{detailData.grossWeight}}</view>
  38. </view>
  39. <view class="row row-bottom">
  40. <view class="left">皮重(公斤)</view>
  41. <input class="right-bottom" placeholder="输入皮重" @input="changeInput" v-model="detailData.tare"></input>
  42. </view>
  43. <view v-if="detailData.qualityInspectionManagement.paramType == '2'" class="row row-bottom">
  44. <view class="left">扣重(公斤)</view>
  45. <input class="right-bottom" placeholder="输入扣重" @input="changeInput"
  46. v-model="detailData.buckleMiscellaneous"></input>
  47. </view>
  48. <view class="row row-bottom" style="border: 0;">
  49. <view class="left">净重(公斤)</view>
  50. <input class="right-bottom" disabled placeholder="自动计算" v-model="detailData.netWeight"></input>
  51. </view>
  52. <view class="row row-bottom">
  53. <view class="left">应收卸车过磅费(元)</view>
  54. <input disabled class="right-bottom" placeholder="未获取到卸车过磅费金额"
  55. v-model="detailData.receivableWeighingFee"></input>
  56. </view>
  57. <view class="row row-bottom" style="border: 0;">
  58. <view class="left">实收卸车过磅费(元)</view>
  59. <input disabled class="right-bottom" placeholder="输入卸车过磅费"
  60. v-model="detailData.actualWeighingFee"></input>
  61. </view>
  62. </view>
  63. <u-button type="primary" class="submit" @click="submit">提交</u-button>
  64. <u-toast ref="uToast" />
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. detailData: {
  72. tare: 0,
  73. buckleMiscellaneous: 0,
  74. qualityInspectionManagement:{}
  75. },
  76. purchasePriceList: []
  77. }
  78. },
  79. onShow() {
  80. this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
  81. warehouseId: this.detailData.warehouseId
  82. }).then(res => {
  83. if (res.data.code == 200) {
  84. this.purchasePriceList = res.data.data
  85. }
  86. })
  87. },
  88. onLoad(options) {
  89. this.detailData = JSON.parse(options.detailData)
  90. console.log(this.detailData)
  91. if (!this.detailData.buckleMiscellaneous) {
  92. this.detailData.buckleMiscellaneous = 0
  93. }
  94. },
  95. methods: {
  96. changeInput() {
  97. this.detailData.netWeight = (parseFloat(this.detailData.grossWeight) - parseFloat(this.detailData.tare) -
  98. parseFloat(this.detailData.buckleMiscellaneous)).toFixed(3)
  99. },
  100. submit() {
  101. let that = this;
  102. uni.showModal({
  103. content: "确定提交检斤信息?",
  104. success() {
  105. that.$api.doRequest('get', '/paymentManagement/cumulant', {
  106. compId: JSON.parse(localStorage.getItem('pcUserInfo')).data.compId,
  107. customerNumberCard: that.detailData.customerNumberCard,
  108. goodsName: that.detailData.goodsName,
  109. }).then(res => {
  110. if (res.data.code == 200) {
  111. for (let i = 0; i < that.purchasePriceList.length; i++) {
  112. if (
  113. that.detailData.goodsName == that.purchasePriceList[i]
  114. .goodsName
  115. ) {
  116. let count = (that.purchasePriceList[i].saleLimit -
  117. res.data.data / 1000).toFixed(2)
  118. if (count <= 0) {
  119. count = 0
  120. that.$api.msg('该客户累计销售' + this.detailData.goodsName + (
  121. res.data.data / 1000).toFixed(2) +
  122. '吨,还可售粮' +
  123. count + '吨', )
  124. } else {
  125. that.$api.doRequest('post', '/weighingManagement/api/editTare',
  126. that.detailData).then(res => {
  127. if (res.data.code == 200) {
  128. that.$refs.uToast.show({
  129. title: '提交成功',
  130. type: 'success'
  131. })
  132. uni.navigateBack({})
  133. } else {
  134. that.$refs.uToast.show({
  135. title: '提交失败',
  136. type: 'error',
  137. })
  138. }
  139. })
  140. }
  141. }
  142. }
  143. }
  144. })
  145. }
  146. })
  147. }
  148. }
  149. }
  150. </script>
  151. <style scoped lang="scss">
  152. uni-page-body {
  153. overflow: hidden;
  154. }
  155. .warp {
  156. background: white;
  157. margin: 20rpx;
  158. padding: 20rpx;
  159. border-radius: 20rpx;
  160. .title {
  161. font-size: 28rpx;
  162. font-weight: 500;
  163. color: #333333;
  164. }
  165. }
  166. .content {
  167. .row {
  168. display: flex;
  169. justify-content: space-between;
  170. padding: 21rpx 0;
  171. .right {
  172. font-size: 28rpx;
  173. // font-weight: 600;
  174. color: #333333;
  175. }
  176. }
  177. .row-bottom {
  178. // border: 0;
  179. .right-bottom {
  180. width: 300rpx;
  181. font-size: 28rpx;
  182. font-weight: 600;
  183. color: #333333;
  184. text-align: right;
  185. }
  186. }
  187. }
  188. .submit {
  189. position: fixed;
  190. bottom: 40rpx;
  191. width: 90%;
  192. background: #22C572;
  193. border-radius: 50rpx;
  194. }
  195. </style>