tareDetail.vue 16 KB

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