add_check_the_weight.vue 6.0 KB

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