exWarehousing.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <view class="warp">
  3. <view class="top">
  4. <view class="top-left">鲅鱼圈一号库</view>
  5. <view>102仓位</view>
  6. </view>
  7. <view class="content">
  8. <view class="row">
  9. <view class="left">合同编号</view>
  10. <view @click='slectcontractNo'>{{detailData.contractNo}}</view>
  11. </view>
  12. <view class="row">
  13. <view class="left">货名</view>
  14. <view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
  15. </view>
  16. </view>
  17. <view class="row">
  18. <view class="left">类型</view>
  19. <view @click='show1=true'>{{detailData.type}}</view>
  20. <u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
  21. mode="selector">
  22. <view class="">{{detailData.type}}</view>
  23. </u-picker>
  24. </view>
  25. <view class="row row-bottom">
  26. <view class="left">毛重(吨)</view>
  27. <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  28. placeholder="输入毛重"></input>
  29. </view>
  30. <view class="row row-bottom">
  31. <view class="left">皮重(吨)</view>
  32. <input @input='calculate' v-model='detailData.tare' class="right-bottom" placeholder="输入皮重"></input>
  33. </view>
  34. <view class="row row-bottom">
  35. <view class="left">净重(吨)</view>
  36. <input @input='calculate' v-model='detailData.netWeight' class="right-bottom"
  37. placeholder="不可编辑,自动计算"></input>
  38. </view>
  39. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  40. <view class="left">扣重比</view>
  41. <input v-model='detailData.deductWeight' class="right-bottom" placeholder="输入扣重比"></input>
  42. </view>
  43. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  44. <view class="left">干粮水分(%)</view>
  45. <input v-model='detailData.waterMin' class="right-bottom" placeholder="输入干粮水分占比"></input>
  46. </view>
  47. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  48. <view class="left">潮粮水分(%)</view>
  49. <input v-model='detailData.waterContent' class="right-bottom" placeholder="输入潮粮水分占比"></input>
  50. </view>
  51. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  52. <view class="left">纯重(吨)</view>
  53. <input v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"></input>
  54. </view>
  55. <view class="row">
  56. <view class="left">品级</view>
  57. <view @click='show3=true'>{{detailData.grade}}</view>
  58. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show3" mode="selector">
  59. </u-picker>
  60. </view>
  61. <view class="row">
  62. <view class="left">经办人</view>
  63. <view @click='show6=true'>{{detailData.agent}}</view>
  64. <u-picker :range="handlerList" range-key="name" @confirm='handlerPicker($event)' v-model="show6"
  65. mode="selector">
  66. </u-picker>
  67. </view>
  68. <view class="row">
  69. <view class="left">出库日期</view>
  70. <view @click='show7=true'>{{detailData.inOutDate}}</view>
  71. <u-picker v-model="show7" mode="time" @confirm='dateChange($event)' :params="params">
  72. </u-picker>
  73. </view>
  74. <view class="row">
  75. <view class="left">出库类型</view>
  76. <view @click='show5=true'>{{detailData.inOutType}}</view>
  77. <u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
  78. v-model="show5" mode="selector">
  79. </u-picker>
  80. </view>
  81. <view class="row row-bottom">
  82. <view class="left">车牌号</view>
  83. <input v-model='detailData.carNumber' class="right-bottom" placeholder="请输入车牌号"></input>
  84. </view>
  85. </view>
  86. <view class="content2">
  87. <view class="left">上传磅单</view>
  88. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  89. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  90. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  91. </view>
  92. <view class="content1">
  93. <view class="title">
  94. 质检数据(选填)
  95. </view>
  96. <view class="row row-bottom">
  97. <view class="left">质检员</view>
  98. <input v-model='detailData.qualityInspector' class="right-bottom" placeholder="输入质检员姓名"></input>
  99. </view>
  100. <view class="row row-bottom">
  101. <view class="left">水分(%)</view>
  102. <input v-model='detailData.waterContent' class="right-bottom" placeholder="输入水分占比"></input>
  103. </view>
  104. <view class="row row-bottom">
  105. <view class="left">容重(克/升)</view>
  106. <input v-model='detailData.bulkDensity' class="right-bottom" placeholder="输入容重"></input>
  107. </view>
  108. <view class="row row-bottom">
  109. <view class="left">热损伤(%)</view>
  110. <input v-model='detailData.jiaorenli' class="right-bottom" placeholder="输入热损伤占比"></input>
  111. </view>
  112. <view class="row row-bottom">
  113. <view class="left">杂质(%)</view>
  114. <input v-model='detailData.impurity' class="right-bottom" placeholder="输入杂质占比"></input>
  115. </view>
  116. <view class="row row-bottom">
  117. <view class="left">霉变粒(%)</view>
  118. <input v-model='detailData.mildewGrain' class="right-bottom" placeholder="输入霉变粒占比"></input>
  119. </view>
  120. <view class="row row-bottom">
  121. <view class="left">不完善粒(%)</view>
  122. <input v-model='detailData.imperfectGrain' class="right-bottom" placeholder="输入不完善粒占比"></input>
  123. </view>
  124. </view>
  125. <u-toast ref="uToast" />
  126. <view class="bottom-btn">
  127. <u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
  128. <u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import upload from '@/components/upload.vue';
  134. import helper from '@/common/helper.js';
  135. export default {
  136. components: {
  137. upload
  138. },
  139. data() {
  140. return {
  141. show: false,
  142. show1: false,
  143. show2: false,
  144. show3: false,
  145. show4: false,
  146. show5: false,
  147. show6: false,
  148. show7: false,
  149. contractNoList: [{
  150. contractNo: "123"
  151. }],
  152. typeList: [{
  153. type: "干粮"
  154. },
  155. {
  156. type: "潮粮"
  157. }
  158. ],
  159. pjList: [{
  160. type: "一等品"
  161. },
  162. {
  163. type: "二等品"
  164. },
  165. {
  166. type: "三等品"
  167. },
  168. {
  169. type: "等外"
  170. }
  171. ],
  172. handlerList: [{
  173. name: "张三"
  174. },
  175. {
  176. name: "二等"
  177. },
  178. {
  179. name: "三等"
  180. },
  181. {
  182. name: "等外"
  183. }
  184. ],
  185. warehousingTypeList: [],
  186. action: this.$uploadUrl,
  187. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  188. btnLoading: false, //防止重复点击
  189. isAdd: true,
  190. detailData: {
  191. contractNo: "请选择合同编号或移库任务编号",
  192. carNo: '辽H12345',
  193. name: "",
  194. type: "请选择类型",
  195. grade: "请输入品级",
  196. agent: "请选择经办人",
  197. inOutDate: "请选择出库日期",
  198. inOutType: "请选择出库类型",
  199. qualityInspectionManagement: {}
  200. },
  201. params: {
  202. year: true,
  203. month: true,
  204. day: true,
  205. hour: true,
  206. minute: true,
  207. second: true
  208. },
  209. inOutDate1: "",
  210. }
  211. },
  212. onLoad(options) {
  213. this.id = options.id
  214. this.cangId = options.cangId
  215. },
  216. onShow() {
  217. //出库类型
  218. this.outWarehouse()
  219. //经办人
  220. //this.handler()
  221. //
  222. },
  223. methods: {
  224. outWarehouse(){
  225. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  226. constId: 'CON6'
  227. }).then(res => {
  228. this.warehousingTypeList = res.data.data
  229. })
  230. },
  231. handler(){
  232. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  233. compId:helper.erpWarehouse.compId,
  234. }).then(res => {
  235. this.warehousingTypeList = res.data.data
  236. })
  237. },
  238. contractNopicker(e) {
  239. },
  240. typePicker(e) {
  241. this.detailData.type = this.typeList[e].type
  242. },
  243. pjPicker(e) {
  244. this.detailData.grade = this.pjList[e].type
  245. },
  246. handlerPicker(e) {
  247. this.detailData.agent = this.handlerList[e].name
  248. },
  249. dateChange(e) {
  250. // console.log(e,"时间")
  251. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  252. this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
  253. },
  254. warehousingTypePicker(e) {
  255. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  256. console.log(e)
  257. },
  258. filterFileType(index, lists) {
  259. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  260. lists.splice(index, 1);
  261. // 当前文件不支持
  262. uni.showModal({
  263. title: '暂不支持当前图片类型',
  264. showCancel: false
  265. });
  266. } else {
  267. this.isAdd = false;
  268. }
  269. },
  270. calculate() {
  271. if (this.detailData.grossWeight && this.detailData.tare) {
  272. this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
  273. }
  274. },
  275. getImgUrl(res) {
  276. this.detailData.addressUrl = res
  277. console.log(res)
  278. console.log('------------res-----------')
  279. },
  280. onError(error) {
  281. alert(error)
  282. console.log('------------error-----------')
  283. console.log(error)
  284. },
  285. binNumberpicker(e) {
  286. this.detailData.binNumber = this.positionList[e[0]].binNumber
  287. },
  288. getWeighingManagement() {
  289. this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
  290. id: this.id
  291. }).then(res => {
  292. if (res.data.code == 200) {
  293. console.log(res)
  294. this.detailData = res.data.data
  295. }
  296. })
  297. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  298. id: this.cangId
  299. }).then(res => {
  300. if (res.data.code == 200) {
  301. this.positionList = res.data.data.warehousePositionInfoList
  302. }
  303. })
  304. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  305. compId: '',
  306. flag: 5
  307. }).then(res => {
  308. if (res.data.code == 200) {
  309. this.contractNoList = res.data.data
  310. }
  311. })
  312. },
  313. onProgress(e) {
  314. console.log(e)
  315. },
  316. onRemove(index) {},
  317. submit(num) {
  318. if (!this.detailData.grossWeight) {
  319. this.$api.msg('毛重不能为空')
  320. return
  321. }
  322. if (isNaN(this.detailData.grossWeight) ||
  323. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  324. String(this.detailData.grossWeight).length -
  325. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  326. 1) ||
  327. this.detailData.grossWeight < 1 ||
  328. this.detailData.grossWeight > 100000
  329. ) {
  330. this.$api.msg('毛重输入错误!')
  331. return
  332. }
  333. this.detailData.compId = helper.erpWarehouse.compId
  334. console.log(this.detailData.compId)
  335. let title = ""
  336. if(num == 1 ){
  337. this.detailData.inOutFlag = 1
  338. this.detailData.statusFlag = 1
  339. title = "暂存成功"
  340. }else if(num == 2){
  341. this.detailData.inOutFlag = 1
  342. this.detailData.statusFlag = 3
  343. title = "提交成功"
  344. }
  345. let that = this
  346. console.log(this.detailData,"提交对象")
  347. return
  348. uni.showModal({
  349. content: "确定提交出库信息?",
  350. success(res) {
  351. if (res.confirm) {
  352. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  353. that.detailData).then(res => {
  354. if (res.data.code == 200) {
  355. that.$api.msg(title)
  356. uni.navigateBack()
  357. }
  358. })
  359. }
  360. }
  361. })
  362. },
  363. slectcontractNo() {
  364. uni.navigateTo({
  365. url: '/pages/erp/warehousing/selectContractNo?compId=' + this.compId
  366. })
  367. },
  368. slectCarNo() {
  369. uni.navigateTo({
  370. url: '/pages/erp/exWarehousing/selectCarNo'
  371. })
  372. },
  373. }
  374. }
  375. </script>
  376. <style scoped lang="scss">
  377. uni-page-body {
  378. overflow: hidden;
  379. }
  380. .warp {
  381. margin: 10rpx;
  382. padding: 20rpx 20rpx 140rpx 20rpx;
  383. .top {
  384. display: flex;
  385. margin-bottom: 20rpx;
  386. .top-left {
  387. margin-right: 20rpx;
  388. }
  389. }
  390. }
  391. .content,
  392. .content1,
  393. .content2 {
  394. border-radius: 20rpx;
  395. background: white;
  396. padding: 20rpx;
  397. .title {
  398. font-size: 28rpx;
  399. font-weight: 600;
  400. color: #333333;
  401. }
  402. .row {
  403. display: flex;
  404. justify-content: space-between;
  405. border-bottom: 1px solid #EEEEEE;
  406. padding: 21rpx 0;
  407. .right,
  408. input {
  409. font-size: 28rpx;
  410. color: #333333;
  411. }
  412. }
  413. .row-bottom {
  414. // border: 0;
  415. .right-bottom {
  416. width: 300rpx;
  417. text-align: right;
  418. }
  419. }
  420. }
  421. .content1 {
  422. margin-top: 20rpx;
  423. }
  424. .content2 {
  425. margin-top: 10px;
  426. // display: flex;
  427. align-items: center;
  428. .left {
  429. margin-right: 20px;
  430. }
  431. }
  432. .submit {
  433. width: 40%;
  434. background: #22C572;
  435. border-radius: 10rpx;
  436. }
  437. .edit-btn {
  438. background: #22C572;
  439. width: 100rpx;
  440. height: 50rpx;
  441. margin: 0;
  442. color: white;
  443. }
  444. .has-btn {
  445. align-items: center;
  446. }
  447. .bottom-btn {
  448. width: 92%;
  449. position: fixed;
  450. bottom: 40rpx;
  451. display: flex;
  452. z-index: 2;
  453. }
  454. </style>