tareDetail1.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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 @click='slectcontractNo'>{{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" style="text-align: right;">
  20. <view class="left">车牌号</view>
  21. <input v-model='detailData.carNumber' class="right-bottom" placeholder="输入车牌号"></input>
  22. </view>
  23. <view class="row">
  24. <view class="left">仓位号</view>
  25. <view @click='show1=true'>{{detailData.binNumber}}</view>
  26. <u-picker :range="positionList" range-key="binNumber" @confirm='binNumberpicker($event)' v-model="show1" mode="selector" >
  27. </u-picker>
  28. </view>
  29. <view class="row" style="text-align: right;">
  30. <view class="left">囤位号</view>
  31. <input class="right-bottom" v-model='detailData.storageNumber' placeholder="输入囤位号"></input>
  32. </view>
  33. <view class="row" @click="issueTypeClick">
  34. <view class="left">出库类型</view>
  35. <view class="right">{{issueTypeVal}}></view>
  36. </view>
  37. <view class="row">
  38. <view class="left">运输方式</view>
  39. <view class="right">{{detailData.outType}}</view>
  40. </view>
  41. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
  42. <view class="left">箱号-1</view>
  43. <view class="right">{{detailData.qualityInspectionManagement.boxNo}}</view>
  44. </view>
  45. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
  46. <view class="left">封号-1</view>
  47. <view class="right">{{detailData.qualityInspectionManagement.titleNo}}</view>
  48. </view>
  49. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"'class="row">
  50. <view class="left">箱号-2</view>
  51. <view class="right">{{detailData.qualityInspectionManagement.boxNoOther}}</view>
  52. </view>
  53. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row row-bottom">
  54. <view class="left">封号-2</view>
  55. <view class="right">{{detailData.qualityInspectionManagement.titleNoOther}}</view>
  56. </view>
  57. <view v-if='detailData.outType=="散船"' class="row">
  58. <view class="left">船名</view>
  59. <view class="right">{{detailData.qualityInspectionManagement.shipName}}</view>
  60. </view>
  61. <view v-if='detailData.outType=="散船"' class="row row-bottom">
  62. <view class="left">航次</view>
  63. <view class="right">{{detailData.qualityInspectionManagement.shipNumber}}</view>
  64. </view>
  65. <view v-if='detailData.outType=="火运"' class="row">
  66. <view class="left">车厢号-1</view>
  67. <view class="right">{{detailData.qualityInspectionManagement.wingNumber}}</view>
  68. </view>
  69. <view v-if='detailData.outType=="火运"' class="row row-bottom">
  70. <view class="left">车厢号-2</view>
  71. <view class="right">{{detailData.qualityInspectionManagement.wingNumberOther}}</view>
  72. </view>
  73. </view>
  74. <div class="content1">
  75. <view class="title">
  76. 检斤信息
  77. </view>
  78. <view class="row row-bottom">
  79. <view class="left">皮重(公斤)</view>
  80. <input v-model='detailData.tare' class="right-bottom" placeholder="输入皮重"></input>
  81. </view>
  82. </div>
  83. <!-- <u-select v-model="isShowContractNo" :list="contractNoList" @confirm="confirmContractNo"></u-select> -->
  84. <u-select v-model="isShowBinNo" :list="binNoList" @confirm="confirmBinNo"></u-select>
  85. <u-select v-model="isShowIssueType" :list="issueTypeList" @confirm="confirmIssueTypeNo"></u-select>
  86. <view class='footer'>
  87. <u-button type="primary" class="submit" @click="submit">提交</u-button>
  88. </view>
  89. </view>
  90. </template>
  91. <script>
  92. import helper from '@/common/helper.js';
  93. export default {
  94. data() {
  95. return {
  96. // isShowContractNo: false,
  97. isShowBinNo: false,
  98. isShowIssueType: false,
  99. issueTypeVal: "销售出库",
  100. detailData: {},
  101. id:'',
  102. cangId:'',
  103. show1:false,
  104. show:false,
  105. contractNoList: [],
  106. positionList:[],
  107. binNoList: [],
  108. issueTypeList: [{
  109. value: '1',
  110. label: '销售出库'
  111. },
  112. {
  113. value: '2',
  114. label: '移库出库'
  115. },
  116. {
  117. value: '3',
  118. label: '暂存出库'
  119. },
  120. {
  121. value: '4',
  122. label: '贸易服务出库'
  123. },
  124. ]
  125. }
  126. },
  127. onLoad(options) {
  128. this.id = options.id
  129. this.cangId = options.cangId
  130. this.getWeighingManagement()
  131. },
  132. onShow() {
  133. if(uni.getStorageSync('ContractNo')){
  134. this.detailData.contractNo=uni.getStorageSync('ContractNo').contractNo
  135. }
  136. },
  137. methods: {
  138. contractNopicker(e){
  139. this.detailData.goodsName=this.contractNoList[e[0]].goodsName
  140. this.detailData.contractNo=this.contractNoList[e[0]].contractNo
  141. },
  142. slectcontractNo(){
  143. uni.navigateTo({
  144. url:'/pages/erpbusiness/acquisitionInspection/selectContractNo'
  145. })
  146. },
  147. binNumberpicker(e){
  148. this.detailData.binNumber=this.positionList[e[0]].binNumber
  149. },
  150. getWeighingManagement(){
  151. this.$api.doRequest('get', '/weighingManagement/getWeighingManagement',
  152. {id: this.id}).then(res => {
  153. if(res.data.code==200){
  154. console.log(res)
  155. this.detailData = res.data.data
  156. }
  157. })
  158. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse',
  159. {id: this.cangId}).then(res => {
  160. if(res.data.code==200){
  161. this.positionList = res.data.data.warehousePositionInfoList
  162. }
  163. })
  164. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList',{
  165. compId: '',
  166. flag:5
  167. }).then(res => {
  168. if(res.data.code==200){
  169. this.contractNoList = res.data.data
  170. }
  171. })
  172. },
  173. contractNoClick() {
  174. uni.navigateTo({
  175. url:"selectContractNo?compId="+this.detailData.compId
  176. })
  177. },
  178. issueTypeClick() {
  179. this.isShowIssueType = true
  180. },
  181. confirmContractNo(e) {},
  182. confirmBinNo(e) {},
  183. confirmIssueTypeNo(e) {
  184. console.log(e)
  185. this.detailData.inOutType=e[0].label
  186. this.issueTypeVal = e[0].label
  187. },
  188. submit(){
  189. if (!this.detailData.contractNo) {
  190. this.$api.msg('合同编号不能为空')
  191. return
  192. }
  193. if (!this.detailData.binNumber) {
  194. this.$api.msg('仓位号不能为空')
  195. return
  196. }
  197. if (!this.detailData.storageNumber) {
  198. this.$api.msg('囤位号不能为空')
  199. return
  200. }
  201. if (
  202. this.detailData.storageNumber.length < 1 ||
  203. this.detailData.storageNumber.length > 10
  204. ) {
  205. this.$api.msg('囤位号不超过10个字符!')
  206. return
  207. }
  208. if (!this.detailData.carNumber) {
  209. this.$api.msg('车牌号不能为空')
  210. return
  211. }
  212. if (this.detailData.carNumber.length != 7) {
  213. this.$api.msg('车牌号输入错误')
  214. return
  215. }
  216. if (!this.detailData.inOutType) {
  217. this.$api.msg('出库类型不能为空')
  218. return
  219. }
  220. this.detailData.weighingManagement=this.detailData
  221. var that = this
  222. uni.showModal({
  223. content:"确定提交检斤信息?",
  224. success(res) {
  225. if(res.confirm){
  226. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  227. that.detailData).then(res => {
  228. if(res.data.code==200){
  229. uni.setStorageSync('ContractNo','')
  230. that.$api.msg('提交成功')
  231. uni.navigateBack()
  232. }
  233. })
  234. }
  235. }
  236. })
  237. }
  238. },
  239. }
  240. </script>
  241. <style scoped lang="scss">
  242. uni-page-body {
  243. overflow: hidden;
  244. }
  245. .warp {
  246. margin: 20rpx;
  247. }
  248. .content,
  249. .content1 {
  250. border-radius: 20rpx;
  251. background: white;
  252. padding: 20rpx;
  253. .title {
  254. font-size: 28rpx;
  255. font-weight: 600;
  256. color: #333333;
  257. }
  258. .row {
  259. display: flex;
  260. justify-content: space-between;
  261. padding: 31rpx 0;
  262. .right {
  263. font-size: 28rpx;
  264. color: #333333;
  265. }
  266. }
  267. .row-bottom {
  268. border: 0;
  269. .right-bottom {
  270. width: 300rpx;
  271. text-align: right;
  272. }
  273. }
  274. }
  275. .content1 {
  276. margin-top: 20rpx;
  277. }
  278. .footer{
  279. position: fixed;
  280. bottom:0;
  281. width:100%;
  282. padding:10px;
  283. background:#fff;
  284. .submit {
  285. width: 90%;
  286. background: #22C572;
  287. border-radius: 50rpx;
  288. }
  289. }
  290. .row input{
  291. font-size:14px;
  292. }
  293. </style>