123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- <template>
- <view class="content">
- <view class="top">
- <u-search placeholder="输入编号/客户号/车牌号" v-model="inputKeyword" @search="getList(true)"></u-search>
- <view class="dropdown">
- <view class="left" @click="selectWarehouse">
- <view>{{warehouseName}}</view>
- <u-icon name="arrow-down" color=""></u-icon>
- </view>
- <!-- <view class="right">
- <u-icon name="checkmark-circle-fill" color="#22C572"></u-icon>
- <view class="default">默认</view>
- </view> -->
- </view>
- <u-select v-model="isShowWarehouse" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
- </u-select>
- </view>
- <view class="middle">
- <view class="item-style" v-for="(item,index) in dataList" :key="index">
- <view class="row1">
- <view class="row1-left">
- <view class="left status1" v-if="item.status=='已质检'">检</view>
- <view class="left status2" v-if="item.status=='已称皮重'">皮</view>
- <view class="left status3" v-if="item.status=='已称毛重'">毛</view>
- <view>
- <view class="top-title">
- {{item.number}}
- </view>
- <view class="bottom">{{item.updateDate}}</view>
- </view>
- </view>
- <view class="right">{{item.secretaryWeigher}}</view>
- </view>
- <view class="row2" v-if="item.qualityInspectionManagement">
- <view>{{item.qualityInspectionManagement.customerName}}</view>
- <view>{{item.qualityInspectionManagement.carNo}}</view>
- <view>
- {{item.qualityInspectionManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)
- </view>
- </view>
- <view class="row3">
- <view class="row3-item">
- <view class="left">毛</view>
- <view>{{item.grossWeight?item.grossWeight:'未称重'}}</view>
- </view>
- <view class="row3-item">
- <view class="left">皮</view>
- <view>{{item.tare?item.tare:'未称重'}}</view>
- </view>
- <view class="row3-item">
- <view class="left">净</view>
- <view>{{item.netWeight?item.netWeight:'未称重'}}</view>
- </view>
- </view>
- <view class="row4">
- <view v-if="getRoles('acquisitionWeight.print')&&(item.status=='已称皮重'||item.status=='已称毛重')" class="right"
- @click="print(item)">打印</view>
- <view v-if="getRoles('acquisitionWeight.mao')&&item.status!='已称皮重'" class="right"
- @click="grossWeightClick(item)">毛重</view>
- <view v-if="getRoles('acquisitionWeight.weight')&&(!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
- !(item.paymentManagement&&item.paymentManagement.status=='部分收款')) && item.status!='已质检' && item.allow != 2"
- class="right" @click="tareClick(item)">皮重</view>
- </view>
- </view>
- </view>
- <view v-show="isContent">
- <uni-load-more :status="loadStatus"></uni-load-more>
- </view>
- <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
- :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
- :showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- isShowAlert: false,
- content: '登录信息过期需要重新登录,是否立即登录?',
- inputKeyword: '',
- warehouseName: '',
- warehouseId: '',
- isShowWarehouse: false,
- warehouseList: [],
- isContent: false,
- loadStatus: 'noMore',
- dataList: [],
- pageSize: 10,
- currentPage: 1,
- cangid: '',
- warehouseType:'',
- }
- },
- onShow() {
- if (this.cangid) {
- uni.setStorageSync("cangid", this.cangid)
- } else {
- this.cangid = uni.getStorageSync("cangid")
- }
- this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
- if (res.data.data == "INVALID") {
- this.isShowAlert = true;
- // uni.showModal({
- // title: "提示",
- // content: "Session过期需要重新登录,是否立即登录",
- // showCancel: true,
- // confirmText: '登录',
- // success(e) {
- // if (e.confirm) {
- // uni.navigateTo({
- // url: '/pages/public/login'
- // })
- // }
- // }
- // })
- } else {
- this.compId = uni.getStorageSync('pcUserInfo').compId
- console.log("compId", this.compId)
- this.loadData()
- }
- })
- .catch(res => {
- if (res.message) {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onBackPress() {
- uni.switchTab({
- url: '/pages/user/user'
- });
- return true
- },
- onPullDownRefresh() {
- this.currentPage = 1
- this.gridList = []
- this.getList(true)
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- onReachBottom() {
- this.currentPage += 1
- this.getList(false)
- // this.getMoreNews()
- },
- methods: {
- print(val){
- uni.setStorageSync("acquisitionInspection_print",val)
- uni.navigateTo({
- url: '/pages/erpbusiness/jjbleConnect'
- })
- },
- alertBtn() {
- uni.navigateTo({
- url: '/pages/public/login'
- })
- },
- cancelClick() {
- this.isShowAlert = false
- },
- //获取当前按钮权限
- getRoles: function(role) {
- let _roles = uni.getStorageSync('rolesList')
- for (let i = 0; i < _roles.length; i++) {
- if (_roles[i] == role) {
- return true
- }
- }
- return false
- },
- loadData() {
- var that = this
- this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelfApp', {
- compId: '',
- personCharge: this.userInfo.phone
- }).then(res => {
- console.log("warehouseBaseInfo", res)
- let _resData = res.data.data
- that.warehouseList = []
- for (let i = 0; i < _resData.length; i++) {
- let _obj = {
- "label": _resData[i].warehouseName,
- "value": _resData[i].id,
- }
- that.warehouseList.push(_obj)
- if (that.cangid && that.cangid == _resData[i].id) {
- that.warehouseName = _resData[i].warehouseName
- that.warehouseId = _resData[i].id
- that.warehouseType = _resData[i].warehouseType
- }
- }
- if (that.warehouseList.length > 0 && !that.cangid) {
- that.warehouseName = that.warehouseList[0].label
- that.warehouseId = that.warehouseList[0].value
- that.cangid = that.warehouseList[0].value
- that.warehouseType =that.warehouseList[0].warehouseType
- }
- this.getList(true)
- })
- },
- //获取列表
- getList(flag) {
- console.log(11111
- )
- uni.showLoading({
- title: "正在加载"
- })
- this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
- compId: '',
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- searchKeyWord: this.inputKeyword,
- warehouseName: this.warehouseName,
- managementType: 1,
- }).then(res => {
- var data = res.data.data.records
- for (let i = 0; i < data.length; i++) {
- if (data[i].paymentManagement) {
- if (data[i].paymentManagement.approveStatus || data[i].paymentManagement.status !=
- '待结算') {
- data[i].allow = 2
- }
- } else {
- data[i].allow = 1
- }
- }
- if (flag) {
- this.dataList = data
- } else {
- this.dataList = this.dataList.concat(data)
- }
- if (res.data.data.records.length == 0) {
- this.isContent = true
- }
- console.log("--------------------------------")
- console.log("this.dataList", this.dataList)
- uni.hideLoading()
- })
- .catch(res => {
- uni.showToast({
- title: '系统异常,请联系管理员',
- icon: 'none',
- duration: 2000
- })
- uni.hideLoading()
- })
- },
- selectWarehouse() {
- this.isShowWarehouse = true
- },
- confirmWarehouse(e) {
- console.log(e)
- this.warehouseName = e[0].label
- this.dataList.warehouseName = e[0].label;
- this.warehouseType== e[0].warehouseType
- this.cangid = e[0].value
- uni.setStorageSync("cangid", this.cangid)
- this.getList(true)
- },
- //毛重
- grossWeightClick(val) {
- console.log(val)
- val.warehouseName = this.warehouseName
- val.warehouseId = this.warehouseId
- uni.navigateTo({
- url: './grossWeightDetail?detailData=' + JSON.stringify(val)
- })
- },
- tareClick(val) {
- val.warehouseName = this.warehouseName
- val.warehouseId = this.warehouseId
- val.warehouseType = this.warehouseType
- uni.navigateTo({
- url: './tareDetail?detailData=' + JSON.stringify(val)
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .top {
- background: white;
- padding: 20rpx;
- border-radius: 0 0 20rpx 40rpx;
- }
- .dropdown {
- display: flex;
- justify-content: space-between;
- align-items: center;
- position: relative;
- margin: 20rpx 0;
- padding: 0 13rpx;
- .right,
- .left {
- display: flex;
- align-items: center;
- }
- }
- .item-style {
- background: white;
- margin: 20rpx;
- padding: 20rpx;
- .row1 {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .row1-left {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .left {
- margin-right: 20rpx;
- }
- .top-title {
- font-size: 32rpx;
- font-weight: 600;
- color: #333333;
- }
- .bottom {
- color: #878C9C;
- }
- .right {
- font-size: 28rpx;
- font-weight: 600;
- color: #333333;
- }
- }
- }
- .row2 {
- display: flex;
- background: #F9F9FA;
- border-radius: 10rpx;
- padding: 10rpx 0;
- justify-content: space-around;
- margin: 20rpx 0;
- color: #878C9C;
- padding-left: 24rpx;
- align-items: center;
- }
- .row3 {
- display: flex;
- margin-top: 30rpx;
- padding-left: 14rpx;
- .row3-item {
- display: flex;
- margin-right: 40rpx;
- align-items: center;
- .left {
- background: #22C572;
- border-radius: 10rpx;
- padding: 2rpx 10rpx;
- box-sizing: border-box;
- color: white;
- font-size: 12px;
- margin-right: 15rpx;
- }
- }
- }
- .row4 {
- display: flex;
- justify-content: flex-end;
- margin-top: 10px;
- .right {
- border: 1px solid #CDCDCD;
- border-radius: 45rpx;
- padding: 10rpx 30rpx;
- margin-left: 20rpx;
- }
- }
- }
- .status1,
- .status2,
- .status3 {
- padding: 8rpx 12rpx;
- border-radius: 50%;
- color: white;
- }
- .status1 {
- background: #FD714F;
- }
- .status2 {
- background: #22C572;
- }
- .status3 {
- background: #3296FA;
- }
- </style>
|