123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- <template>
- <view class="content">
- <view class="top">
- <u-search placeholder="输入编号/客户号/车牌号" v-model="inputKeyword" @search="getList()"></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" :list="warehouseList" @confirm="confirmWarehouse"></u-select>
- </view>
- <view class="middle">
- <view class="item-style" v-for="(item,index) in dataList" :key="index" @click="toDetail(item)">
- <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.contractNo}}
- </view>
- <view class="bottom">{{item.updateDate}}</view>
- </view>
- </view>
- <view class="right">{{item.customer}}</view>
- </view>
- <view class="row2" v-if="item.paymentManagement">
- <view>{{item.paymentManagement.customerName}}</view>
- <view>{{item.paymentManagement.carNo}}</view>
- <view>{{item.paymentManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)
- </view>
- </view>
- <view class="row3">
- <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.grossWeight?item.grossWeight:'未称重'}}</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('acquisitionWeightOut.weight')&&item.status!='已称毛重'" class="right"
- @click.stop="tareClick(item)">皮重</view>
- <view v-if="getRoles('acquisitionWeightOut.mao')&&!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
- !(item.paymentManagement&&item.paymentManagement.status=='部分收款')
- " class="right" :class="item.status=='已质检'?'gray':''" @click.stop="grossWeightClick(item)">毛重</view>
- <view class="right" v-if='getRoles("acquisitionWeightOut.view")' @click.stop="delClick(item)">删除
- </view>
- </view>
- </view>
- </view>
- <view v-show="isContent">
- <uni-load-more :status="loadStatus"></uni-load-more>
- </view>
- <u-toast ref="uToast" />
- <view class="footer">
- <view @click='add' class="button" v-if='getRoles("acquisitionWeightOut.new")'>新增</view>
- </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';
- import helper from '@/common/helper.js';
- export default {
- data() {
- return {
- isShowAlert: false,
- content: '登录信息过期需要重新登录,是否立即登录?',
- inputKeyword: '',
- warehouseName: '',
- isShowWarehouse: false,
- warehouseList: [],
- isContent: false,
- loadStatus: 'noMore',
- dataList: [],
- pageSize: 10,
- currentPage: 1,
- cangId: ''
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onShow() {
- 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
- })
- }
- });
- },
- onPullDownRefresh() {
- this.currentPage = 1
- this.gridList = []
- this.getList()
- },
- onReachBottom() {
- this.currentPage += 1
- this.getList()
- // this.getMoreNews()
- },
- methods: {
- 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
- },
- add() {
- console.log(this.warehouseName)
- uni.navigateTo({
- url: '/pages/erpbusiness/acquisitionInspection/add_check_the_weight?cangId=' + this.cangId +
- '&warehouseName=' + this.warehouseName
- })
- },
- loadData() {
- this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelfApp', {
- compId: this.compId
- }).then(res => {
- console.log("warehouseBaseInfo", res)
- let _resData = res.data.data
- for (let i = 0; i < _resData.length; i++) {
- let _obj = {
- "label": _resData[i].warehouseName,
- "value": _resData[i].id,
- }
- this.warehouseList.push(_obj)
- }
- this.warehouseName = this.warehouseList[0].label
- this.cangId = this.warehouseList[0].value
- this.getList()
- })
- },
- //获取列表
- getList() {
- this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
- compId: '',
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- searchKeyWord: this.inputKeyword,
- warehouseName: this.warehouseName,
- managementType: 3,
- }).then(res => {
- var data = res.data.data.records
- this.dataList = this.dataList.concat(data)
- console.log(res.data.data.records)
- if (res.data.data.records.length == 0) {
- this.isContent = true
- }
- // console.log("--------------------------------")
- // console.log("this.dataList",this.dataList)
- })
- },
- selectWarehouse() {
- this.isShowWarehouse = true
- },
- confirmWarehouse(e) {
- console.log(e)
- this.warehouseName = e[0].label
- this.cangId = e[0].value
- },
- //毛重
- grossWeightClick(item) {
- if (item.status == "已质检") return;
- console.log(item)
- uni.navigateTo({
- url: './grossWeightDetail1?id=' + item.id + '&cangId=' + this.cangId
- })
- },
- tareClick(item) {
- //
- uni.navigateTo({
- url: './tareDetail1?id=' + item.id + '&cangId=' + this.cangId
- })
- },
- delClick(val) {
- console.log(val)
- let that = this;
- uni.showModal({
- content: "确定删除检斤信息?",
- success: function(res) {
- if (res.confirm) {
- console.log(that.detailData)
- that.$api.doRequest('post', '/weighingManagement/api/deleteWeightcheck', {
- id: val.id
- }).then(res => {
- if (res.data.code == 200) {
- that.$refs.uToast.show({
- title: '删除成功',
- type: 'success',
- url: '/pages/erpbusiness/acquisitionInspection/warehouseWeighing'
- })
- } else {
- that.$refs.uToast.show({
- title: '删除失败',
- type: 'error',
- })
- }
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- //
- }
- })
- },
- toDetail(item) {
- uni.navigateTo({
- url: './tareDetail2?id=' + item.id + '&cangId=' + this.cangId
- })
- }
- }
- }
- </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-evenly;
- margin: 20rpx;
- color: #878C9C;
- }
- .row3 {
- display: flex;
- margin-top: 20rpx;
- .row3-item {
- display: flex;
- margin-right: 40rpx;
- .left {
- background: #22C572;
- border-radius: 10rpx;
- padding: 2rpx 10rpx;
- box-sizing: border-box;
- color: white;
- font-size: 12px;
- margin-right: 15rpx;
- }
- }
- }
- .row4 {
- margin-top: 10px;
- display: flex;
- justify-content: flex-end;
- .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;
- }
- .gray {}
- .footer {
- background: #fff;
- position: fixed;
- bottom: 0;
- width: 100%;
- padding: 20px 10px;
- z-index: 10;
- .button {
- background: #22C572;
- width: 90%;
- margin: 0 auto;
- padding: 10px;
- color: #fff;
- text-align: center;
- border-radius: 30px;
- }
- }
- </style>
|