Browse Source

Merge branch 'master' of http://8.134.10.79:3000/Leadfyy.co/uniapp-supplychain

# Conflicts:
#	canteen/pages/index/index.vue
#	canteen/pages/purchase/detail.vue
#	canteen/pages/purchase/launch.vue
master
Enzo 5 years ago
parent
commit
a6fbf03d46
  1. 17
      canteen/pages/delivery/apply.vue
  2. 3
      canteen/pages/index/index.vue
  3. 196
      canteen/pages/purchase/detail.vue
  4. 38
      canteen/pages/purchase/launch.vue
  5. 1
      supplier/pages/index/index.vue
  6. 9
      supplier/pages/offer/index.vue
  7. 9
      supplier/pages/order/detail.vue

17
canteen/pages/delivery/apply.vue

@ -34,14 +34,29 @@
data(){
return {
headers: [{
label: '菜品名称',
label: '物资名称',
key: 'material_name'
},{
label: '规格',
key: 'spec_name'
},{
key: 'brand',
label: '品牌'
},{
key: 'quality_level',
label: '品级'
},{
label: '编号',
key: 'm_sn'
},{
label: '供应商',
key: 'supplier_name'
},{
label: '批次',
key: 'purchase_id'
},{
key: 'delivery_number',
label: '出库数量'
}],
contents: [],
warehouse_list: {}

3
canteen/pages/index/index.vue

@ -3,7 +3,8 @@
<view class="lf-row-center lf-flex-column head" v-if="$isRight(canteen)">
<image :src="canteen.avatar"></image>
<view class="lf-m-t-20 lf-font-32 lf-font-bold lf-color-black">{{ canteen.name }}</view>
<view class="lf-font-28 lf-color-555 lf-m-t-10">{{ canteen.role.name }}</view>
<view class="lf-font-28 lf-color-555 lf-m-t-10">{{ canteen.role }}</view>
</view>
<view class="list">
<view class="lf-row-between list-item" hover-class="lf-opacity"

196
canteen/pages/purchase/detail.vue

@ -31,12 +31,18 @@
<view>联系电话</view>
<view class="lf-font-bold">{{order.deliver_phone}}</view>
</view>
<view class="list" v-if="order.voucher && order.voucher.length">
<view>证明材料</view>
<view class="list">
<view>证明材料-供应端</view>
<view class="lf-flex-wrap lf-m-t-10">
<image :src="item.voucher_pic" @click="lookImage(index)" class="ms-img" v-for="(item, index) in order.voucher" :key="item.id"></image>
</view>
</view>
<view class="list" v-if="voucher_list.length">
<view>证明材料-食堂端</view>
<view class="lf-flex-wrap lf-m-t-10">
<image :src="item" @click="lookPopupImage(index)" class="ms-img" v-for="(item, index) in voucher_list" :key="index"></image>
</view>
</view>
</view>
<self-line></self-line>
<view class="lf-m-t-30 lf-m-l-32">
@ -55,7 +61,7 @@
</view>
<view v-else-if="type == '已发货'" class="lf-row-flex-end">
<button class="btn btn1">退单</button>
<button class="btn btn1 lf-m-l-20">上传凭证</button>
<button class="btn btn1 lf-m-l-20" @click="is_show_voucher = true">上传凭证</button>
<button class="btn btn2" @click="$url('/pages/purchase/receipt?p_sn='+ order.p_sn)">确认收货</button>
</view>
<view v-else-if="type == '已收货' || type == '已入库'" class="lf-row-between">
@ -63,6 +69,28 @@
<view class="lf-font-32" style="color: #11D189;">已完成</view>
</view>
</view>
<!-- 弹出层-上传凭证 -->
<u-popup v-model="is_show_voucher" mode="center" border-radius="20">
<view class="popup-box">
<view class="content">
<view class="popup-title">上传凭证信息</view>
<view class="popup-desc">请在此处上传检验检疫凭证售卖资质等证书</view>
<view class="popup-images">
<view class="popup-image-item" v-for="(item, index) in voucher_list" :key="index" @click="lookPopupImage(index)">
<image :src="item" mode="aspectFill"></image>
<view class="remove-image" @click.stop="removeInage(index)">
<u-icon name="close-circle"></u-icon>
</view>
</view>
<view class="popup-image-item popup-image-item-after" @click="uploadImage" v-if="voucher_list.length < 6"></view>
</view>
</view>
<view class="foot-btn">
<u-button class="popup-btn" @click="is_show_voucher = false">取消</u-button>
<u-button class="popup-btn" @click="submitImage">确定</u-button>
</view>
</view>
</u-popup>
</view>
</template>
@ -89,17 +117,92 @@
contents: [],
order: {},
p_sn: '',
type: 4
type: 4,
is_show_voucher: false,
voucher_list: []
}
},
onLoad(options){
// TODO 1
// TODO 2
// todo /uniapp-supplychain/supplier/pages/gonghuo/detail
this.p_sn = options.p_sn || '';
// TODO table
this.getData();
},
methods: {
//
lookPopupImage(current){
if(this.voucher_list.length <= 0) return;
this.$u.throttle(() => {
uni.previewImage({
urls: this.voucher_list,
current: current
})
}, 500);
},
//
removeInage(current){
this.voucher_list.splice(current, 1);
},
//
uploadImage(){
let current_count = this.voucher_count - this.voucher_list.length;
if(current_count == 0) return;
uni.chooseImage({
count: current_count,
complete: result => {
this.voucher_list.push(...result.tempFilePaths);
}
})
},
// ossurl
submitImage(){
let that = this;
let voucher_list = that.voucher_list;
if(voucher_list.length <= 0){
return that.$msg('您未上传图片哦');
};
that.is_show_voucher = false;
uni.showLoading({
title: '正在上传中...'
})
let http_list = [];
voucher_list.map(item => {
let itemP = new Promise((resolve, reject) => {
uploadFile(item, (res) => {
resolve(res);
}, (err) => {
reject(err);
}, this);
})
http_list.push(itemP);
})
Promise.all(http_list).then(res => {
console.log("上传完毕", res);
let images = res.map(item => item.url);
// todo url
// that.$http(that.API.API_SUPPLIER_PURCHASESAVEVOUCHER, {
// p_sn: that.p_sn,
// images: images,
// }).then(result => {
// uni.hideLoading();
// that.voucher_list = [];
// that.$msg('!')
// }).catch(err => uni.hideLoading());
}).catch(err => {
uni.hideLoading();
uni.showModal({
title: '',
content: JSON.stringify(err),
showCancel: false,
confirmColor: '#1833F2'
})
})
},
getData(){
this.$http(this.API.API_CANTEEN_PURCHASEDETAIL, {
p_sn: this.p_sn
@ -223,4 +326,89 @@
margin-right: 0rpx;
}
}
.popup-box{
width: 686rpx;
height: max-content;
display: flex;
justify-content: space-between;
flex-direction: column;
.content{
.popup-title{
font-size: 32rpx;
font-weight: bold;
color: #222222;
text-align: center;
margin-top: 40rpx;
}
.popup-desc{
font-size: 28rpx;
color: #555555;
text-align: center;
margin-top: 20rpx;
margin-bottom: 18rpx;
}
.popup-images{
display: flex;
flex-wrap: wrap;
padding: 22rpx;
margin-bottom: 18rpx;
.popup-image-item{
width: 198rpx;
height: 198rpx;
margin: 8rpx;
background: #F5F5F5;
border-radius: 10rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.remove-image{
position: absolute;
right: -8rpx;
top: -16rpx;
color: #e74c3c;
font-size: 40rpx;
padding: 8rpx;
}
}
.popup-image-item-after::after{
content: '+';
position: absolute;
left: 30%;
top: 14%;
font-size: 100rpx;
color: #777777;
}
}
.popup-input{
padding: 0 60rpx;
box-sizing: border-box;
height: 90rpx;
font-size: 28rpx;
color: #555555;
input{
text-align: right;
}
}
}
.foot-btn{
height: 90rpx;
width: 100%;
border-top: 1rpx solid #E5E5E5;
display: flex;
box-sizing: border-box;
.popup-btn{
width: 50%;
height: 100%;
border: none;
border-radius: initial;
&:last-child{
border-left: 1rpx solid #E5E5E5;
color: #1833F2;
}
}
}
}
</style>

38
canteen/pages/purchase/launch.vue

@ -25,7 +25,7 @@
<view class="lf-row-between lf-p-30 lf-p-l-32 lf-p-r-32 lf-font-28">
<view class="lf-color-black">收货时间</view>
<picker mode="date" :value="date" @change="pickerChange">
<view class="lf-color-555 lf-text-right" style="width: 400rpx;">{{ date }}</view>
<view class="lf-color-555 lf-text-right" style="width: 400rpx;">{{ date || '请选择收货时间...' }}</view>
</picker>
</view>
<self-line></self-line>
@ -64,7 +64,8 @@
},
data(){
return {
date: this.$shared.recordTime(new Date(), '-', 'date'), //
// date: this.$shared.recordTime(new Date(), '-', 'date'), // ,
date: '',
material_list: {}, //
show_material: false, //
render_material_list: {} //
@ -142,7 +143,18 @@
let detailValue = event.detailValue; // table input
let supplier_item = this.render_material_list[supplier_id]; //
let material_item = supplier_item.material_list[material_index]; //
material_item.purchase_number.value = detailValue; //
if(material_item.purchase_limit <= detailValue){
material_item.purchase_number.value = detailValue; //
}else{
uni.showModal({
title: '温馨提示',
content: '采购数量必须大于起购数量',
showCancel: false,
success: result => {
material_item.purchase_number.value = material_item.purchase_limit;
}
})
}
console.log("render_material_list_change", this.render_material_list);
},
// table
@ -186,18 +198,22 @@
let material_list = this.render_material_list;
let list = [];
let is_empty = true; //
let is_right = true; //
for(let i in material_list){
if(Object.keys(material_list[i].material_list).length){
is_empty = false;
let material = material_list[i].material_list;
//
let arr = material.map(item => {
if(item.purchase_limit > item.purchase_number.value){
is_right = false;
};
return {
m_id: item.material_id,
m_spec_id: item.spec_id,
tax_price: item.tax_price,
non_tax_price: item.non_tax_price,
purchase_number: item.purchase_number.value || 0
purchase_number: Number(item.purchase_number.value) || item.purchase_limit
}
});
// :
@ -219,14 +235,24 @@
}
console.log("list", list)
let deadline = this.date;
if(!deadline){
this.$msg('请选择收货时间');
return;
}
if(is_empty){
this.$msg('您未选择物资');
return;
}
// let state = ['', ''][_t];
if(!is_right){
this.$msg('采购数量需大于起购数量');
return;
}
// let state = ['', ''][_t];
this.$http(this.API.API_CANTEEN_PURCHASEAPPLY, {
order: list,
state: _t
state: _t,
deadline: deadline
}).then(res => {
console.log("save", res);
this.$msg('操作成功');

1
supplier/pages/index/index.vue

@ -3,6 +3,7 @@
<view class="lf-row-center lf-flex-column head">
<image :src="supplier.avatar"></image>
<view class="lf-m-t-20 lf-font-32 lf-font-bold lf-color-black">{{ supplier.name }}</view>
<view class="lf-font-28 lf-color-555 lf-m-t-10">{{ supplier.role }}</view>
</view>
<view class="list">
<view class="lf-row-between list-item" hover-class="lf-opacity"

9
supplier/pages/offer/index.vue

@ -241,16 +241,17 @@
id: item.quotation_id,
tax_price: item.tax_price.value,
non_tax_price: item.non_tax_price.value,
purchase_limit: item.purchase_limit.value || 1
purchase_limit: Number(item.purchase_limit.value) || 1
})
});
//
let state = ['待发起', '待审核'][_t];
this.$http(this.API.API_SUPPLIER_QUOTATIONSAVE, {
data: list,
state: state
state: state,
q_sn: this.code
}).then(res => {
this.$msg(res.data).then(result => {
this.$msg('操作成功').then(result => {
this.$toBack();
})
})
@ -271,7 +272,7 @@
m_spec_id: item.spec_id,
tax_price: item.tax_price.value,
non_tax_price: item.non_tax_price.value,
purchase_limit: item.purchase_limit.value || 1
purchase_limit: Number(item.purchase_limit.value) || 1
})
}
});

9
supplier/pages/order/detail.vue

@ -73,7 +73,8 @@
key: 'non_tax_price'
}],
contents: [],
q_sn: '' //
q_sn: '', //
show_count: 0
}
},
computed: {
@ -93,6 +94,12 @@
this.q_sn = options.q_sn;
this.getDetail();
},
onShow(options){
this.show_count++;
if(this.show_count > 1){
this.getDetail();
}
},
methods: {
stateType(val){
let type = 0;

Loading…
Cancel
Save