Authored by htoooth

fix

... ... @@ -30,8 +30,12 @@
return service.orderInfo(this.id).then((result) =>{
if (result.code === 200) {
this.data = result.data;
this.$emit('on-change', this.data);
}
});
},
refresh() {
this.getOrderInfo();
}
}
};
... ...
... ... @@ -2,7 +2,7 @@
<LayoutBody>
<LayoutList>
<Table ref="goodsList" border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
<Page v-if="!selected" :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="pageData.pageSize" show-total></Page>
</LayoutList>
... ... @@ -45,7 +45,7 @@
},
{
title: '货品年季',
key: 'productName',
key: 'goodsYearSeason',
align: 'center',
},
{
... ... @@ -55,7 +55,6 @@
},
{
title: '色系/厂家颜色',
key: 'storage',
align: 'center',
render: (h, params) => {
return (
... ... @@ -65,7 +64,6 @@
},
{
title: '性别/尺码',
key: 'salePrice',
align: 'center',
render: (h, params) => {
return (
... ... @@ -75,7 +73,6 @@
},
{
title: '吊牌/销售价/进货价',
key: 'editTime',
align: 'center',
render: (h, params) => {
return (
... ... @@ -109,14 +106,14 @@
if (!this.selected) {
if (!params.row.hasAdded) {
return (
<i-button type = 'primary' onClick={() => this.create(params)}> 加入 </i-button>
<i-button type='primary' size="small" onClick={() => this.create(params)}> 加入 </i-button>
);
}
} else {
return (
<div>
<i-button type = 'primary' onClick={() => this.update(params)}> 保存 </i-button>
<i-button type = 'primary' onClick={() => this.delete(params)}> 删除 </i-button>
<i-button type='primary' size="small" onClick={() => this.update(params)}> 保存 </i-button>
<i-button type='ghost' size="small" onClick={() => this.delete(params)}> 删除 </i-button>
</div>
);
}
... ... @@ -155,7 +152,7 @@
return i;
});
this.pageData.total = res.data.totalCount;
this.pageData.current = res.data.pageNo;
this.pageData.current = res.data.pageNo + 1;
}
});
} else {
... ... @@ -173,8 +170,6 @@
this.pageData.current = page;
this.search();
},
onChangeStatus() {
},
create(params) {
let data = {
proRequisitionFormId: this.oid,
... ... @@ -188,7 +183,10 @@
service.addGoods(data).then((result) => {
if (result.code === 200) {
this.$Message.info('加入成功');
this.search();
} else {
this.$Message.error('加入失败');
}
});
},
... ... @@ -205,7 +203,10 @@
service.updateGoods(data).then((result) => {
if (result.code === 200) {
this.$Message.info('更新成功');
this.search();
} else {
this.$Message.error('更新失败');
}
});
},
... ... @@ -219,7 +220,10 @@
service.deleteGoods(data).then((result) => {
if (result.code === 200) {
this.$Message.info('删除成功');
this.search();
} else {
this.$Message.info('删除失败');
}
});
},
... ...
... ... @@ -8,7 +8,7 @@
<div class="deliver-info">
<Row class-name="info-row">
<Col span="4" class-name="info-col">收货仓库:</Col>
<Col span="20">{{houseInfo.storehouseName}}</Col>
<Col span="20">{{houseInfo.storeroomName}}</Col>
</Row>
<Row class-name="info-row">
<Col span="4">物流公司:</Col>
... ... @@ -16,18 +16,22 @@
<SelectExpress v-model="expressId"> </SelectExpress>
</Col>
</Row>
<Row>
<Row class-name="info-row">
<Col span="4">物流单号:</Col>
<Col span="20"><Input v-model="expressNumber"></Input></Col>
</Row>
<p class="info-tip">
发往:{{houseInfo.storehouseName}}{{houseInfo.address}}{{houseInfo.adminName}}
</p>
<Row class-name="info-row">
<Col span="4" class="info-tip">发往:</Col>
<Col span="20" class="info-tip">
<div>{{houseInfo.storeroomName}} &nbsp; {{houseInfo.address}} &nbsp; {{houseInfo.adminName}}</div>
</Col>
</Row>
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="cancel">取消</Button>
<Button type="primary" size="large" @click="deliver">保存</Button>
<Button type="primary" size="large" :loading="showLoading" @click="deliver">保存</Button>
</div>
</Modal>
</template>
... ... @@ -42,33 +46,42 @@
data() {
return {
showModal: false,
showLoading: true,
submitting: false,
houseInfo: {},
showLoading: false,
expressId: '',
expressNumber: '',
id: '',
selection: [],
houseInfo: {}
};
},
watch: {
},
methods: {
show() {
show(id, selection) {
this.showModal = true;
this.expressId = '';
this.expressNumber = '';
this.selection = selection;
this.id = id;
this.houseInfo = this.context.info;
},
cancel() {
this.showModal = false;
this.showLoading = false;
this.expressId = '';
this.expressNumber = '';
this.id = '';
this.selection = [];
this.houseInfo = {};
},
deliver() {
if (this.submitting) {
return;
}
this.submittiong = true;
const params = {
expressId: this.expressId,
expressNumber: this.expressNumber,
expressGoodsMap: {}
proRequisitionFormId: this.id,
expressGoodsBos: this.selection.map((i) => {
return {
sku: i.productSku,
num: i.num
};
})
};
if (!(params.expressId + '').length) {
... ... @@ -81,7 +94,16 @@
return;
}
service.sendOrder(params);
this.showLoading = true;
service.sendOrder(params).then((result) => {
if (result.code === 200) {
this.$Message.info('发货成功');
} else {
this.$Message.error('发货失败');
}
this.cancel();
});
}
},
components: {
... ... @@ -100,9 +122,7 @@
}
.info-tip {
margin-top: 20px;
color: #ff0000;
text-align: center;
}
.ivu-modal {
... ...
... ... @@ -2,47 +2,78 @@
<LayoutBody>
<LayoutFilter>
<FilterItem>
<div>单号:173520 | 发往:北京1号仓库 北京顺义区 吴康</div>
<div>品牌:中国阿迪 | 店铺:得宝纸巾单品专卖店【测试】 | 供应商:阿迪供应商 | 进项税率:0.0300 | 数量:0 | 总吊牌金额:0 | 总进货金额:0</div>
<OrderInfo :id="id" @on-change="onOrderChange"></OrderInfo>
</FilterItem>
</LayoutFilter>
<LayoutAction>
<Button type="primary" @click="onClickCreate">发货</Button>
<Button type="primary" @click="onClickCreate" :disabled="this.selection.length === 0">发货</Button>
</LayoutAction>
<LayoutList>
<Table border :context="self" :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="20" show-total></Page>
<Table ref="goodsList" border :columns="tableCols" :data="tableData"
@on-selection-change="onSelectChange">
</Table>
</LayoutList>
<SendModal ref="sendModal"></SendModal>
<SendModal :context="self" ref="sendModal"></SendModal>
</LayoutBody>
</template>
<script>
import {tableCols, tableData, pageData} from './store/deliver-table';
import {tableCols} from './store/deliver-table';
import SendModal from './components/send-modal';
import OrderInfo from './components/order-info';
import service from 'services/invoice-service';
import _ from 'lodash';
export default {
data() {
return {
tableCols: tableCols.call(this),
tableData: [],
id: null,
brandId: null,
selection: [],
self: this,
tableCols,
tableData,
pageData,
info: null
};
},
mounted() {
created() {
this.id = this.$route.params.id;
this.brandId = this.$route.query.brandId;
this.getGoods();
},
methods: {
onClickCreate() {
this.$refs.sendModal.show();
this.tableData = this.$refs.goodsList.rebuildData;
this.$refs.sendModal.show(this.id, this.tableData.filter(i => {
return _.find(this.selection, (s) => s.id === i.id);
}));
},
getGoods() {
return service.listProduct({
proRequisitionFormId: this.id,
brandId: this.brandId
}).then((res) => {
if (res.code === 200) {
this.tableData = (res.data.goodsList || []).map((i) => {
i.num = null;
return i;
});
}
});
},
onSelectChange(selection) {
this.selection = selection;
},
onOrderChange(data) {
this.info = data;
}
},
components: {
SendModal
SendModal,
OrderInfo
}
};
</script>
... ...
... ... @@ -2,40 +2,41 @@
<LayoutBody>
<LayoutFilter :inline="true">
<FilterItem label="到货仓库">
<SelectRoom></SelectRoom>
<SelectRoom v-model="storeId"></SelectRoom>
</FilterItem>
<FilterItem label="预计到货">
<Date-picker type="date" placeholder="选择日期"></Date-picker>
<Date-picker v-model="arrival" type="date" placeholder="选择日期"></Date-picker>
</FilterItem>
<FilterItem >
<Button type="primary" @click="saveOrder">保存</Button>
<Button type="primary">返回</Button>
<Button type="primary" @click="back">返回</Button>
</FilterItem>
</LayoutFilter>
<LayoutAction>
<OrderInfo :id="id"></OrderInfo>
<OrderInfo ref="info" :id="id" @on-change="onChangeInfo"></OrderInfo>
</LayoutAction>
<LayoutList>
<Tabs type="card" :animated="false" @on-click="onTabsClick">
<Tab-pane label="已选商品">
<ProductList ref="selectProduct" @on-change-status="onCountChange" :oid="id" :brandId="brandId":selected="true">
<ProductList ref="selectProduct" :oid="id" :brandId="brandId" :selected="true">
</ProductList>
</Tab-pane>
<Tab-pane :label="'可选商品'">
<ProductList ref="allProduct" @on-change-status="onCountChange" :oid="id" :brandId="brandId"></ProductList>
<Tab-pane label="可选商品">
<ProductList ref="allProduct" :oid="id" :brandId="brandId"></ProductList>
</Tab-pane>
</Tabs>
</LayoutList>
</LayoutBody>
</template>
<script>
import ProductList from './components/product-list';
... ... @@ -50,7 +51,7 @@
count: 0,
id: '',
storeId: '',
arrivalTime: '',
arrivalTime: new Date().getTime() / 1000,
brandId: '',
info: null
};
... ... @@ -59,15 +60,31 @@
this.id = this.$route.params.id;
this.brandId = this.$route.query.brandId;
},
computed: {
arrival: {
get() {
return new Date(this.arrivalTime * 1000);
},
set(newVal) {
this.arrivalTime = newVal.getTime() / 1000;
}
}
},
methods: {
back() {
this.$router.push({name: 'shop.category.list'});
},
onCountChange() {
this.$router.push({name: 'repository.invoice.list'});
},
saveOrder() {
service.updateOrder({
proRequisitionFormId: this.id,
predictArrivalTime: this.arrivalTime,
storeroomId: this.storeId
}).then((result) => {
if (result.code === 200) {
this.$Message.info('更新成功');
} else {
this.$Message.error('更新失败');
}
});
},
onTabsClick(index) {
... ... @@ -76,6 +93,10 @@
} else {
this.$refs.allProduct.search();
}
},
onChangeInfo(data) {
this.storeId = data.storeroomId;
this.arrivalTime = data.predictArrivalTime;
}
},
components: {
... ...
<template>
<LayoutBody>
<LayoutFilter>
<LayoutFilter :inline="true">
<FilterItem>
<div>单号:173520 | 发往:北京1号仓库 北京顺义区 吴康</div>
<div>品牌:中国阿迪 | 店铺:得宝纸巾单品专卖店【测试】 | 供应商:阿迪供应商 | 进项税率:0.0300 | 数量:0 | 总吊牌金额:0 | 总进货金额:0</div>
<OrderInfo ref="info" :id="id"></OrderInfo>
</FilterItem>
<FilterItem>
<Button >返回发货入库</Button>
<FilterItem >
<Button type="primary" @click="back">返回</Button>
</FilterItem>
</LayoutFilter>
<LayoutList>
<Table border :context="self" :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="20" show-total></Page>
<Tabs type="card" :animated="false" @on-click="onTabsClick">
<Tab-pane label="已选商品">
<ProductList ref="selectProduct" :oid="id" :brandId="brandId" :selected="true">
</ProductList>
</Tab-pane>
</Tabs>
</LayoutList>
<CreateModal ref="createModal"></CreateModal>
</LayoutBody>
</template>
<script>
import {tableCols, tableData, pageData} from './store/info-table';
import CreateModal from './components/create-modal';
import ProductList from './components/product-list';
import OrderInfo from './components/order-info';
export default {
data() {
return {
self: this,
tableCols,
tableData,
pageData,
id: '',
};
},
mounted() {
created() {
this.id = this.$route.params.id;
},
methods: {
onClickCreate() {
this.$refs.createModal.show();
}
back() {
this.$router.push({name: 'repository.invoice.list'});
},
},
components: {
CreateModal
ProductList,
OrderInfo
}
};
</script>
<style lang="scss">
</style>
... ...
... ... @@ -165,17 +165,29 @@
}
});
},
onClickInfo() {
onClickInfo(params) {
this.$router.push({
name: 'repository.invoice.info',
params: {
id: params.row.id
},
query: {
brandId: params.row.brandId
}
});
},
onClickCommit(params) {
service.commitOrder(params.row.id).then(() => {
this.getOrders();
service.commitOrder(params.row.id).then((result) => {
if (result.code === 200) {
this.getOrders();
}
});
},
onClickDelete(params) {
service.deleteOrder(params.row.id).then(() => {
this.getOrders();
service.deleteOrder(params.row.id).then((result) => {
if (result.code === 200) {
this.getOrders();
}
});
},
onClickDeliver(params) {
... ...
... ... @@ -2,111 +2,125 @@
* Created by TaoHuang on 2017/5/25.
*/
let tableCols = [
{
title: 'SKN/SKC/SKU',
key: 'productSkn',
align: 'center'
},
{
title: '条码',
key: 'image',
align: 'center',
render() {
return '<div> <img v-prod-img="row.productSkn"> </div>';
}
},
{
title: '货品年季',
key: 'productName',
align: 'center',
},
{
title: '名称',
key: 'brandName',
align: 'center',
},
{
title: '色系/厂家颜色',
key: 'storage',
align: 'center',
render(row) {
return row.storage ? row.storage : 0;
}
},
{
title: '性别/尺码',
key: 'salePrice',
align: 'center',
render(row) {
return row.salePrice || 0;
}
},
{
title: '吊牌/销售价/进货价',
key: 'editTime',
align: 'center',
render(row) {
return row.editTime || '-';
let tableCols = function() {
return [
{
type: 'selection',
width: 60,
align: 'center'
},
{
title: 'SKN/SKC/SKU',
key: 'productSkn',
align: 'center',
render: (h, params) => {
return (
<div>{params.row.productSkn} / {params.row.productSkc} / {params.row.productSku} </div>
);
}
},
{
title: '条码',
key: 'skuFactoryCode',
align: 'center',
},
{
title: '货品年季',
key: 'goodsYearSeason',
align: 'center',
},
{
title: '名称',
key: 'productName',
align: 'center',
},
{
title: '色系/厂家颜色',
align: 'center',
render: (h, params) => {
return (
<div>{params.row.goodsName} / {params.row.factoryGoodsName}</div>
);
}
},
{
title: '性别/尺码',
align: 'center',
render: (h, params) => {
return (
<div>{params.row.genderName} / {params.row.sizeName}</div>
);
}
},
{
title: '吊牌/销售价/进货价',
align: 'center',
render: (h, params) => {
return (
<div>{params.row.retailPrice} / {params.row.salesPrice}</div>
);
}
},
renderHeader() {
return '发货进度<br/> 已发数/采购数 ';
}
},
{
title: '结算折扣',
key: 'editTime',
align: 'center',
render(row) {
return row.editTime || '-';
{
title: '结算折扣',
key: 'purchaseDiscount',
align: 'center',
},
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
}
},
{
title: '发货进度 已发数/采购数',
key: 'editTime',
align: 'center',
render(row) {
return row.editTime || '-';
{
title: '发货进度 已发数/采购数',
key: 'editTime',
align: 'center',
renderHeader() {
return '发货进度<br/> 已发数/采购数 ';
},
render: (h, params) => {
return (
<div>
<div><i-progress percent={ params.row.sendNum / params.row.totalNum}
hide-info={true}></i-progress></div>
<div>{params.row.sendNum} / {params.row.totalNum}</div>
</div>
);
},
},
renderHeader() {
return '发货进度<br/> 已发数/采购数 ';
}
},
{
title: '入库进度 已入库数/采购数',
key: 'editTime',
align: 'center',
render(row) {
return row.editTime || '-';
{
title: '入库进度 已入库数/采购数',
key: 'editTime',
align: 'center',
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
},
render: (h, params) => {
return (
<div>
<div><i-progress percent={ params.row.inStoreNum / params.row.totalNum}
hide-info={true}></i-progress></div>
<div>{ params.row.inStoreNum } / {params.row.totalNum}</div>
</div>
);
},
},
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
{
title: '填写发货数',
key: 'action',
align: 'center',
render: (h, params) => {
return (
<i-input
value={params.row.num}
onInput={val => (params.row.num = val)}/>
);
}
}
},
{
title: '填写发货数',
key: 'action',
align: 'center'
}
];
];
};
let tableData = [];
let pageData = {
total: 0,
current: 1,
pageSize: 20
};
export {
tableCols,
tableData,
pageData
};
... ...
/**
* Created by TaoHuang on 2017/5/25.
*/
let tableCols = [
{
title: 'SKN/SKC/SKU',
key: 'productSkn',
align: 'center'
},
{
title: '条码',
key: 'image',
align: 'center',
render() {
return '<div> <img v-prod-img="row.productSkn"> </div>';
}
},
{
title: '货品年季',
key: 'productName',
align: 'center',
},
{
title: '名称',
key: 'brandName',
align: 'center',
},
{
title: '色系/厂家颜色',
key: 'storage',
align: 'center',
},
{
title: '性别/尺码',
key: 'salePrice',
align: 'center',
},
{
title: '吊牌/销售价/进货价',
key: 'editTime',
align: 'center',
renderHeader() {
return '发货进度<br/> 已发数/采购数 ';
}
},
{
title: '结算折扣',
key: 'editTime',
align: 'center',
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
}
},
{
title: '入库进度 入库数/采购数',
key: 'editTime',
align: 'center',
}
];
let tableData = [];
let pageData = {
total: 0,
current: 1,
pageSize: 20
};
export {
tableCols,
tableData,
pageData
};
... ... @@ -4,6 +4,8 @@
* @date: 2017/04/13
*/
import moment from 'moment';
let tableCols = function() {
return [
{
... ... @@ -16,10 +18,13 @@ let tableCols = function() {
key: 'createTime',
align: 'center',
render: function(h, params) {
let date = new Date(params.row.createTime * 1000);
let time = moment.unix(params.row.createTime);
return (
<div> {date} </div>
<div>
<div> {time.format('YYYY/MM/DD')} </div>
<div> {time.format('HH:mm:ss')} </div>
</div>
);
}
},
... ... @@ -98,7 +103,7 @@ let tableCols = function() {
return (
<div class="action-btn-row">
<i-button type="primary" size="small" onClick={() => this.onClickEdit(params)}>编辑</i-button>
<i-button type="primary" size="small">查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickCommit(params)}>提交</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickDelete(params)}>删除</i-button>
</div>
... ... @@ -108,7 +113,7 @@ let tableCols = function() {
return (
<div class="action-btn-row">
<i-button type="primary" size="small">查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
</div>
);
} else if (status === 40) {
... ... @@ -116,7 +121,7 @@ let tableCols = function() {
if (params.row.sendNum < params.row.totalNum) {
return (
<div class="action-btn-row">
<i-button type="primary" size="small">查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickDeliver(params)}>发货</i-button>
</div>
);
... ... @@ -132,7 +137,7 @@ let tableCols = function() {
return (
<div class="action-btn-row">
<i-button type="primary" size="small" onClick={() => this.onClickEdit(params)}>编辑</i-button>
<i-button type="primary" size="small">查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickCommit(params)}>提交</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickDelete(params)}>删除</i-button>
</div>
... ...