Explorar el Código

修改冲突-- cjh

17767204043 hace 3 años
padre
commit
22ccf9d3f9

+ 170 - 0
src/views/Agreement/productMessage/confirm.vue

@@ -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>

+ 134 - 0
src/views/Agreement/productMessage/detail.vue

@@ -0,0 +1,134 @@
+<template>
+    <div>
+        <Toptitle title="生产通知单号详情">
+          <Button type="primary" style="margin-right:10px">导出</Button>
+          <Button type="primary" @click="back">返回</Button>
+        </Toptitle>
+        <div style="height:85%;overflow:auto"> 
+         <Form :label-width='100' class="form_content">
+                <FormItem label='生产通知单:'>
+                    <span class="form_item">{{formData.product_no}}</span>
+                </FormItem>
+                <FormItem label='下通知时间:'>
+                 <span class="form_item">{{func.replaceDateNoHMS(formData.product_time)}}</span>
+                </FormItem>
+            </Form>
+            <Table :data='tableData' :columns='tableColumns' border max-height='550'  show-summary
+                      :summary-method="handleSummary"></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{
+                 tableData:[],
+                 tableColumns:[
+                     {type:'index',align:'center',minWidth:80,title:'序号'},
+                     {title:'区域',align:'center',minWidth:120,key:'region'},
+                      {title:'图号',align:'center',minWidth:120,key:'url_number'},
+                       {title:'产品名称',align:'center',minWidth:120,key:'product_title'},
+                        {title:'数量',align:'center',minWidth:120,key:'num'},
+                         {title:'单位',align:'center',minWidth:120,key:'unit'},
+                          {title:'饰面',align:'center',minWidth:120,key:'finish'},
+                           {title:'备注',align:'center',minWidth:120,key:'remark'},
+                            {title:'金额',align:'center',minWidth:120,key:'total_price'},
+                 ],
+                 pageIndex:1,
+                 pageSize:10,
+                 total:0,
+                 formData:{
+                     product_no:'',
+                     product_time:'',
+                 }
+        }
+    },
+    mounted(){
+      this.initData();
+    },
+    methods:{
+        changeSize(e){
+              this.pageSize = e;
+              this.pageIndex =1;
+              this.initData();
+        },
+        changePage(e){
+          this.pageIndex=e;
+          this.initData();
+        },
+         handleSummary({ columns, data }) {
+      const sums = {};
+      columns.forEach((column, index) => {
+        const key = column.key;
+        if (index === 0) {
+          sums[key] = {
+            key,
+            value: "合计",
+          };
+          return;
+        }
+        const values = data.map((item) => Number(item[key]));
+        if (key == "total_price") {
+          const v = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[key] = {
+            key,
+            value: (v * 1).toFixed(2),
+          };
+        } else {
+          sums[key] = {
+            key,
+            value: "",
+          };
+        }
+      });
+
+      return sums;
+    },
+        initData(){
+                this.axios.post('/api/contract_product_no_detail',{page_index:this.pageIndex,page_size:this.pageSize,product_no:this.$route.query.product_no,product_time:this.$route.query.product_time}).then(res=>{
+                    this.formData = res.data;
+                    this.tableData= res.data.data.data;
+                    this.total = res.data.data.total;
+                })
+        },
+        back(){
+            this.$router.go(-1);
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+.form_content{
+    margin-top: 10px;
+    display: flex;
+    flex-wrap: wrap;
+}
+.form_item{
+    display: inline-block;
+    width: 200px;
+}
+.content_body_page{
+    text-align: center;
+    margin-top: 20px;
+}
+</style>

+ 106 - 0
src/views/Agreement/productMessage/list.vue

@@ -0,0 +1,106 @@
+<template>
+    <div>
+        <Toptitle title="生产通知单"></Toptitle>
+        <div class="content">
+        <Form :label-width='120' class="form_content">
+            <FormItem label='金螳螂ID:'>
+                <Input clearable v-model="searchData.jtl_id" placeholder="请输入金螳螂ID"/>
+            </FormItem>
+            <FormItem label='项目编码:'>
+                <Input clearable v-model="searchData.order_no" placeholder="请输入项目编码"/>
+            </FormItem>
+            <FormItem label='项目名称:'>
+                <Input clearable v-model="searchData.project_title" placeholder="请输入项目名称"/>
+            </FormItem>
+            <FormItem label='项目简称:'>
+                <Input clearable v-model="searchData.abbreviation" placeholder="请输入项目简称"/>
+            </FormItem>
+            <FormItem :label-width='40'>
+                <Button type="primary" @click="initData(searchData)">搜索</Button>
+            </FormItem>
+        </Form>
+        <Table :data='tableData' :columns='tableColumns' border max-height='550'>
+            <template slot="set" slot-scope="{row}">
+                <a @click="handleSet(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{
+            pageIndex:1,
+            pageSize:10,
+            total:0,
+            tableData:[],
+            tableColumns:[
+                {title:'金螳螂ID',align:'center',minWidth:120,key:'jtl_id'},
+                {title:'项目编号',align:'center',minWidth:120,key:'order_no'},
+                {title:'项目名称',align:'center',minWidth:120,key:'project_title'},
+                {title:'项目简称',align:'center',minWidth:120,key:'abbreviation'},
+                {title:'操作',align:'center',minWidth:120,key:'set',slot:'set'}
+            ],
+               searchData:{
+                   jtl_id:'',
+                   order_no:'',
+                   project_title:'',
+                   abbreviation:'',
+               }
+        }
+    },
+    mounted(){
+           this.initData();
+    },
+    methods:{
+        initData(row){
+
+         this.axios.post('/api/contract_product_list',{...row,page_size:this.pageSize,page_index:this.pageIndex}).then(res=>{
+             this.tableData = res.data.data;
+             this.total = res.data.total;
+         })
+        },
+        changePage(e){
+          this.pageIndex = e;
+          this.initData(this.searchData);
+        },
+        changeSize(e){
+            this.pageIndex = 1;
+            this.pageSize = e;
+            this.initData(this.searchData);
+        },
+        handleSet(row){
+            this.$router.push({path:'/cms/Agreement/productMessage/confirm',query:{order_no:row.order_no}})
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+.content{
+    height:85%;
+    overflow: auto;
+}
+.form_content{
+    margin-top: 15px;
+    display: flex;
+    flex-wrap: wrap;
+}
+.content_body_page{
+    text-align: center;
+    margin-top:10px;
+}
+</style>