Browse Source

登录 订单列表 订单详情等接口对接

master
Enzo 5 years ago
parent
commit
144d7a9116
  1. 2
      canteen/common/api.js
  2. 4
      canteen/pages.json
  3. 5
      canteen/pages/index/index.vue
  4. 31
      canteen/pages/purchase/detail.vue
  5. 4
      canteen/pages/purchase/launch.vue
  6. 26
      canteen/pages/purchase/order.vue
  7. 2
      supplier/pages.json
  8. 3
      supplier/pages/index/index.vue

2
canteen/common/api.js

@ -2,7 +2,7 @@
export const DEV = "dev"; // dev 测试 | prod 正式
export const VERSION = '1.0.0'; // 版本号
// export const DEVURL = 'http://192.168.3.78'; // 测试服请求地址
export const DEVURL = 'http://192.168.3.5'; // 测试服请求地址
export const DEVURL = 'http://192.168.3.96'; // 测试服请求地址
export const PRODURL = ''; // 正式服请求地址
export const API_CANTEEN_LOGIN = '/api/canteen/login'; // 登录

4
canteen/pages.json

@ -6,14 +6,14 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "食堂端"
"navigationBarTitleText": ""
}
},
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#11D189",
"navigationBarTextStyle": "white"
}

5
canteen/pages/index/index.vue

@ -3,7 +3,7 @@
<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.user.canteen.remark }}</view>
<view class="lf-font-28 lf-color-555 lf-m-t-10">{{ canteen.role.name }}</view>
</view>
<view class="list">
<view class="lf-row-between list-item" hover-class="lf-opacity"
@ -49,6 +49,9 @@
console.log("getHomeData", res);
this.block_list = res.data.block;
this.canteen = res.data.canteen;
uni.setNavigationBarTitle({
  title: this.canteen.user.canteen.canteen_name
})
})
},
// 退

31
canteen/pages/purchase/detail.vue

@ -21,17 +21,17 @@
<view class="head">
<view class="lf-row-between list">
<view>车辆</view>
<view class="lf-font-bold"></view>
<view class="lf-font-bold">{{order.car_license}}</view>
</view>
<view class="lf-row-between list">
<view>司机</view>
<view class="lf-font-bold"></view>
<view class="lf-font-bold">{{order.deliver_man}}</view>
</view>
<view class="lf-row-between list">
<view>联系电话</view>
<view class="lf-font-bold"></view>
<view class="lf-font-bold">{{order.deliver_phone}}</view>
</view>
<view class="list">
<view class="list" v-if="order.voucher && order.voucher.length">
<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>
@ -45,20 +45,20 @@
</view>
<view style="height: 100rpx;"></view>
<!-- 操作按钮 -->
<view class="fixed-bottom" v-if="type != 3">
<view v-if="type == 1" class="lf-row-flex-end">
<view class="fixed-bottom" v-if="type != '备货中'">
<view v-if="type == '待发单'" class="lf-row-flex-end">
<button class="btn btn1">编辑</button>
<button class="btn btn2">立即发单</button>
</view>
<view v-else-if="type == 2" class="lf-row-flex-end">
<button class="btn btn2" style="background-color: #FF0000;">撤销订单</button>
<view v-else-if="type == '待接单'" class="lf-row-flex-end">
<button class="btn btn2" style="background-color: #FF0000;" @click="orderStateChange('已撤销')">撤销订单</button>
</view>
<view v-else-if="type == 4" class="lf-row-flex-end">
<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 btn2" @click="$url('/pages/purchase/receipt?p_sn='+ order.p_sn)">确认收货</button>
</view>
<view v-else-if="type == 5" class="lf-row-between">
<view v-else-if="type == '已收货' || type == '已入库'" class="lf-row-between">
<button class="btn btn1">复用采购单</button>
<view class="lf-font-32" style="color: #11D189;">已完成</view>
</view>
@ -75,7 +75,7 @@
return {
headers: [{
key: 'name',
label: '菜名'
label: '物资名称'
},{
key: 'spec',
label: '规格'
@ -107,18 +107,19 @@
}).then(res => {
console.log("xxx",res)
this.order = res.data.order;
let list = res.data.order.sheet || [];
let list = res.data.order.items || [];
let contents = list.map(item => {
return {
name: item.material.m_name,
spec: item.spec.name,
pre_tax_price: {edit: true, value: item.tax_standard_price},
after_tax_price: {edit: true, value: item.non_tax_standard_price},
pre_tax_price: {edit: true, value: item.total_tax_amount},
after_tax_price: {edit: true, value: item.total_non_tax_amount},
spec_id: item.spec.id,
material_id: item.material.id
}
})
this.contents = contents;
this.type = res.data.order.state
})
},
//
@ -138,7 +139,7 @@
state: state
}).then(res => {
console.log("orderStateChange", res);
this.$msg('操作成功');
this.$msg('操作成功').then(()=>{this.$toBack()});
})
}
}

4
canteen/pages/purchase/launch.vue

@ -223,10 +223,10 @@
this.$msg('您未选择物资');
return;
}
let state = ['待发单', '待审核'][_t];
// let state = ['', ''][_t];
this.$http(this.API.API_CANTEEN_PURCHASEAPPLY, {
order: list,
state: state
state: _t
}).then(res => {
console.log("save", res);
this.$msg('操作成功');

26
canteen/pages/purchase/order.vue

@ -19,19 +19,23 @@
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">批次号</view>
<view class="lf-color-black"></view>
<view class="lf-color-black">{{item.batch_sn}}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">订单号</view>
<view class="lf-color-black">{{item.p_sn}}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">发单时间</view>
<view class="lf-color-black">{{ item.receiving_start }}</view>
<view class="lf-color-black">{{ item.send_time }}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">送达时间</view>
<view class="lf-color-black">{{ item.receiving_end }}</view>
<view class="lf-color-black">{{ item.receive_time }}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">商品种类</view>
<view class="lf-color-black"></view>
<view class="lf-color-black">{{item.items_count}}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">订单状态</view>
@ -110,10 +114,22 @@
//
getData(options){
let item = this.tab_list[this.current];
let tabType = 0
if(this.current == 2) {
tabType = 3
}else if(this.current == 3){
tabType = 4
}else if(this.current == 4){
tabType = 5
}else if(this.current == 5){
tabType = 7
}else {
tabType = this.current
}
this.$http(this.API.API_CANTEEN_PURCHASEORDERLIST, {
page: item.page,
page_size: this.page_size,
state: ''
state: tabType || ''
}).then(res => {
console.log("getData", res);
let list = res.data.list || {};

2
supplier/pages.json

@ -6,7 +6,7 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "供应端",
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
},

3
supplier/pages/index/index.vue

@ -64,6 +64,9 @@
this.block_list = res.data.block;
// supplier_id
// getApp().globalData.supplier_id = res.data.supplier.id;
uni.setNavigationBarTitle({
  title: this.supplier.user.supplier.supplier_name
})
});
}
}

Loading…
Cancel
Save