exWarehousing.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  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.grossWeight' class="right-bottom"
  33. placeholder="输入皮重"></input>
  34. </view>
  35. <view class="row row-bottom">
  36. <view class="left">净重(吨)</view>
  37. <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  38. placeholder="不可编辑,自动计算"></input>
  39. </view>
  40. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  41. <view class="left">扣重比</view>
  42. <input v-model='detailData.grossWeight' class="right-bottom"
  43. placeholder="输入扣重比"></input>
  44. </view>
  45. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  46. <view class="left">干粮水分(%)</view>
  47. <input v-model='detailData.grossWeight' class="right-bottom"
  48. placeholder="输入干粮水分占比"></input>
  49. </view>
  50. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  51. <view class="left">潮粮水分(%)</view>
  52. <input v-model='detailData.grossWeight' class="right-bottom"
  53. placeholder="输入潮粮水分占比"></input>
  54. </view>
  55. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  56. <view class="left">纯重(吨)</view>
  57. <input v-model='detailData.grossWeight' class="right-bottom"
  58. placeholder="不可编辑,自动计算"></input>
  59. </view>
  60. <view class="row">
  61. <view class="left">品级</view>
  62. <view @click='show3=true'>{{detailData.grade}}</view>
  63. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show3" mode="selector">
  64. </u-picker>
  65. </view>
  66. <view class="row">
  67. <view class="left">经办人</view>
  68. <view @click='show6=true'>{{detailData.agent}}</view>
  69. <u-picker :range="handlerList" range-key="name" @confirm='handlerPicker($event)' v-model="show6"
  70. mode="selector">
  71. </u-picker>
  72. </view>
  73. <view class="row">
  74. <view class="left">出库日期</view>
  75. <view @click='show7=true'>{{detailData.inOutDate}}</view>
  76. <u-picker v-model="show7" mode="time" @confirm='dateChange($event)' :params="params">
  77. <!-- <view >{{detailData.inOutDate ? detailData.inOutDate:"请选择日期" }}</view> -->
  78. </u-picker>
  79. <!-- <u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar> -->
  80. </view>
  81. <view class="row">
  82. <view class="left">出库类型</view>
  83. <view @click='show5=true'>请选择入库类型</view>
  84. <u-picker :range="warehousingTypeList" range-key="type" @confirm='warehousingTypePicker($event)'
  85. v-model="show5" mode="selector">
  86. </u-picker>
  87. </view>
  88. <view class="row">
  89. <view class="left">车牌号</view>
  90. <view @click='slectCarNo'>{{detailData.carNo}}</view>
  91. </view>
  92. <!-- <view class="row row-bottom has-btn">
  93. <view class="left">成本(元/吨)</view>
  94. <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  95. placeholder="自动获取"></input>
  96. <u-button class="edit-btn">编辑</u-button>
  97. </view>
  98. <view class="row row-bottom has-btn">
  99. <view class="left">运费(元/吨)</view>
  100. <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  101. placeholder="自动获取"></input>
  102. <u-button class="edit-btn">编辑</u-button>
  103. </view> -->
  104. </view>
  105. <view class="content2">
  106. <view class="left">上传磅单</view>
  107. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  108. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  109. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  110. </view>
  111. <view class="content1">
  112. <view class="title">
  113. 质检数据(选填)
  114. </view>
  115. <view class="row row-bottom">
  116. <view class="left">质检员</view>
  117. <input v-model='detailData.grossWeight' class="right-bottom"
  118. placeholder="输入质检员姓名"></input>
  119. </view>
  120. <view class="row row-bottom">
  121. <view class="left">水分(%)</view>
  122. <input v-model='detailData.grossWeight' class="right-bottom"
  123. placeholder="输入水分占比"></input>
  124. </view>
  125. <view class="row row-bottom" style="border: 0;">
  126. <view class="left">容重(克/升)</view>
  127. <input v-model='detailData.netWeight' class="right-bottom" disabled placeholder="输入容重"></input>
  128. </view>
  129. <view class="row row-bottom">
  130. <view class="left">热损伤(%)</view>
  131. <input v-model='detailData.grossWeight' class="right-bottom"
  132. placeholder="输入热损伤占比"></input>
  133. </view>
  134. <view class="row row-bottom">
  135. <view class="left">杂质(%)</view>
  136. <input v-model='detailData.grossWeight' class="right-bottom"
  137. placeholder="输入杂质占比"></input>
  138. </view>
  139. <view class="row row-bottom">
  140. <view class="left">霉变粒(%)</view>
  141. <input v-model='detailData.grossWeight' class="right-bottom"
  142. placeholder="输入霉变粒占比"></input>
  143. </view>
  144. <view class="row row-bottom">
  145. <view class="left">不完善粒(%)</view>
  146. <input v-model='detailData.grossWeight' class="right-bottom"
  147. placeholder="输入不完善粒占比"></input>
  148. </view>
  149. </view>
  150. <u-toast ref="uToast" />
  151. <view class="bottom-btn">
  152. <u-button type="primary" class="submit" hover-class="none" @click="submit">暂存</u-button>
  153. <u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
  154. </view>
  155. </view>
  156. </template>
  157. <script>
  158. import upload from '@/components/upload.vue';
  159. export default {
  160. components: {
  161. upload
  162. },
  163. data() {
  164. return {
  165. show: false,
  166. show1: false,
  167. show2: false,
  168. show3: false,
  169. show4: false,
  170. show5: false,
  171. show6: false,
  172. show7: false,
  173. contractNoList: [{
  174. contractNo: "123"
  175. }],
  176. typeList: [{
  177. type: "干粮"
  178. },
  179. {
  180. type: "潮粮"
  181. }
  182. ],
  183. pjList: [{
  184. type: "一等品"
  185. },
  186. {
  187. type: "二等品"
  188. },
  189. {
  190. type: "三等品"
  191. },
  192. {
  193. type: "等外"
  194. }
  195. ],
  196. handlerList: [{
  197. name: "张三"
  198. },
  199. {
  200. name: "二等"
  201. },
  202. {
  203. name: "三等"
  204. },
  205. {
  206. name: "等外"
  207. }
  208. ],
  209. warehousingTypeList: [{
  210. type: "采购入库"
  211. },
  212. {
  213. type: "采购入库"
  214. },
  215. {
  216. type: "采购入库"
  217. },
  218. {
  219. type: "采购入库"
  220. }
  221. ],
  222. action: this.$uploadUrl,
  223. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  224. btnLoading: false, //防止重复点击
  225. isAdd: true,
  226. detailData: {
  227. contractNo: "请选择合同编号或移库任务编号",
  228. carNo: '辽H12345',
  229. name: "",
  230. type: "请选择类型",
  231. grade: "请输入品级",
  232. agent: "请选择经办人",
  233. inOutDate: "请选择出库日期",
  234. qualityInspectionManagement: {}
  235. },
  236. params: {
  237. year: true,
  238. month: true,
  239. day: true,
  240. hour: true,
  241. minute: true,
  242. second: true
  243. },
  244. }
  245. },
  246. onLoad(options) {
  247. this.id = options.id
  248. this.cangId = options.cangId
  249. },
  250. onShow() {
  251. // this.getWeighingManagement()
  252. },
  253. methods: {
  254. contractNopicker(e) {},
  255. typePicker(e) {
  256. this.detailData.type = this.typeList[e].type
  257. },
  258. pjPicker(e) {
  259. this.detailData.grade = this.pjList[e].type
  260. },
  261. handlerPicker(e) {
  262. this.detailData.agent = this.handlerList[e].name
  263. },
  264. dateChange(e) {
  265. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  266. },
  267. warehousingTypePicker(e) {
  268. console.log(e)
  269. },
  270. filterFileType(index, lists) {
  271. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  272. lists.splice(index, 1);
  273. // 当前文件不支持
  274. uni.showModal({
  275. title: '暂不支持当前图片类型',
  276. showCancel: false
  277. });
  278. } else {
  279. this.isAdd = false;
  280. }
  281. },
  282. calculate() {
  283. this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
  284. },
  285. getImgUrl(res) {
  286. this.detailData.addressUrl = res
  287. console.log(res)
  288. console.log('------------res-----------')
  289. },
  290. onError(error) {
  291. alert(error)
  292. console.log('------------error-----------')
  293. console.log(error)
  294. },
  295. contractNopicker(e) {
  296. // this.detailData.goodsName=this.contractNoList[e[0]].goodsName
  297. // this.detailData.contractNo=this.contractNoList[e[0]].contractNo
  298. },
  299. binNumberpicker(e) {
  300. this.detailData.binNumber = this.positionList[e[0]].binNumber
  301. },
  302. getWeighingManagement() {
  303. this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
  304. id: this.id
  305. }).then(res => {
  306. if (res.data.code == 200) {
  307. console.log(res)
  308. this.detailData = res.data.data
  309. }
  310. })
  311. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  312. id: this.cangId
  313. }).then(res => {
  314. if (res.data.code == 200) {
  315. this.positionList = res.data.data.warehousePositionInfoList
  316. }
  317. })
  318. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  319. compId: '',
  320. flag: 5
  321. }).then(res => {
  322. if (res.data.code == 200) {
  323. this.contractNoList = res.data.data
  324. }
  325. })
  326. },
  327. onProgress(e) {
  328. console.log(e)
  329. },
  330. onRemove(index) {},
  331. submit() {
  332. if (!this.detailData.grossWeight) {
  333. this.$api.msg('毛重不能为空')
  334. return
  335. }
  336. if (isNaN(this.detailData.grossWeight) ||
  337. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  338. String(this.detailData.grossWeight).length -
  339. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  340. 1) ||
  341. this.detailData.grossWeight < 1 ||
  342. this.detailData.grossWeight > 100000
  343. ) {
  344. this.$api.msg('毛重输入错误!')
  345. return
  346. }
  347. let that = this
  348. uni.showModal({
  349. content: "确定提交检斤信息?",
  350. success(res) {
  351. if (res.confirm) {
  352. that.$api.doRequest('post', '/weighingManagement/api/editGrossWeight',
  353. that.detailData).then(res => {
  354. if (res.data.code == 200) {
  355. that.$api.msg('提交成功')
  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>