exWarehousing.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  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="staffName" @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. methods: {
  223. outWarehouse(){
  224. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  225. constId: 'CON6'
  226. }).then(res => {
  227. this.warehousingTypeList = res.data.data
  228. })
  229. },
  230. handler(){
  231. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  232. compId:helper.erpWarehouse.compId,
  233. warehouseId:helper.erpWarehouse.warehouseId
  234. }).then(res => {
  235. this.handlerList = 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].staffName
  248. },
  249. dateChange(e) {
  250. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  251. this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
  252. },
  253. warehousingTypePicker(e) {
  254. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  255. },
  256. filterFileType(index, lists) {
  257. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  258. lists.splice(index, 1);
  259. // 当前文件不支持
  260. uni.showModal({
  261. title: '暂不支持当前图片类型',
  262. showCancel: false
  263. });
  264. } else {
  265. this.isAdd = false;
  266. }
  267. },
  268. calculate() {
  269. if (this.detailData.grossWeight && this.detailData.tare) {
  270. this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
  271. }
  272. },
  273. getImgUrl(res) {
  274. this.detailData.addressUrl = res
  275. console.log(res)
  276. console.log('------------res-----------')
  277. },
  278. onError(error) {
  279. alert(error)
  280. console.log('------------error-----------')
  281. console.log(error)
  282. },
  283. binNumberpicker(e) {
  284. this.detailData.binNumber = this.positionList[e[0]].binNumber
  285. },
  286. getWeighingManagement() {
  287. this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
  288. id: this.id
  289. }).then(res => {
  290. if (res.data.code == 200) {
  291. this.detailData = res.data.data
  292. }
  293. })
  294. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  295. id: this.cangId
  296. }).then(res => {
  297. if (res.data.code == 200) {
  298. this.positionList = res.data.data.warehousePositionInfoList
  299. }
  300. })
  301. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  302. compId: '',
  303. flag: 5
  304. }).then(res => {
  305. if (res.data.code == 200) {
  306. this.contractNoList = res.data.data
  307. }
  308. })
  309. },
  310. onProgress(e) {
  311. console.log(e)
  312. },
  313. onRemove(index) {},
  314. submit(num) {
  315. if (!this.detailData.grossWeight) {
  316. this.$api.msg('毛重不能为空')
  317. return
  318. }
  319. if (isNaN(this.detailData.grossWeight) ||
  320. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  321. String(this.detailData.grossWeight).length -
  322. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  323. 1) ||
  324. this.detailData.grossWeight < 1 ||
  325. this.detailData.grossWeight > 100000
  326. ) {
  327. this.$api.msg('毛重输入错误!')
  328. return
  329. }
  330. this.detailData.compId = helper.erpWarehouse.compId
  331. let title = ""
  332. if(num == 1 ){
  333. this.detailData.inOutFlag = 1
  334. this.detailData.statusFlag = 1
  335. title = "暂存成功"
  336. }else if(num == 2){
  337. this.detailData.inOutFlag = 1
  338. this.detailData.statusFlag = 3
  339. title = "提交成功"
  340. }
  341. let that = this
  342. console.log(this.detailData,"提交对象")
  343. return
  344. uni.showModal({
  345. content: "确定提交出库信息?",
  346. success(res) {
  347. if (res.confirm) {
  348. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  349. that.detailData).then(res => {
  350. if (res.data.code == 200) {
  351. that.$api.msg(title)
  352. uni.navigateBack()
  353. }
  354. })
  355. }
  356. }
  357. })
  358. },
  359. slectcontractNo() {
  360. uni.navigateTo({
  361. url: '/pages/erp/warehousing/selectContractNo?compId=' + this.compId
  362. })
  363. },
  364. slectCarNo() {
  365. uni.navigateTo({
  366. url: '/pages/erp/exWarehousing/selectCarNo'
  367. })
  368. },
  369. }
  370. }
  371. </script>
  372. <style scoped lang="scss">
  373. uni-page-body {
  374. overflow: hidden;
  375. }
  376. .warp {
  377. margin: 10rpx;
  378. padding: 20rpx 20rpx 140rpx 20rpx;
  379. .top {
  380. display: flex;
  381. margin-bottom: 20rpx;
  382. .top-left {
  383. margin-right: 20rpx;
  384. }
  385. }
  386. }
  387. .content,
  388. .content1,
  389. .content2 {
  390. border-radius: 20rpx;
  391. background: white;
  392. padding: 20rpx;
  393. .title {
  394. font-size: 28rpx;
  395. font-weight: 600;
  396. color: #333333;
  397. }
  398. .row {
  399. display: flex;
  400. justify-content: space-between;
  401. border-bottom: 1px solid #EEEEEE;
  402. padding: 21rpx 0;
  403. .right,
  404. input {
  405. font-size: 28rpx;
  406. color: #333333;
  407. }
  408. }
  409. .row-bottom {
  410. // border: 0;
  411. .right-bottom {
  412. width: 300rpx;
  413. text-align: right;
  414. }
  415. }
  416. }
  417. .content1 {
  418. margin-top: 20rpx;
  419. }
  420. .content2 {
  421. margin-top: 10px;
  422. // display: flex;
  423. align-items: center;
  424. .left {
  425. margin-right: 20px;
  426. }
  427. }
  428. .submit {
  429. width: 40%;
  430. background: #22C572;
  431. border-radius: 10rpx;
  432. }
  433. .edit-btn {
  434. background: #22C572;
  435. width: 100rpx;
  436. height: 50rpx;
  437. margin: 0;
  438. color: white;
  439. }
  440. .has-btn {
  441. align-items: center;
  442. }
  443. .bottom-btn {
  444. width: 92%;
  445. position: fixed;
  446. bottom: 40rpx;
  447. display: flex;
  448. z-index: 2;
  449. }
  450. </style>