123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483 |
- <template>
- <view class="warp">
- <view class="top">
- <view class="top-left">{{warehouseName}}</view>
- <view>{{binNumber}}仓位</view>
- </view>
- <view class="content">
- <view class="row">
- <view class="left">合同编号</view>
- <view @click='slectcontractNo'>{{detailData.contractNo}}</view>
- </view>
- <view class="row">
- <view class="left">货名</view>
- <view class="right">{{detailData.goodsName}}</view>
- </view>
- <view class="row">
- <view class="left">类型</view>
- <view @click='show1=true'>{{detailData.type}}</view>
- <u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
- mode="selector">
- </u-picker>
- </view>
- <view class="row row-bottom">
- <view class="left">毛重(吨)</view>
- <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="输入毛重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">皮重(吨)</view>
- <input @input='calculate' v-model='detailData.tare' class="right-bottom"
- placeholder="输入皮重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">扣重(吨)</view>
- <input @input='calculate' v-model='detailData.deductionWeight' class="right-bottom" placeholder="0"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">净重(吨)</view>
- <input @input='calculate' v-model='detailData.netWeight' class="right-bottom"
- placeholder="不可编辑,自动计算" :disabled="true"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">扣款(元/吨)</view>
- <input @input='calculate' v-model='detailData.deductionAmount' class="right-bottom" placeholder="0"></input>
- </view>
- <view class="row row-bottom" v-if="detailData.type=='潮粮'">
- <view class="left">扣重比</view>
- <input @input='calculate' v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"></input>
- </view>
- <view class="row row-bottom" v-if="detailData.type=='潮粮'">
- <view class="left">干粮水分(%)</view>
- <input @input='calculate' v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"></input>
- </view>
- <view class="row row-bottom" v-if="detailData.type=='潮粮'">
- <view class="left">潮粮水分(%)</view>
- <input @input='calculate' v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"></input>
- </view>
- <view class="row row-bottom" v-if="detailData.type=='潮粮'">
- <view class="left">纯重(吨)</view>
- <input @input='calculate' v-model='detailData.pureWeight' class="right-bottom"
- placeholder="不可编辑,自动计算" :disabled="true"></input>
- </view>
- <view class="row">
- <view class="left">品级</view>
- <view @click='show3=true'>{{detailData.grade}}</view>
- <u-picker :range="pjList" range-key="grade" @confirm='handlerPicker($event)' v-model="show3" mode="selector">
- </u-picker>
- </view>
- <view class="row">
- <view class="left">经办人</view>
- <view @click='show6=true'>{{detailData.agent}}</view>
- <u-picker :range="handlerList" range-key="agent" @confirm='handlerPicker($event)' v-model="show6" mode="selector">
- </u-picker>
- </view>
- <view class="row">
- <view class="left">入库日期</view>
- <view @click='show4=true'>{{detailData.inOutDate}}</view>
- <u-picker v-model="show4" mode="time" @confirm='dateChange($event)' :params="params">
- <!-- <view >{{detailData.inOutDate ? detailData.inOutDate:"请选择日期" }}</view> -->
- </u-picker>
- <!-- <u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar> -->
- </view>
- <view class="row">
- <view class="left">入库类型</view>
- <view @click='show5=true'>{{detailData.inOutType}}</view>
- <u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)' v-model="show5" mode="selector">
- </u-picker>
- </view>
- <view class="row row-bottom">
- <view class="left">车牌号</view>
- <input v-if="true" @input='' v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
- <view @click='slectCarNo' v-if="false">{{detailData.carNo}}</view>
- </view>
- <view class="row row-bottom has-btn">
- <view class="left">成本(元/吨)</view>
- <input @input='' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="自动获取" disabled="isEditCB"></input>
- <u-button class="edit-btn" @click="edit">编辑</u-button>
- </view>
- <view class="row row-bottom has-btn">
- <view class="left">运费(元/吨)</view>
- <input @input='' v-model='detailData.grossWeight' disabled="isEditYF" class="right-bottom"
- placeholder="自动获取"></input>
- <u-button class="edit-btn">编辑</u-button>
- </view>
- </view>
- <view class="content2">
- <view class="left">上传磅单</view>
- <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
- :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
- @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
- </view>
- <view class="content1">
- <view class="title">
- 质检数据(选填)
- </view>
- <view class="row row-bottom">
- <view class="left">质检员</view>
- <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="输入质检员姓名"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">水分(%)</view>
- <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="输入水分占比"></input>
- </view>
- <view class="row row-bottom" style="border: 0;">
- <view class="left">容重(克/升)</view>
- <input v-model='detailData.netWeight' class="right-bottom" disabled placeholder="输入容重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">热损伤(%)</view>
- <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="输入热损伤占比"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">杂质(%)</view>
- <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="输入杂质占比"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">霉变粒(%)</view>
- <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="输入霉变粒占比"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">不完善粒(%)</view>
- <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="输入不完善粒占比"></input>
- </view>
- </view>
- <u-toast ref="uToast" />
- <view class="bottom-btn">
- <u-button type="primary" class="submit" hover-class="none" @click="submit">暂存</u-button>
- <u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
- </view>
- </view>
- </template>
- <script>
- import upload from '@/components/upload.vue';
- import helper from '@/common/helper.js';
- export default {
- components: {
- upload
- },
- data() {
- return {
- show: false,
- show1: false,
- show2: false,
- show3: false,
- show4: false,
- show5: false,
- show6: false,
- params: {
- year: true,
- month: true,
- day: true,
- hour: true,
- minute: true,
- second: true
- },
- isEditCB:'false',
- isEditYF:'false',
- warehouseName:'',
- binNumber:'',
- contractNoList: [{
- contractNo: "123"
- }],
- typeList: [{
- type: "干粮"
- },
- {
- type: "潮粮"
- }
- ],
- pjList: [{
- grade: "一等品"
- },
- {
- grade: "二等品"
- },
- {
- grade: "三等品"
- },
- {
- grade: "等外"
- }
- ],
- handlerList: [{
- agent: "张三"
- },
- {
- agent: "二等"
- },
- {
- agent: "三等"
- },
- {
- agent: "等外"
- }
- ],
- warehousingTypeList: [],
- action: this.$uploadUrl,
- maxSize: 50 * 1024 * 1024, //限制文件大小 50M
- btnLoading: false, //防止重复点击
- isAdd: true,
- detailData: {
- contractNo: "请选择合同编号",
- carNo:'辽H12345',
- type: "干粮",
- goodsName: "123",
- inOutDate:'请输入入库日期',
- grade:"一等品",
- agent:'张三',
- inOutType:'请选择入库类型',
- qualityInspectionManagement: {}
- }
- }
- },
- onLoad(options) {
- this.binNumber = helper.erpWarehouse.binNumber
- this.warehouseName = helper.erpWarehouse.warehouseName
- this.compId = helper.erpWarehouse.compId
- //获取经办人
- // this.detailData.agent = helper.erpWarehouse.agent
- console.log(helper.erpWarehouse)
- },
- onShow() {
- this.detailData.goodsName = uni.getStorageSync('erpContractNo').goodsName;
- this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
- // 获取入库类型
- this.getrkType()
-
- },
- methods: {
- getrkType(){
- this.$api.doRequest('get', '/commonSysParameter/getInfo', {
- constId: 'CON5'
- }).then(res => {
- this.warehousingTypeList = res.data.data
- })
- },
- contractNopicker(e) {},
- typePicker(e) {
- console.log(e)
- this.detailData.type = this.typeList[e].type
-
-
- },
- pjPicker(e) {
- console.log(e)
- },
- handlerPicker(e) {
- console.log(e)
- },
- dateChange(e){
- console.log(e)
- this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
- },
- warehousingTypePicker(e) {
- console.log(e)
- },
- filterFileType(index, lists) {
- if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
- lists.splice(index, 1);
- // 当前文件不支持
- uni.showModal({
- title: '暂不支持当前图片类型',
- showCancel: false
- });
- } else {
- this.isAdd = false;
- }
- },
- calculate() {
- this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
- },
- getImgUrl(res) {
- this.detailData.addressUrl = res
- console.log(res)
- console.log('------------res-----------')
- },
- onError(error) {
- alert(error)
- console.log('------------error-----------')
- console.log(error)
- },
- contractNopicker(e) {
- // this.detailData.goodsName=this.contractNoList[e[0]].goodsName
- // this.detailData.contractNo=this.contractNoList[e[0]].contractNo
- },
- binNumberpicker(e) {
- this.detailData.binNumber = this.positionList[e[0]].binNumber
- },
- getWeighingManagement() {
- this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
- id: this.id
- }).then(res => {
- if (res.data.code == 200) {
- console.log(res)
- this.detailData = res.data.data
- }
- })
- this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
- id: this.cangId
- }).then(res => {
- if (res.data.code == 200) {
- this.positionList = res.data.data.warehousePositionInfoList
- }
- })
- this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
- compId: '',
- flag: 5
- }).then(res => {
- if (res.data.code == 200) {
- this.contractNoList = res.data.data
- }
- })
- },
- onProgress(e) {
- console.log(e)
- },
- onRemove(index) {},
- submit() {
- if (!this.detailData.grossWeight) {
- this.$api.msg('毛重不能为空')
- return
- }
- if (isNaN(this.detailData.grossWeight) ||
- (String(this.detailData.grossWeight).indexOf('.') != -1 &&
- String(this.detailData.grossWeight).length -
- (String(this.detailData.grossWeight).indexOf('.') + 1) >
- 1) ||
- this.detailData.grossWeight < 1 ||
- this.detailData.grossWeight > 100000
- ) {
- this.$api.msg('毛重输入错误!')
- return
- }
- let that = this
- uni.showModal({
- content: "确定提交检斤信息?",
- success(res) {
- if (res.confirm) {
- that.$api.doRequest('post', '/weighingManagement/api/editGrossWeight',
- that.detailData).then(res => {
- if (res.data.code == 200) {
- that.$api.msg('提交成功')
- uni.navigateBack()
- }
- })
- }
- }
- })
- },
- slectcontractNo(){
- uni.navigateTo({
- url:'/pages/erp/warehousing/selectContractNo?compId='+this.compId
- })
- },
- slectCarNo(){
- uni.navigateTo({
- url:'/pages/erp/warehousing/selectCarNo'
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- uni-page-body {
- overflow: hidden;
- }
- .warp {
- margin: 10rpx;
- padding: 20rpx 20rpx 140rpx 20rpx;
- .top {
- display: flex;
- margin-bottom: 20rpx;
- .top-left {
- margin-right: 20rpx;
- }
- }
- }
- .content,
- .content1,
- .content2 {
- border-radius: 20rpx;
- background: white;
- padding: 20rpx;
- .title {
- font-size: 28rpx;
- font-weight: 600;
- color: #333333;
- }
- .row {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #EEEEEE;
- padding: 21rpx 0;
- .right,
- input {
- font-size: 28rpx;
- color: #333333;
- }
- }
- .row-bottom {
- // border: 0;
- .right-bottom {
- width: 300rpx;
- text-align: right;
- }
- }
- }
- .content1 {
- margin-top: 20rpx;
- }
- .content2 {
- margin-top: 10px;
- display: flex;
- align-items: center;
- .left {
- margin-right: 20px;
- }
- }
- .submit {
- width: 40%;
- background: #22C572;
- border-radius: 10rpx;
- }
- .edit-btn{
- background: #22C572;
- width: 100rpx;
- height: 50rpx;
- margin: 0;
- color: white;
- }
- .has-btn{
- align-items: center;
- }
- .bottom-btn{
- width: 92%;
- position: fixed;
- bottom: 40rpx;
- display: flex;
- z-index: 2;
- }
- </style>
|