grossWeightDetail1.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <view class="warp">
  3. <view class="content">
  4. <view class="title">
  5. 基本信息
  6. </view>
  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.contractNo}}</view>
  14. </view>
  15. <view class="row">
  16. <view class="left">货名</view>
  17. <view class="right">{{detailData.goodsName}}</view>
  18. </view>
  19. <view class="row">
  20. <view class="left">车牌号</view>
  21. <view class="right">{{detailData.qualityInspectionManagement.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.inOutType}}</view>
  34. </view>
  35. <view class="row">
  36. <view class="left">货名</view>
  37. <view class="right">{{detailData.goodsName}}</view>
  38. </view>
  39. <view class="row">
  40. <view class="left">出库日期</view>
  41. <view class="right">{{detailData.inOutDate}}</view>
  42. </view>
  43. <view class="row">
  44. <view class="left">运输方式</view>
  45. <view class="right">{{detailData.outType}}</view>
  46. </view>
  47. <view class="row">
  48. <view class="left">出库日期</view>
  49. <view class="right">{{detailData.inOutDate}}</view>
  50. </view>
  51. <view class="row">
  52. <view class="left">运输方式</view>
  53. <view class="right">{{detailData.outType}}</view>
  54. </view>
  55. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
  56. <view class="left">箱号-1</view>
  57. <view class="right">{{detailData.qualityInspectionManagement.boxNo}}</view>
  58. </view>
  59. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
  60. <view class="left">封号-1</view>
  61. <view class="right">{{detailData.qualityInspectionManagement.titleNo}}</view>
  62. </view>
  63. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"'class="row">
  64. <view class="left">箱号-2</view>
  65. <view class="right">{{detailData.qualityInspectionManagement.boxNoOther}}</view>
  66. </view>
  67. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
  68. <view class="left">封号-2</view>
  69. <view class="right">{{detailData.qualityInspectionManagement.titleNoOther}}</view>
  70. </view>
  71. <view v-if='detailData.outType=="散船"' class="row">
  72. <view class="left">船名</view>
  73. <view class="right">{{detailData.qualityInspectionManagement.shipName}}</view>
  74. </view>
  75. <view v-if='detailData.outType=="散船"' class="row">
  76. <view class="left">航次</view>
  77. <view class="right">{{detailData.qualityInspectionManagement.shipNumber}}</view>
  78. </view>
  79. <view v-if='detailData.outType=="火运"' class="row">
  80. <view class="left">车厢号-1</view>
  81. <view class="right">{{detailData.qualityInspectionManagement.wingNumber}}</view>
  82. </view>
  83. <view v-if='detailData.outType=="火运"' class="row">
  84. <view class="left">车厢号-2</view>
  85. <view class="right">{{detailData.qualityInspectionManagement.wingNumberOther}}</view>
  86. </view>
  87. </view>
  88. <view class="content1">
  89. <view class="title">
  90. 检斤信息
  91. </view>
  92. <view class="row row-bottom">
  93. <view class="left">皮重(公斤)</view>
  94. {{detailData.tare}}
  95. </view>
  96. <view class="row row-bottom">
  97. <view class="left">毛重(公斤)</view>
  98. <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  99. placeholder="输入毛重"></input>
  100. </view>
  101. <view class="row row-bottom" style="border: 0;">
  102. <view class="left">净重(公斤)</view>
  103. <input v-model='detailData.netWeight' class="right-bottom" disabled placeholder="自动计算"></input>
  104. </view>
  105. </view>
  106. <view style="padding-bottom: 300rpx;">
  107. <view class="content2">
  108. <view class="left">上传磅单</view>
  109. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  110. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  111. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  112. </view>
  113. </view>
  114. <u-toast ref="uToast" />
  115. <u-button type="primary" class="submit" @click="submit">提交</u-button>
  116. </view>
  117. </template>
  118. <script>
  119. import upload from '@/components/upload.vue';
  120. export default {
  121. components: {
  122. upload
  123. },
  124. data() {
  125. return {
  126. action: this.$uploadUrl,
  127. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  128. btnLoading: false, //防止重复点击
  129. isAdd: true,
  130. detailData: {
  131. name: "",
  132. qualityInspectionManagement: {}
  133. }
  134. }
  135. },
  136. onLoad(options) {
  137. this.id = options.id
  138. this.cangId = options.cangId
  139. },
  140. onShow() {
  141. this.getWeighingManagement()
  142. },
  143. methods: {
  144. filterFileType(index, lists) {
  145. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  146. lists.splice(index, 1);
  147. // 当前文件不支持
  148. uni.showModal({
  149. title: '暂不支持当前图片类型',
  150. showCancel: false
  151. });
  152. } else {
  153. this.isAdd = false;
  154. }
  155. },
  156. calculate() {
  157. this.detailData.netWeight = (this.detailData.grossWeight - this.detailData.tare).toFixed(3)
  158. },
  159. getImgUrl(res) {
  160. this.detailData.addressUrl = res
  161. console.log(res)
  162. console.log('------------res-----------')
  163. },
  164. onError(error) {
  165. alert(error)
  166. console.log('------------error-----------')
  167. console.log(error)
  168. },
  169. contractNopicker(e) {
  170. this.detailData.goodsName = this.contractNoList[e[0]].goodsName
  171. this.detailData.contractNo = this.contractNoList[e[0]].contractNo
  172. },
  173. binNumberpicker(e) {
  174. this.detailData.binNumber = this.positionList[e[0]].binNumber
  175. },
  176. getWeighingManagement() {
  177. this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
  178. id: this.id
  179. }).then(res => {
  180. if (res.data.code == 200) {
  181. console.log(res)
  182. this.detailData = res.data.data
  183. }
  184. })
  185. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  186. id: this.cangId
  187. }).then(res => {
  188. if (res.data.code == 200) {
  189. this.positionList = res.data.data.warehousePositionInfoList
  190. }
  191. })
  192. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  193. compId: '',
  194. flag: 5
  195. }).then(res => {
  196. if (res.data.code == 200) {
  197. this.contractNoList = res.data.data
  198. }
  199. })
  200. },
  201. onProgress(e) {
  202. console.log(e)
  203. },
  204. onRemove(index) {},
  205. submit() {
  206. if (!this.detailData.grossWeight) {
  207. this.$api.msg('毛重不能为空')
  208. return
  209. }
  210. if (isNaN(this.detailData.grossWeight) ||
  211. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  212. String(this.detailData.grossWeight).length -
  213. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  214. 1) ||
  215. this.detailData.grossWeight < 1 ||
  216. this.detailData.grossWeight > 100000
  217. ) {
  218. this.$api.msg('毛重输入错误!')
  219. return
  220. }
  221. let that = this
  222. uni.showModal({
  223. content: "确定提交检斤信息?",
  224. success(res) {
  225. if (res.confirm) {
  226. that.$api.doRequest('post', '/weighingManagement/api/editGrossWeight',
  227. that.detailData).then(res => {
  228. if (res.data.code == 200) {
  229. that.$api.msg('提交成功')
  230. uni.navigateBack()
  231. }
  232. })
  233. }
  234. }
  235. })
  236. }
  237. }
  238. }
  239. </script>
  240. <style scoped lang="scss">
  241. uni-page-body {
  242. overflow: hidden;
  243. }
  244. .warp {
  245. margin: 10rpx;
  246. padding: 20rpx 20rpx 140rpx 20rpx;
  247. }
  248. .content,
  249. .content1,
  250. .content2 {
  251. border-radius: 20rpx;
  252. background: white;
  253. padding: 20rpx;
  254. .title {
  255. font-size: 28rpx;
  256. font-weight: 600;
  257. color: #333333;
  258. }
  259. .row {
  260. display: flex;
  261. justify-content: space-between;
  262. padding: 21rpx 0;
  263. .right,
  264. input {
  265. font-size: 28rpx;
  266. color: #333333;
  267. }
  268. }
  269. .row-bottom {
  270. // border: 0;
  271. .right-bottom {
  272. width: 300rpx;
  273. text-align: right;
  274. }
  275. }
  276. }
  277. .content1 {
  278. margin-top: 20rpx;
  279. }
  280. .content2 {
  281. margin-top: 10px;
  282. display: flex;
  283. align-items: center;
  284. .left {
  285. margin-right: 20px;
  286. }
  287. }
  288. .submit {
  289. position: fixed;
  290. bottom: 40rpx;
  291. width: 90%;
  292. background: #22C572;
  293. border-radius: 50rpx;
  294. }
  295. </style>