tareDetail1.vue 6.3 KB

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