|
|
@@ -105,6 +105,17 @@
|
|
|
<el-button type="primary" size="mini" style="margin-left:50px;" @click="newCg()">新增采购</el-button>
|
|
|
</template>
|
|
|
|
|
|
+ <template #slot-export-order>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:60px;" @click="exportData()">导出数据</el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #slot-search-option="{scope}">
|
|
|
+ 入库时间:
|
|
|
+ <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
|
|
|
+ end-placeholder="结束日期" :picker-options="pickerOptions" size="mini" style="margin-right:20px;">
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
+
|
|
|
</x-crud>
|
|
|
|
|
|
<order-detail ref="orderDetail" :orderOperate="optionData" />
|
|
|
@@ -173,7 +184,39 @@ export default {
|
|
|
orderData:'',
|
|
|
addPop:false,
|
|
|
name:'',
|
|
|
- location:0
|
|
|
+ location:0,
|
|
|
+ searchContent:'',
|
|
|
+ startTime:'',
|
|
|
+ endTime:'',
|
|
|
+ searchTime:'',
|
|
|
+ currentDateList:[],
|
|
|
+ pickerOptions: {
|
|
|
+ shortcuts: [{
|
|
|
+ text: '最近一周',
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '最近一个月',
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '最近三个月',
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -193,6 +236,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ exportData(){
|
|
|
+ this.$service.purchaseOrder.getOrderList({status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent,export:1}).then(res => {
|
|
|
+ if(res.file){
|
|
|
+ window.location.href = res.file
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
changeSeatSn(info){
|
|
|
this.$prompt('请输入货位号','提示',{confirmButtonText:'确定',cancelButtonText:'取消'}).then(({value}) => {
|
|
|
this.$service.purchaseOrder.modifySeatSn({ seatSn: value,id:info.id}).then(data => {
|
|
|
@@ -290,7 +340,7 @@ export default {
|
|
|
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})
|
|
|
+ this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent})
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
@@ -301,7 +351,19 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
changeTab(tab, e) {
|
|
|
- this.app.refresh({ status: this.tabIndex});
|
|
|
+ this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent});
|
|
|
+ },
|
|
|
+ getSearchDate(){
|
|
|
+ if (this.$util.isEmpty(this.currentDateList)) {
|
|
|
+ this.searchTime = ''
|
|
|
+ this.startTime = ''
|
|
|
+ this.endTime = ''
|
|
|
+ }else{
|
|
|
+ this.searchTime = 'custom'
|
|
|
+ this.startTime = this.currentDateList[0]
|
|
|
+ this.endTime = this.currentDateList[1]
|
|
|
+ }
|
|
|
+ this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent})
|
|
|
},
|
|
|
onLoad({ ctx, app }) {
|
|
|
this.app = app;
|
|
|
@@ -425,12 +487,13 @@ export default {
|
|
|
})
|
|
|
.set('layout', [
|
|
|
['slot-tabs'],
|
|
|
- ['search-key','slot-new-cg'],
|
|
|
+ ['slot-search-option','search-key','slot-new-cg','flex1','slot-export-order'],
|
|
|
['data-table'],
|
|
|
['flex1', 'pagination']
|
|
|
])
|
|
|
.on('refresh', async (params, { next }) => {
|
|
|
let asset = await next(params);
|
|
|
+ this.searchContent = params.name?params.name:''
|
|
|
// this.tabsData[0].val = asset.shop && asset.shop.totalOrder ? asset.shop.totalOrder : 0;
|
|
|
// this.tabsData[1].val = asset.shop && asset.shop.unPayOrder?asset.shop.unPayOrder:0;
|
|
|
// this.tabsData[2].val = asset.shop && asset.shop.unSendOrder?asset.shop.unSendOrder:0;
|
|
|
@@ -438,7 +501,7 @@ export default {
|
|
|
// this.tabsData[4].val = asset.shop && asset.shop.finishOrder?asset.shop.finishOrder:0;
|
|
|
})
|
|
|
.done();
|
|
|
- app.refresh({ status: this.tabIndex})
|
|
|
+ app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})
|
|
|
}
|
|
|
}
|
|
|
};
|