grossWeightDetail.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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 v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
  45. <view class="left">箱号-1</view>
  46. <view class="right">{{detailData.qualityInspectionManagement.boxNo}}</view>
  47. </view>
  48. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
  49. <view class="left">箱号-2</view>
  50. <view class="right">{{detailData.qualityInspectionManagement.boxNoOther}}</view>
  51. </view>
  52. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"'class="row">
  53. <view class="left">封号-1</view>
  54. <view class="right">{{detailData.qualityInspectionManagement.titleNo}}</view>
  55. </view>
  56. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' 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. import {
  71. mapState
  72. } from 'vuex';
  73. export default {
  74. data() {
  75. return {
  76. tabbar: true,
  77. windowHeight: '',
  78. detailData: {
  79. grossWeight: ''
  80. },
  81. purchasePriceList: []
  82. }
  83. },
  84. onShow() {
  85. this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
  86. warehouseId: this.detailData.warehouseId
  87. }).then(res => {
  88. if (res.data.code == 200) {
  89. this.purchasePriceList = res.data.data
  90. }
  91. })
  92. },
  93. onLoad(options) {
  94. uni.onWindowResize((res) => {
  95. if (res.size.windowHeight < this.windowHeight) {
  96. this.tabbar = false
  97. } else {
  98. this.tabbar = true
  99. }
  100. })
  101. this.detailData = JSON.parse(options.detailData)
  102. console.log(this.detailData)
  103. uni.getSystemInfo({
  104. success: (res) => {
  105. this.windowHeight = res.windowHeight;
  106. // console.log(res)
  107. this.system = res.system // ios
  108. this.platform = res.platform // 14.3
  109. }
  110. })
  111. console.log(this.detailData)
  112. },
  113. computed: {
  114. ...mapState(['hasLogin', 'userInfo']),
  115. },
  116. methods: {
  117. submit() {
  118. if(!this.detailData.grossWeight){
  119. this.$refs.uToast.show({ title: '请输入毛重', type: 'error'})
  120. return
  121. }
  122. let that = this
  123. uni.showModal({
  124. content: "确定提交检斤信息?",
  125. success: function(res) {
  126. if (res.confirm) {
  127. if(that.detailData.serviceManagementType==1){
  128. var data=that.detailData
  129. data.secretaryWeigher=that.userInfo.userName;
  130. data.weighingManagement=JSON.parse(JSON.stringify(that.detailData))
  131. data.inOutFlag = 2
  132. data.statusFlag=1
  133. data.grossWeight=that.detailData.grossWeight/1000
  134. data.warehouseInOutDetail={
  135. id:that.detailData.inOutDetailId,
  136. grade:that.detailData.qualityInspectionManagement.grade,
  137. reGrade:that.detailData.qualityInspectionManagement.reGrade,
  138. imperfectGrain:that.detailData.qualityInspectionManagement.imperfectGrain,
  139. reImperfectGrain:that.detailData.qualityInspectionManagement.reImperfectGrain,
  140. impurity:that.detailData.qualityInspectionManagement.impurity,
  141. reImpurity:that.detailData.qualityInspectionManagement.reImpurity,
  142. jiaorenli:that.detailData.qualityInspectionManagement.jiaorenli,
  143. reJiaorenli:that.detailData.qualityInspectionManagement.reJiaorenli,
  144. bulkDensity:that.detailData.qualityInspectionManagement.bulkDensity,
  145. reBulkDensity:that.detailData.qualityInspectionManagement.reBulkDensity,
  146. mildewGrain:that.detailData.qualityInspectionManagement.mildewGrain,
  147. reMildewGrain:that.detailData.qualityInspectionManagement.reMildewGrain,
  148. },
  149. // console.log(that.detailData)
  150. that.$api.doRequest('post',
  151. '/warehouseInOutInfo/api/newInOutWarehouse', that
  152. .detailData).then(res => {
  153. if (res.data.code == 200) {
  154. that.$refs.uToast.show({
  155. title: '提交成功',
  156. type: 'success'
  157. })
  158. uni.navigateBack({delta:1})
  159. } else {
  160. that.$refs.uToast.show({
  161. title: '提交失败',
  162. type: 'error',
  163. })
  164. }
  165. })
  166. }else{
  167. that.$api.doRequest('get', '/paymentManagement/cumulant', {
  168. // compId: JSON.parse(localStorage.getItem('pcUserInfo')).data.compId,
  169. compId: uni.getStorageSync('pcUserInfo').compId,
  170. customerNumberCard: that.detailData.customerNumberCard,
  171. goodsName: that.detailData.goodsName,
  172. }).then(res => {
  173. if (res.data.code == 200) {
  174. for (let i = 0; i < that.purchasePriceList.length; i++) {
  175. if (
  176. that.detailData.goodsName == that.purchasePriceList[i]
  177. .goodsName
  178. ) {
  179. let count = (that.purchasePriceList[i].saleLimit -
  180. res.data.data / 1000).toFixed(2)
  181. if (Number(count) - that.detailData.grossWeight / 1000 <= 0) {
  182. that.$api.msg('该客户累计销售' + that.detailData.goodsName + (
  183. res.data.data / 1000).toFixed(2) +
  184. '吨,还可售粮' +
  185. count + '吨', )
  186. } else {
  187. that.$api.doRequest('post',
  188. '/weighingManagement/api/editGrossWeight', that
  189. .detailData).then(res => {
  190. if (res.data.code == 200) {
  191. that.$refs.uToast.show({
  192. title: '提交成功',
  193. type: 'success'
  194. })
  195. uni.navigateBack({delta:1})
  196. } else {
  197. that.$refs.uToast.show({
  198. title: '提交失败',
  199. type: 'error',
  200. })
  201. }
  202. })
  203. }
  204. }
  205. }
  206. }
  207. })
  208. }
  209. } else if (res.cancel) {
  210. console.log('用户点击取消');
  211. }
  212. }
  213. })
  214. }
  215. }
  216. }
  217. </script>
  218. <style scoped lang="scss">
  219. uni-page-body {
  220. overflow: hidden;
  221. }
  222. .warp {
  223. background: white;
  224. margin: 20rpx;
  225. padding: 20rpx;
  226. border-radius: 20rpx;
  227. .title {
  228. font-size: 28rpx;
  229. font-weight: 500;
  230. color: #333333;
  231. }
  232. }
  233. .content {
  234. margin-bottom:50px;
  235. .row {
  236. display: flex;
  237. justify-content: space-between;
  238. padding: 31rpx 0;
  239. .right {
  240. font-size: 28rpx;
  241. font-weight: 600;
  242. color: #333333;
  243. }
  244. }
  245. .row-bottom {
  246. border: 0;
  247. .right-bottom {
  248. width: 300rpx;
  249. text-align: right;
  250. font-size: 28rpx;
  251. font-weight: 600;
  252. color: #333333;
  253. }
  254. }
  255. }
  256. .submit {
  257. position: fixed;
  258. bottom: 40rpx;
  259. width: 90%;
  260. background: #22C572;
  261. border-radius: 50rpx;
  262. }
  263. </style>