tareDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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 v-if='detailData.serviceManagementType==3' 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">
  36. <view class="left">运输方式</view>
  37. <view class="right">{{detailData.outType}}</view>
  38. </view>
  39. <view class="row">
  40. <view class="left">箱号-1</view>
  41. <view class="right">{{detailData.qualityInspectionManagement.boxNo}}</view>
  42. </view>
  43. <view class="row">
  44. <view class="left">箱号-2</view>
  45. <view class="right">{{detailData.qualityInspectionManagement.boxNoOther}}</view>
  46. </view>
  47. <view class="row">
  48. <view class="left">封号-1</view>
  49. <view class="right">{{detailData.qualityInspectionManagement.titleNo}}</view>
  50. </view>
  51. <view class="row">
  52. <view class="left">封号-2</view>
  53. <view class="right">{{detailData.qualityInspectionManagement.titleNoOther}}</view>
  54. </view>
  55. <view class="row row-bottom">
  56. <view class="left">毛重(公斤)</view>
  57. <view class="right">{{detailData.grossWeight}}</view>
  58. </view>
  59. <view class="row row-bottom">
  60. <view class="left">皮重(公斤)</view>
  61. <input class="right-bottom" placeholder="输入皮重" @input="changeInput" v-model="detailData.tare"></input>
  62. </view>
  63. <view v-if="detailData.qualityInspectionManagement.paramType == '2'" class="row row-bottom">
  64. <view class="left">扣重(公斤)</view>
  65. <input class="right-bottom" placeholder="输入扣重" @input="changeInput"
  66. v-model="detailData.buckleMiscellaneous"></input>
  67. </view>
  68. <view class="row row-bottom" style="border: 0;">
  69. <view class="left">净重(公斤)</view>
  70. <input class="right-bottom" disabled placeholder="自动计算" v-model="detailData.netWeight"></input>
  71. </view>
  72. <view class="row row-bottom">
  73. <view class="left">应收卸车过磅费(元)</view>
  74. <input disabled class="right-bottom" placeholder="未获取到卸车过磅费金额"
  75. v-model="detailData.receivableWeighingFee"></input>
  76. </view>
  77. <view class="row row-bottom" style="border: 0;">
  78. <view class="left">实收卸车过磅费(元)</view>
  79. <input disabled class="right-bottom" placeholder="输入卸车过磅费"
  80. v-model="detailData.actualWeighingFee"></input>
  81. </view>
  82. </view>
  83. <u-button type="primary" class="submit" @click="submit">提交</u-button>
  84. <u-toast ref="uToast" />
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. detailData: {
  92. tare: 0,
  93. buckleMiscellaneous: 0,
  94. qualityInspectionManagement:{}
  95. },
  96. purchasePriceList: []
  97. }
  98. },
  99. onShow() {
  100. this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
  101. warehouseId: this.detailData.warehouseId
  102. }).then(res => {
  103. if (res.data.code == 200) {
  104. this.purchasePriceList = res.data.data
  105. }
  106. })
  107. },
  108. onLoad(options) {
  109. this.detailData = JSON.parse(options.detailData)
  110. console.log(this.detailData)
  111. if(this.detailData.qualityInspectionManagement.carModel=='单拖小柜'){
  112. this.detailData.receivableWeighingFee=80
  113. this.detailData.actualWeighingFee=80
  114. }else if(this.detailData.qualityInspectionManagement.carModel=='双拖小柜'){
  115. this.detailData.receivableWeighingFee=160
  116. this.detailData.actualWeighingFee=160
  117. }else if(this.detailData.qualityInspectionManagement.carModel=='大柜'){
  118. if((this.detailData.grossWeight/1000)<50){
  119. this.$set(this.detailData,'receivableWeighingFee',120)
  120. this.detailData.actualWeighingFee=120
  121. }else if((this.detailData.grossWeight/1000)>50||(this.detailData.grossWeight/1000)<65){
  122. this.detailData.receivableWeighingFee=150
  123. this.detailData.actualWeighingFee=150
  124. }else if((this.detailData.grossWeight/1000)>65||(this.detailData.grossWeight/1000)<75){
  125. this.detailData.receivableWeighingFee=170
  126. this.detailData.actualWeighingFee=170
  127. }else if((this.detailData.grossWeight/1000)>75||(this.detailData.grossWeight/1000)<80){
  128. this.detailData.receivableWeighingFee=190
  129. this.detailData.actualWeighingFee=190
  130. }else if((this.detailData.grossWeight/1000)>80||(this.detailData.grossWeight/1000)<85){
  131. this.detailData.receivableWeighingFee=210
  132. this.detailData.actualWeighingFee=210
  133. }else if((this.detailData.grossWeight/1000)>85||(this.detailData.grossWeight/1000)<95){
  134. this.detailData.receivableWeighingFee=240
  135. this.detailData.actualWeighingFee=240
  136. }else if((this.detailData.grossWeight/1000)>95||(this.detailData.grossWeight/1000)<105){
  137. this.detailData.receivableWeighingFee=260
  138. this.detailData.actualWeighingFee=260
  139. }else if((this.detailData.grossWeight/1000)>105||(this.detailData.grossWeight/1000)<150){
  140. this.detailData.receivableWeighingFee=300
  141. this.detailData.actualWeighingFee=300
  142. }
  143. }else if(this.detailData.qualityInspectionManagement.carModel=='挂车'){
  144. if((this.detailData.grossWeight/1000)<50){
  145. this.detailData.receivableWeighingFee=180
  146. this.detailData.actualWeighingFee=180
  147. }else if((this.detailData.grossWeight/1000)>50||(this.detailData.grossWeight/1000)<65){
  148. this.detailData.receivableWeighingFee=200
  149. this.detailData.actualWeighingFee=200
  150. }else if((this.detailData.grossWeight/1000)>65||(this.detailData.grossWeight/1000)<75){
  151. this.detailData.receivableWeighingFee=250
  152. this.detailData.actualWeighingFee=250
  153. }else if((this.detailData.grossWeight/1000)>75||(this.detailData.grossWeight/1000)<85){
  154. this.detailData.receivableWeighingFee=350
  155. this.detailData.actualWeighingFee=350
  156. }else if((this.detailData.grossWeight/1000)>85||(this.detailData.grossWeight/1000)<95){
  157. this.detailData.receivableWeighingFee=400
  158. this.detailData.actualWeighingFee=400
  159. }else if((this.detailData.grossWeight/1000)>95||(this.detailData.grossWeight/1000)<105){
  160. this.detailData.receivableWeighingFee=450
  161. this.detailData.actualWeighingFee=450
  162. }else if((this.detailData.grossWeight/1000)>105||(this.detailData.grossWeight/1000)<120){
  163. this.detailData.receivableWeighingFee=500
  164. this.detailData.actualWeighingFee=500
  165. }else if((this.detailData.grossWeight/1000)>120||(this.detailData.grossWeight/1000)<130){
  166. this.detailData.receivableWeighingFee=550
  167. this.detailData.actualWeighingFee=550
  168. }else if((this.detailData.grossWeight/1000)>130||(this.detailData.grossWeight/1000)<150){
  169. this.detailData.receivableWeighingFee=700
  170. this.detailData.actualWeighingFee=700
  171. }
  172. }else if(this.detailData.qualityInspectionManagement.carModel=='冷藏箱(不抠箱)'){
  173. if((this.detailData.grossWeight/1000)<50){
  174. this.detailData.receivableWeighingFee=120
  175. this.detailData.actualWeighingFee=120
  176. }else if((this.detailData.grossWeight/1000)>50||(this.detailData.grossWeight/1000)<65){
  177. this.detailData.receivableWeighingFee=150
  178. this.detailData.actualWeighingFee=150
  179. }else if((this.detailData.grossWeight/1000)>65||(this.detailData.grossWeight/1000)<75){
  180. this.detailData.receivableWeighingFee=170
  181. this.detailData.actualWeighingFee=170
  182. }else if((this.detailData.grossWeight/1000)>75||(this.detailData.grossWeight/1000)<80){
  183. this.detailData.receivableWeighingFee=190
  184. this.detailData.actualWeighingFee=190
  185. }else if((this.detailData.grossWeight/1000)>80||(this.detailData.grossWeight/1000)<85){
  186. this.detailData.receivableWeighingFee=210
  187. this.detailData.actualWeighingFee=210
  188. }else if((this.detailData.grossWeight/1000)>85||(this.detailData.grossWeight/1000)<95){
  189. this.detailData.receivableWeighingFee=240
  190. this.detailData.actualWeighingFee=240
  191. }else if((this.detailData.grossWeight/1000)>95||(this.detailData.grossWeight/1000)<105){
  192. this.detailData.receivableWeighingFee=260
  193. this.detailData.actualWeighingFee=260
  194. }else if((this.detailData.grossWeight/1000)>105||(this.detailData.grossWeight/1000)<120){
  195. this.detailData.receivableWeighingFee=300
  196. this.detailData.actualWeighingFee=300
  197. }
  198. }else if(this.detailData.qualityInspectionManagement.carModel=='冷藏箱(抠箱)'){
  199. if((this.detailData.grossWeight/1000)<50){
  200. this.detailData.receivableWeighingFee=360
  201. this.detailData.actualWeighingFee=360
  202. }else if((this.detailData.grossWeight/1000)>50||(this.detailData.grossWeight/1000)<65){
  203. this.detailData.receivableWeighingFee=390
  204. this.detailData.actualWeighingFee=390
  205. }else if((this.detailData.grossWeight/1000)>65||(this.detailData.grossWeight/1000)<75){
  206. this.detailData.receivableWeighingFee=410
  207. this.detailData.actualWeighingFee=410
  208. }else if((this.detailData.grossWeight/1000)>75||(this.detailData.grossWeight/1000)<80){
  209. this.detailData.receivableWeighingFee=430
  210. this.detailData.actualWeighingFee=430
  211. }else if((this.detailData.grossWeight/1000)>80||(this.detailData.grossWeight/1000)<85){
  212. this.detailData.receivableWeighingFee=450
  213. this.detailData.actualWeighingFee=450
  214. }else if((this.detailData.grossWeight/1000)>85||(this.detailData.grossWeight/1000)<95){
  215. this.detailData.receivableWeighingFee=480
  216. this.detailData.actualWeighingFee=480
  217. }else if((this.detailData.grossWeight/1000)>95||(this.detailData.grossWeight/1000)<105){
  218. this.detailData.receivableWeighingFee=500
  219. this.detailData.actualWeighingFee=500
  220. }else if((this.detailData.grossWeight/1000)>105||(this.detailData.grossWeight/1000)<120){
  221. this.detailData.receivableWeighingFee=540
  222. this.detailData.actualWeighingFee=540
  223. }
  224. }else {
  225. this.detailData.receivableWeighingFee=''
  226. }
  227. if (!this.detailData.buckleMiscellaneous) {
  228. this.detailData.buckleMiscellaneous = 0
  229. }
  230. },
  231. methods: {
  232. changeInput() {
  233. this.detailData.netWeight = (parseFloat(this.detailData.grossWeight) - parseFloat(this.detailData.tare) -
  234. parseFloat(this.detailData.buckleMiscellaneous)).toFixed(3)
  235. },
  236. submit() {
  237. if (this.detailData.qualityInspectionManagement.confirm==0) {
  238. this.$refs.uToast.show({
  239. title: '该条质检信息未确认',
  240. type: 'error'
  241. })
  242. return
  243. }
  244. let that = this;
  245. uni.showModal({
  246. content: "确定提交检斤信息?",
  247. success() {
  248. if(that.detailData.serviceManagementType==1){
  249. that.$api.doRequest('post', '/weighingManagement/api/editTare',that.detailData).then(res => {
  250. that.$api.doRequest('get', '/warehouseInOutInfo/getInfo',
  251. {id:that.detailData.warehouseInOutId}).then(res => {
  252. var data=res.data.data
  253. data.statusFlag=3
  254. data.inOutFlag=2
  255. data.warehouseType=that.detailData.warehouseType
  256. data.baseId=that.detailData.warehouseInOutId
  257. data.grossWeight=that.detailData.grossWeight/1000
  258. data.tare=that.detailData.tare/1000
  259. data.netWeight=that.detailData.netWeight/1000
  260. data.deductionAmount=that.detailData.deductionAmount*1000
  261. data.deductionWeight=that.detailData.deductionWeight/1000
  262. that.$api.doRequest('post',
  263. '/warehouseInOutInfo/InOutWarehouse', data).then(res => {
  264. if (res.data.code == 200) {
  265. that.$refs.uToast.show({
  266. title: '提交成功',
  267. type: 'success'
  268. })
  269. uni.navigateBack({})
  270. } else {
  271. that.$refs.uToast.show({
  272. title: '提交失败',
  273. type: 'error',
  274. })
  275. }
  276. })
  277. })
  278. })
  279. }else{
  280. that.$api.doRequest('get', '/paymentManagement/cumulant', {
  281. compId: JSON.parse(localStorage.getItem('pcUserInfo')).data.compId,
  282. customerNumberCard: that.detailData.customerNumberCard,
  283. goodsName: that.detailData.goodsName,
  284. }).then(res => {
  285. if (res.data.code == 200) {
  286. for (let i = 0; i < that.purchasePriceList.length; i++) {
  287. if (
  288. that.detailData.goodsName == that.purchasePriceList[i]
  289. .goodsName
  290. ) {
  291. let count = (that.purchasePriceList[i].saleLimit -
  292. res.data.data / 1000).toFixed(2)
  293. if (count <= 0) {
  294. count = 0
  295. that.$api.msg('该客户累计销售' + this.detailData.goodsName + (
  296. res.data.data / 1000).toFixed(2) +
  297. '吨,还可售粮' +
  298. count + '吨', )
  299. } else {
  300. that.$api.doRequest('post', '/weighingManagement/api/editTare',
  301. that.detailData).then(res => {
  302. if (res.data.code == 200) {
  303. that.$refs.uToast.show({
  304. title: '提交成功',
  305. type: 'success'
  306. })
  307. uni.navigateBack({})
  308. } else {
  309. that.$refs.uToast.show({
  310. title: '提交失败',
  311. type: 'error',
  312. })
  313. }
  314. })
  315. }
  316. }
  317. }
  318. }
  319. })
  320. }
  321. }
  322. })
  323. }
  324. }
  325. }
  326. </script>
  327. <style scoped lang="scss">
  328. uni-page-body {
  329. overflow: hidden;
  330. }
  331. .warp {
  332. background: white;
  333. margin: 20rpx;
  334. padding: 20rpx;
  335. border-radius: 20rpx;
  336. .title {
  337. font-size: 28rpx;
  338. font-weight: 500;
  339. color: #333333;
  340. }
  341. }
  342. .content {
  343. .row {
  344. display: flex;
  345. justify-content: space-between;
  346. padding: 21rpx 0;
  347. .right {
  348. font-size: 28rpx;
  349. // font-weight: 600;
  350. color: #333333;
  351. }
  352. }
  353. .row-bottom {
  354. // border: 0;
  355. .right-bottom {
  356. width: 300rpx;
  357. font-size: 28rpx;
  358. font-weight: 600;
  359. color: #333333;
  360. text-align: right;
  361. }
  362. }
  363. }
  364. .submit {
  365. position: fixed;
  366. bottom: 40rpx;
  367. width: 90%;
  368. background: #22C572;
  369. border-radius: 50rpx;
  370. }
  371. </style>