123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- <template>
- <view class="warp">
- <view class="title">
- 基本信息
- </view>
- <view class="content">
- <view class="row">
- <view class="left">入库类型</view>
- <view class="right" v-if='detailData.serviceManagementType==3'>收购入库</view>
- <view class="right" v-if='detailData.serviceManagementType==1'>贸易入库</view>
- </view>
- <view class="row">
- <view class="left">仓库</view>
- <view class="right">{{detailData.warehouseName}}</view>
- </view>
- <view class="row">
- <view class="left">编号</view>
- <view class="right">{{detailData.number}}</view>
- </view>
- <view class="row">
- <view class="left">客户</view>
- <view class="right">{{detailData.customer}}</view>
- </view>
- <view class="row">
- <view class="left">车牌号</view>
- <view class="right">{{detailData.carNumber}}</view>
- </view>
- <view class="row">
- <view class="left">仓位号</view>
- <view class="right">{{detailData.binNumber}}</view>
- </view>
- <view class="row">
- <view class="left">囤位号</view>
- <view class="right">{{detailData.storageNumber}}</view>
- </view>
- <view class="row">
- <view class="left">货名</view>
- <view class="right">{{detailData.goodsName}}</view>
- </view>
- <view class="row">
- <view class="left">运输方式</view>
- <view class="right">{{detailData.outType}}</view>
- </view>
- <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
- <view class="left">箱号-1</view>
- <view class="right">{{detailData.qualityInspectionManagement.boxNo}}</view>
- </view>
- <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
- <view class="left">箱号-2</view>
- <view class="right">{{detailData.qualityInspectionManagement.boxNoOther}}</view>
- </view>
- <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"'class="row">
- <view class="left">封号-1</view>
- <view class="right">{{detailData.qualityInspectionManagement.titleNo}}</view>
- </view>
- <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row">
- <view class="left">封号-2</view>
- <view class="right">{{detailData.qualityInspectionManagement.titleNoOther}}</view>
- </view>
- <view class="row row-bottom">
- <view class="left">毛重(公斤)</view>
- <input class="right-bottom" placeholder="输入毛重" v-model="detailData.grossWeight"></input>
- </view>
- </view>
- <u-button v-if='tabbar' type="primary" class="submit" @click="submit">提交</u-button>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- tabbar: true,
- windowHeight: '',
- detailData: {
- grossWeight: ''
- },
- purchasePriceList: []
- }
- },
- onShow() {
- this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
- warehouseId: this.detailData.warehouseId
- }).then(res => {
- if (res.data.code == 200) {
- this.purchasePriceList = res.data.data
- }
- })
- },
- onLoad(options) {
- uni.onWindowResize((res) => {
- if (res.size.windowHeight < this.windowHeight) {
- this.tabbar = false
- } else {
- this.tabbar = true
- }
- })
- this.detailData = JSON.parse(options.detailData)
- console.log(this.detailData)
- uni.getSystemInfo({
- success: (res) => {
- this.windowHeight = res.windowHeight;
- // console.log(res)
- this.system = res.system // ios
- this.platform = res.platform // 14.3
- }
- })
- console.log(this.detailData)
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- },
- methods: {
- submit() {
- if(!this.detailData.grossWeight){
- this.$refs.uToast.show({
title: '请输入毛重',
type: 'error'})
- return
- }
- let that = this
- uni.showModal({
- content: "确定提交检斤信息?",
- success: function(res) {
- if (res.confirm) {
-
- if(that.detailData.serviceManagementType==1){
- var data=that.detailData
- data.secretaryWeigher=that.userInfo.userName;
- data.weighingManagement=JSON.parse(JSON.stringify(that.detailData))
- data.inOutFlag = 2
- data.statusFlag=1
- data.grossWeight=that.detailData.grossWeight/1000
- data.warehouseInOutDetail={
- id:that.detailData.inOutDetailId,
- grade:that.detailData.qualityInspectionManagement.grade,
- reGrade:that.detailData.qualityInspectionManagement.reGrade,
- imperfectGrain:that.detailData.qualityInspectionManagement.imperfectGrain,
- reImperfectGrain:that.detailData.qualityInspectionManagement.reImperfectGrain,
- impurity:that.detailData.qualityInspectionManagement.impurity,
- reImpurity:that.detailData.qualityInspectionManagement.reImpurity,
- jiaorenli:that.detailData.qualityInspectionManagement.jiaorenli,
- reJiaorenli:that.detailData.qualityInspectionManagement.reJiaorenli,
- bulkDensity:that.detailData.qualityInspectionManagement.bulkDensity,
- reBulkDensity:that.detailData.qualityInspectionManagement.reBulkDensity,
- mildewGrain:that.detailData.qualityInspectionManagement.mildewGrain,
- reMildewGrain:that.detailData.qualityInspectionManagement.reMildewGrain,
- },
-
- // console.log(that.detailData)
- that.$api.doRequest('post',
- '/warehouseInOutInfo/api/newInOutWarehouse', that
- .detailData).then(res => {
- if (res.data.code == 200) {
- that.$refs.uToast.show({
- title: '提交成功',
- type: 'success'
- })
- uni.navigateBack({delta:1})
- } else {
- that.$refs.uToast.show({
- title: '提交失败',
- type: 'error',
- })
- }
- })
- }else{
- that.$api.doRequest('get', '/paymentManagement/cumulant', {
- // compId: JSON.parse(localStorage.getItem('pcUserInfo')).data.compId,
- compId: uni.getStorageSync('pcUserInfo').compId,
- customerNumberCard: that.detailData.customerNumberCard,
- goodsName: that.detailData.goodsName,
- }).then(res => {
- if (res.data.code == 200) {
- for (let i = 0; i < that.purchasePriceList.length; i++) {
- if (
- that.detailData.goodsName == that.purchasePriceList[i]
- .goodsName
- ) {
-
- let count = (that.purchasePriceList[i].saleLimit -
- res.data.data / 1000).toFixed(2)
- if (Number(count) - that.detailData.grossWeight / 1000 <= 0) {
- that.$api.msg('该客户累计销售' + that.detailData.goodsName + (
- res.data.data / 1000).toFixed(2) +
- '吨,还可售粮' +
- count + '吨', )
-
- } else {
- that.$api.doRequest('post',
- '/weighingManagement/api/editGrossWeight', that
- .detailData).then(res => {
- if (res.data.code == 200) {
- that.$refs.uToast.show({
- title: '提交成功',
- type: 'success'
- })
- uni.navigateBack({delta:1})
- } else {
- that.$refs.uToast.show({
- title: '提交失败',
- type: 'error',
- })
- }
- })
-
- }
- }
- }
- }
- })
- }
-
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- uni-page-body {
- overflow: hidden;
- }
- .warp {
- background: white;
- margin: 20rpx;
- padding: 20rpx;
- border-radius: 20rpx;
- .title {
- font-size: 28rpx;
- font-weight: 500;
- color: #333333;
- }
- }
- .content {
- margin-bottom:50px;
- .row {
- display: flex;
- justify-content: space-between;
- padding: 31rpx 0;
- .right {
- font-size: 28rpx;
- font-weight: 600;
- color: #333333;
- }
- }
- .row-bottom {
- border: 0;
- .right-bottom {
- width: 300rpx;
- text-align: right;
- font-size: 28rpx;
- font-weight: 600;
- color: #333333;
- }
- }
- }
- .submit {
- position: fixed;
- bottom: 40rpx;
- width: 90%;
- background: #22C572;
- border-radius: 50rpx;
- }
- </style>
|