|
|
@@ -3,7 +3,7 @@
|
|
|
<x-crud class="liu-crud-wrap order-list-wrap" @load="onLoad">
|
|
|
|
|
|
<template #slot-tabs>
|
|
|
- <el-tabs class="liu-tabs" type="border-card" v-model="tabIndex" @tab-click="handleClick">
|
|
|
+ <el-tabs class="liu-tabs" type="border-card" v-model="tabIndex" @tab-click="changeTab">
|
|
|
<el-tab-pane
|
|
|
v-for="(item, index) in tabsData"
|
|
|
:key="index"
|
|
|
@@ -48,20 +48,30 @@
|
|
|
|
|
|
<template #table-column-status="{scope}">
|
|
|
<span v-if="scope.row.status == 2">待发货</span>
|
|
|
- <span v-else-if="scope.row.status == 3">待入库</span>
|
|
|
+ <span v-else-if="scope.row.status == 3" style="color:blue;font-weight:bold;font-size:14px;">待入库</span>
|
|
|
<span v-else-if="scope.row.status == 4">已入库</span>
|
|
|
<span v-else-if="scope.row.status == 5">已取消</span>
|
|
|
<span v-else>待付款</span>
|
|
|
</template>
|
|
|
|
|
|
<template #slot-column-option="{scope}">
|
|
|
- <el-button @click.stop="changePrice(scope.row)" size="small" type="primary">改价入库</el-button>
|
|
|
+
|
|
|
+ <el-button size="small" v-if="scope.row.status == 5">改价入库</el-button>
|
|
|
+ <el-button @click.stop="changePrice(scope.row)" size="small" type="success" v-else-if="scope.row.status == 4">修改价格</el-button>
|
|
|
+ <el-button @click.stop="changePrice(scope.row)" size="small" type="primary" v-else>改价入库</el-button>
|
|
|
+
|
|
|
<el-button @click.stop="detailShowFn(scope.row)" size="small" type="success">详情</el-button>
|
|
|
- <el-button @click.stop="detailShowFn(scope.row)" size="small" type="primary">取消</el-button>
|
|
|
+
|
|
|
+ <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打小票</el-button>
|
|
|
+ <el-button @click.stop="printOrder(scope.row)" size="small" type="primary" v-else>打小票</el-button>
|
|
|
+
|
|
|
+ <el-button @click.stop="cancelOrder(scope.row)" size="small" type="primary" v-if="scope.row.status == 3 || scope.row.status == 2 || scope.row.status == 1">取消</el-button>
|
|
|
+ <el-button size="small" v-else>取消</el-button>
|
|
|
</template>
|
|
|
|
|
|
<template #slot-new-cg>
|
|
|
- <el-button type="primary" size="mini" style="margin-left:50px;" @click="newCg()">新增采购</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:50px;" @click="billing()">开单 Ctrl + ,</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:50px;" @click="newCg()">新增采购 Ctrl + .</el-button>
|
|
|
</template>
|
|
|
|
|
|
</x-crud>
|
|
|
@@ -87,17 +97,17 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
text: '待入库',
|
|
|
- key: '1',
|
|
|
+ key: '3',
|
|
|
val: 0
|
|
|
},
|
|
|
{
|
|
|
text: '已入库',
|
|
|
- key: '2',
|
|
|
+ key: '4',
|
|
|
val: 0
|
|
|
},
|
|
|
{
|
|
|
text: '已取消',
|
|
|
- key: '3',
|
|
|
+ key: '5',
|
|
|
val: 0
|
|
|
}
|
|
|
],
|
|
|
@@ -108,7 +118,24 @@ export default {
|
|
|
created() {
|
|
|
this.init();
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ let that = this;
|
|
|
+ document.onkeydown=function(e) {
|
|
|
+ if(e && e.key == ',' && e.ctrlKey){
|
|
|
+ let query = {}
|
|
|
+ that.$router.push({path:'/order/add',query})
|
|
|
+ }
|
|
|
+ if(e && e.key == '.' && e.ctrlKey){
|
|
|
+ let query = {}
|
|
|
+ that.$router.push({path:'/in/add',query})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ billing(){
|
|
|
+ let query = {}
|
|
|
+ this.$router.push({path:'/order/add',query})
|
|
|
+ },
|
|
|
newCg(){
|
|
|
let query = {}
|
|
|
this.$router.push({path:'/in/add',query})
|
|
|
@@ -143,13 +170,26 @@ export default {
|
|
|
query.backType = 'list'
|
|
|
this.$router.push({path:'/in/change',query})
|
|
|
},
|
|
|
+ printOrder(item){
|
|
|
+ this.$service.purchaseOrder.printBill({id:item.id}).then(data => {
|
|
|
+ this.$notify({ title: '已打印', message: '操作成功', type: 'success'})
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancelOrder(item){
|
|
|
+ this.$confirm('确认取消?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
|
+ this.$service.purchaseOrder.cancelOrder({id:item.id}).then(data => {
|
|
|
+ this.$notify({ title: '已取消', message: '操作成功', type: 'success'})
|
|
|
+ this.app.refresh({ status: this.tabIndex})
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
detailShowFn(item) {
|
|
|
this.optionData = item;
|
|
|
setTimeout(() => {
|
|
|
this.$refs.orderDetail.init();
|
|
|
});
|
|
|
},
|
|
|
- handleClick(tab, e) {
|
|
|
+ changeTab(tab, e) {
|
|
|
this.app.refresh({ status: this.tabIndex});
|
|
|
},
|
|
|
onLoad({ ctx, app }) {
|
|
|
@@ -164,7 +204,7 @@ export default {
|
|
|
prop: 'orderSn',
|
|
|
label: '单号',
|
|
|
align: 'center',
|
|
|
- width: '160'
|
|
|
+ width: '130'
|
|
|
},
|
|
|
{
|
|
|
prop: 'supplierName',
|
|
|
@@ -244,7 +284,7 @@ export default {
|
|
|
op: {
|
|
|
visible: true,
|
|
|
props: {
|
|
|
- width: 300,
|
|
|
+ width: 320,
|
|
|
align: 'center',
|
|
|
fixed: 'right',
|
|
|
label: '操作'
|