|
@@ -0,0 +1,170 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <Toptitle title="生产通知单详情">
|
|
|
|
|
+ <Button type="primary" @click="totalDel">批量删除</Button>
|
|
|
|
|
+ <Button type="primary" class='block_style'>导出</Button>
|
|
|
|
|
+ <Button type="primary" class='block_style' @click='back'>返回</Button>
|
|
|
|
|
+ </Toptitle>
|
|
|
|
|
+ <div style="height:85%;overflow:auto">
|
|
|
|
|
+ <Form :label-width='100' class="form_content">
|
|
|
|
|
+ <FormItem label='生产通知单:'>
|
|
|
|
|
+ <Input style="width: 200px" clearable/>
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ <FormItem label='下通知时间:'>
|
|
|
|
|
+ <DatePicker type="date" placeholder="年/月/日" style="width: 200px"></DatePicker>
|
|
|
|
|
+ ~
|
|
|
|
|
+ <DatePicker type="date" placeholder="年/月/日" style="width: 200px"></DatePicker>
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ <FormItem :label-width='60'>
|
|
|
|
|
+ <Button type="primary">
|
|
|
|
|
+ 搜索
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ </Form>
|
|
|
|
|
+ <Table :data='tableData' :columns='tableColumns' max-height='550' border @on-selection-change='handleSelectData'>
|
|
|
|
|
+ <template slot="set" slot-scope="{row}">
|
|
|
|
|
+ <a @click="goPage(row)">查看</a>
|
|
|
|
|
+ <a class='block_style' @click="del(row)">删除</a>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </Table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="content_body_page">
|
|
|
|
|
+ <Page
|
|
|
|
|
+ :page-size-opts="[10, 20, 30, 40, 100]"
|
|
|
|
|
+ @on-page-size-change="changeSize"
|
|
|
|
|
+ @on-change="changePage"
|
|
|
|
|
+ :current="pageIndex"
|
|
|
|
|
+ show-total
|
|
|
|
|
+ show-elevator
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ show-sizer
|
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+export default {
|
|
|
|
|
+ data(){
|
|
|
|
|
+ return{
|
|
|
|
|
+ selectData:[],
|
|
|
|
|
+ searchData:{
|
|
|
|
|
+ product_no:'',
|
|
|
|
|
+ start_time:'',
|
|
|
|
|
+ end_time:'',
|
|
|
|
|
+ },
|
|
|
|
|
+ pageIndex:1,
|
|
|
|
|
+ pageSize:10,
|
|
|
|
|
+ total:0,
|
|
|
|
|
+ tableData:[],
|
|
|
|
|
+ tableColumns:[
|
|
|
|
|
+ {type:'selection',align:'center',minWidth:80},
|
|
|
|
|
+ {title:'生产通知单号',align:'center',minWidth:200,key:'product_no'},
|
|
|
|
|
+ {title:'下生产通知时间',align:'center',minWidth:200,key:'product_time',render:(h,params)=>{
|
|
|
|
|
+ const {row} = params;
|
|
|
|
|
+ return h('span',{},this.func.replaceDateNoHMS(row.product_time))
|
|
|
|
|
+ }},
|
|
|
|
|
+ {title:'操作',align:'center',minWidth:200,key:'set',slot:'set'},
|
|
|
|
|
+ ],
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted(){
|
|
|
|
|
+ this.initData();
|
|
|
|
|
+ },
|
|
|
|
|
+ methods:{
|
|
|
|
|
+ goPage(row){
|
|
|
|
|
+ this.$router.push({path:'/cms/Agreement/productMessage/detail',query:{...row}});
|
|
|
|
|
+ },
|
|
|
|
|
+ totalDel(){
|
|
|
|
|
+ if(this.selectData.length==0){
|
|
|
|
|
+ return this.$Message.success('请选择数据!')
|
|
|
|
|
+ }
|
|
|
|
|
+ this.confirmDelete({
|
|
|
|
|
+ title:'批量删除确认?',
|
|
|
|
|
+ content:"是否确定批量删除?",
|
|
|
|
|
+ then: ()=>{
|
|
|
|
|
+ let product_no = [];
|
|
|
|
|
+ this.selectData.forEach(v=>{
|
|
|
|
|
+ product_no.push(v.product_no)
|
|
|
|
|
+ })
|
|
|
|
|
+ this.axios.post('/api/contract_product_del',{product_no}).then(res=>{
|
|
|
|
|
+ if(res.code==200){
|
|
|
|
|
+ this.$Message.success(res.msg);
|
|
|
|
|
+ if(this.selectData.length == this.tableData&&this.pageIndex!=1){
|
|
|
|
|
+ this.pageIndex--;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.selectData = [];
|
|
|
|
|
+ this.initData(this.searchData);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSelectData(e){
|
|
|
|
|
+ this.selectData = e;
|
|
|
|
|
+ },
|
|
|
|
|
+ changeSize(e){
|
|
|
|
|
+ this.pageSize = e;
|
|
|
|
|
+ this.pageIndex =1;
|
|
|
|
|
+ this.initData(this.searchData)
|
|
|
|
|
+ },
|
|
|
|
|
+ changePage(e){
|
|
|
|
|
+ this.pageIndex =e;
|
|
|
|
|
+ this.initData(this.searchData)
|
|
|
|
|
+ },
|
|
|
|
|
+ initData(row){
|
|
|
|
|
+ let obj = {};
|
|
|
|
|
+ if(row){
|
|
|
|
|
+ obj = JSON.parse(JSON.stringify(this.searchData));
|
|
|
|
|
+ obj.start_time = obj.start_time?Date.parse(obj.start_time).toString().slice(0,10):'';
|
|
|
|
|
+ obj.end_time = obj.end_time?Date.parse(obj.end_time).toString().slice(0,10):'';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.axios.post('/api/contract_product_no_list',{page_index:this.pageIndex,page_size:this.pageSize,order_no:this.$route.query.order_no,...obj}).then(res=>{
|
|
|
|
|
+ this.tableData = res.data.data;
|
|
|
|
|
+ this.total = res.data.total;
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ del(row){
|
|
|
|
|
+ this.confirmDelete({
|
|
|
|
|
+ title:'确认删除?',
|
|
|
|
|
+ content:"是否确定删除?",
|
|
|
|
|
+ then: ()=>{
|
|
|
|
|
+ this.axios.post('/api/contract_product_del',{product_no:[row.product_no]}).then(res=>{
|
|
|
|
|
+ if(res.code==200){
|
|
|
|
|
+ this.selectData.forEach((v,index)=>{
|
|
|
|
|
+ if(v.product_no == row.product_no){
|
|
|
|
|
+ this.selectData.splice(index,1)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ if(this.tableData.length==1&&this.pageIndex!=1){
|
|
|
|
|
+ this.pageIndex--;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.initData(this.searchData);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ back(){
|
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+.block_style{
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+.form_content{
|
|
|
|
|
+ margin-top:10px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+}
|
|
|
|
|
+.content_body_page{
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|