Authored by htoooth

fix

<template>
<div v-if="data">
<div v-if="data" class="order-info">
<div>单号:{{this.data.id}} &nbsp;|&nbsp; 发往:{{this.data.storeroomName}} &nbsp; {{this.data.address}} &nbsp;{{this.data.adminName}}</div>
<div>品牌:{{this.data.brandName}}
&nbsp;|&nbsp; 店铺:{{this.data.shopName}}
... ... @@ -7,7 +7,8 @@
&nbsp;|&nbsp; 进项税率: {{this.inputTaxRate}}
&nbsp;|&nbsp; 数量:{{this.totalNum}}
&nbsp;|&nbsp; 总吊牌金额:{{this.totalRetailPrice}}
&nbsp;|&nbsp; 总进货金额:{{this.totalPurchasePrice}}</div>
&nbsp;|&nbsp; 总进货金额:{{this.totalPurchasePrice}}
</div>
</div>
</template>
... ... @@ -41,6 +42,11 @@
};
</script>
<style>
<style lang="scss" scoped>
.order-info {
display: inline-block;
height: 50px;
margin-right: 10px;
font-size: 15px;
}
</style>
... ...
... ... @@ -11,6 +11,8 @@
<script>
import service from 'invoice-service';
import _ from 'lodash';
import table from '../store/product-table';
export default {
name: 'invoice-ProductList',
... ... @@ -24,102 +26,15 @@
},
brandId: {
type: [Number, String],
},
show: {
type: Boolean,
default: false
}
},
data() {
return {
tableCols: [
{
title: 'SKN/SKC/SKU',
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>
);
}
},
{
title: '结算折扣',
key: 'purchaseDiscount',
align: 'center',
},
{
title: '发货数量',
key: 'count',
align: 'center',
render: (h, params) => {
if (!params.row.hasAdded) {
return (
<i-input value={params.row.buyingNums} onInput={val => (params.row.buyingNums = val)} />
);
}
}
},
{
title: '操作',
key: 'editTime',
align: 'center',
render: (h, params) => {
if (!this.selected) {
if (!params.row.hasAdded) {
return (
<i-button type='primary' size="small" onClick={() => this.create(params)}> 加入 </i-button>
);
}
} else {
return (
<div>
<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>
);
}
}
}
],
tableCols: this.show ? table.infoCols.call(this) : table.cols.call(this),
tableData: [],
pageData: {
total: 0,
... ...
... ... @@ -11,7 +11,7 @@
<FilterItem >
<Button type="primary" @click="saveOrder">保存</Button>
<Button type="primary" @click="back">返回</Button>
<Button type="ghost" @click="back">返回发货入库列表</Button>
</FilterItem>
</LayoutFilter>
... ... @@ -106,3 +106,13 @@
}
};
</script>
<style lang="scss">
.action-btn-row {
button {
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
}
}
</style>
... ...
<template>
<LayoutBody>
<LayoutFilter :inline="true">
<FilterItem>
<OrderInfo ref="info" :id="id"></OrderInfo>
</FilterItem>
<FilterItem >
<Button type="primary" @click="back">返回</Button>
</FilterItem>
</LayoutFilter>
<OrderInfo ref="info" :id="id"></OrderInfo>
<LayoutAction>
<Button type="primary" @click="back">返回发货入库列表</Button>
</LayoutAction>
<LayoutList>
<Tabs type="card" :animated="false" @on-click="onTabsClick">
<Tab-pane label="已选商品">
<ProductList ref="selectProduct" :oid="id" :brandId="brandId" :selected="true">
<ProductList ref="selectProduct"
:oid="id"
:brandId="brandId"
:selected="true"
:show="true">
</ProductList>
</Tab-pane>
</Tabs>
... ...
... ... @@ -47,7 +47,7 @@
</LayoutFilter>
<LayoutAction>
<Button type="ghost" @click="onClickCreate">创建入库单</Button>
<Button type="primary" @click="onClickCreate">创建入库单</Button>
</LayoutAction>
<LayoutList>
... ... @@ -57,6 +57,12 @@
</LayoutList>
<CreateModal ref="createModal" @on-success="getOrders"></CreateModal>
<Modal ref="modal"
v-model="modal.show"
:title="modal.title"
@on-ok="modal.onSuccess">
<p>{{modal.content}}</p>
</Modal>
</LayoutBody>
</template>
... ... @@ -144,6 +150,12 @@
}
]
}
},
modal: {
show: false,
title: '',
content: '',
onSuccess: null
}
};
},
... ... @@ -177,18 +189,34 @@
});
},
onClickCommit(params) {
service.commitOrder(params.row.id).then((result) => {
if (result.code === 200) {
this.getOrders();
}
});
this.modal.show = true;
this.modal.title = '提交操作提醒';
this.modal.content = `确定提交入库单号为 ${params.row.id} 发货入库单`;
this.modal.onSuccess = () => {
service.commitOrder(params.row.id).then((result) => {
if (result.code === 200) {
this.$Message.info('操作成功');
this.getOrders();
} else {
this.$Message.info('操作失败');
}
});
};
},
onClickDelete(params) {
service.deleteOrder(params.row.id).then((result) => {
if (result.code === 200) {
this.getOrders();
}
});
this.modal.show = true;
this.modal.title = '删除操作提醒';
this.modal.content = `确定删除入库单号为 ${params.row.id} 发货入库单`;
this.modal.onSuccess = () => {
service.deleteOrder(params.row.id).then((result) => {
if (result.code === 200) {
this.$Message.info('操作成功');
this.getOrders();
} else {
this.$Message.info('操作失败');
}
});
};
},
onClickDeliver(params) {
this.$router.push({
... ... @@ -272,6 +300,9 @@
default:
return '未提交';
}
},
onSuccess() {
}
},
computed: {
... ... @@ -304,14 +335,10 @@
<style lang="scss">
.action-btn-row {
display: inline-block;
button {
margin-top: 10px;
&:last-child {
margin-bottom: 10px;
}
margin-right: 10px;
margin-bottom: 10px;
}
}
</style>
... ...
... ... @@ -52,11 +52,22 @@ let tableCols = function() {
title: '发货进度',
align: 'center',
render: function(h, params) {
let percent = 0;
if (params.row.sendNum && params.row.totalNum) {
percent = params.row.sendNum / params.row.totalNum;
if (percent > 1) {
percent = 100;
} else {
percent *= 100;
}
}
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><i-progress percent={ percent} hide-info={true} ></i-progress></div>
<div>{params.row.sendNum || 0} / {params.row.totalNum || 0}</div>
</div>
);
},
... ... @@ -69,11 +80,23 @@ let tableCols = function() {
title: '入库进度',
align: 'center',
render: function(h, params) {
let percent = 0;
if (params.row.inStoreNum && params.row.totalNum) {
percent = params.row.inStoreNum / params.row.totalNum;
if (percent > 1) {
percent = 100;
} else {
percent *= 100;
}
}
return (
<div>
<div><i-progress percent={ params.row.inStoreNum / params.row.totalNum}
<div><i-progress percent={ percent }
hide-info={true}></i-progress></div>
<div>{ params.row.inStoreNum } / {params.row.totalNum}</div>
<div>{ params.row.inStoreNum || 0} / {params.row.totalNum || 0}</div>
</div>
);
},
... ... @@ -95,6 +118,7 @@ let tableCols = function() {
{
title: '操作',
key: 'action',
width: 250,
align: 'center',
render: (h, params) => {
let status = params.row.auditStatus;
... ... @@ -102,10 +126,10 @@ let tableCols = function() {
if (status === 10) {
return (
<div class="action-btn-row">
<i-button type="success" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickEdit(params)}>编辑</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>
<i-button type="warning" size="small" onClick={() => this.onClickCommit(params)}>提交</i-button>
<i-button type="error" size="small" onClick={() => this.onClickDelete(params)}>删除</i-button>
</div>
);
... ... @@ -113,7 +137,7 @@ let tableCols = function() {
return (
<div class="action-btn-row">
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
<i-button type="success" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
</div>
);
} else if (status === 40) {
... ... @@ -121,31 +145,31 @@ let tableCols = function() {
if (params.row.sendNum < params.row.totalNum) {
return (
<div class="action-btn-row">
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickDeliver(params)}>发货</i-button>
<i-button type="success" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
<i-button type="info" size="small" onClick={() => this.onClickDeliver(params)}>发货</i-button>
</div>
);
} else {
return (
<div class="action-btn-row">
<i-button type="primary" size="small">查看</i-button>
<i-button type="success" size="small">查看</i-button>
</div>
);
}
} else if (status === 41) {
return (
<div class="action-btn-row">
<i-button type="success" size="small" onClick={() => this.onClickInfo(params)}>查看</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickEdit(params)}>编辑</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>
<i-button type="warning" size="small" onClick={() => this.onClickCommit(params)}>提交</i-button>
<i-button type="error" size="small" onClick={() => this.onClickDelete(params)}>删除</i-button>
</div>
);
} else {
return (
<div class="action-btn-row">
<i-button type="primary" size="small">查看</i-button>
<i-button type="success" size="small">查看</i-button>
</div>
);
}
... ...
let cols = function() {
return [
{
title: 'SKN/SKC/SKU',
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>
);
}
},
{
title: '结算折扣',
key: 'purchaseDiscount',
align: 'center',
},
{
title: '发货数量',
key: 'count',
align: 'center',
render: (h, params) => {
if (!params.row.hasAdded) {
return (
<i-input value={params.row.buyingNums} onInput={val => (params.row.buyingNums = val)} />
);
} else {
return (
<div>-</div>
);
}
}
},
{
title: '操作',
key: 'editTime',
width: 150,
align: 'center',
render: (h, params) => {
if (!this.selected) {
if (!params.row.hasAdded) {
return (
<div class="action-btn-row">
<i-button type='warning' size="small" onClick={() => this.create(params)}> 加入 </i-button>
</div>
);
} else {
return (
<div>-</div>
);
}
} else {
return (
<div class="action-btn-row">
<i-button type='primary' size="small" onClick={() => this.update(params)}> 保存 </i-button>
<i-button type='error' size="small" onClick={() => this.delete(params)}> 删除 </i-button>
</div>
);
}
}
}
];
};
let infoCols = function() {
return [
{
title: 'SKN/SKC/SKU',
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>
);
}
},
{
title: '结算折扣',
key: 'purchaseDiscount',
align: 'center',
},
{
title: '入库进度',
align: 'center',
render: function(h, params) {
let percent = 0;
if (params.row.inStoreNum && params.row.totalNum) {
percent = params.row.inStoreNum / params.row.totalNum;
if (percent > 1) {
percent = 100;
} else {
percent *= 100;
}
}
return (
<div>
<div><i-progress percent={ percent }
hide-info={true}></i-progress></div>
<div>{ params.row.inStoreNum || 0} / {params.row.totalNum || 0}</div>
</div>
);
},
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
}
},
];
};
export default {
cols,
infoCols
}
\ No newline at end of file
... ...