Browse Source

Merge branch 'test' of https://git.agilestar.cn/spfm-group/spfm-market-front into test

wgp 3 years ago
parent
commit
bb54e1b971

File diff suppressed because it is too large
+ 1181 - 645
src/pages/main/advertising/businessHall.vue


+ 13 - 12
src/pages/main/advertising/contractCap.vue

@@ -75,23 +75,23 @@
 					</el-table-column> -->
                     <el-table-column label="操作" width="160px" align="center">
                         <template slot-scope="scope">
-                            <el-button
+                            <!-- <el-button
                                 size="mini"
                                 type="primary"
                                 @click="dialogCheck(1, scope.row)"
                                 >查看</el-button
-                            >
+                            > -->
                             <el-button
                                 size="mini"
                                 type="primary"
                                 @click="dialogCheck(2, scope.row)" 
                                 >编辑</el-button>
-                            <el-button
+                            <!-- <el-button
                                 size="mini"
                                 type="danger"
                                 @click="delLine(scope.row)" 
                                 >删除</el-button
-                            >
+                            > -->
                         </template>
                     </el-table-column>
                 </el-table>
@@ -125,7 +125,7 @@
                                 v-model="infolist.regionCode"
                                 placeholder="地市名称"
                                 @change="verifcheck"
-                                :disabled="disableStatus"
+                                :disabled="secbuyLastDisableStatus"
                             >
                                 <el-option
                                     v-for="item in regionOpt"
@@ -338,6 +338,7 @@ export default {
                         return item.regionName == this.userInfo.cityName;
                     });
                 }
+                
                 this.total = res.data.totalRecord;
                 this.loading = false;
 
@@ -423,19 +424,19 @@ export default {
                         data: this.infolist
                     }).then(res => {
                         this.loadinged = false;
-                        if (res.data.result === 1) {
-                            _this.$message({
-                                message: res.data.desc,
-                                type: "error"
-                            });
-                        } else {
-                            _this.$message({
+                        if (res.data.result === 0) {
+                             _this.$message({
                                 message: "成功",
                                 type: "success"
                             });
                             _this.infolist = {};
                             _this.dialogStatus = false;
                             _this.getList({}, _this.pageSize);
+                        } else {
+                            _this.$message({
+                                message: res.data.desc,
+                                type: "error"
+                            });
                         }
                     });
                 }

+ 25 - 21
src/pages/main/advertising/materialApplication.vue

@@ -18,8 +18,11 @@
                     </el-table-column>
                     <el-table-column prop="opCom" label="申请人所属公司">
                     </el-table-column>
-                    <!-- <el-table-column prop="approvalName" label="申请类型">
-                    </el-table-column> -->
+                    <el-table-column prop="provinceCity" label="申请类型">
+                        <template slot-scope="scope">
+                            {{provinceCityArr[scope.row.provinceCity-1]}}
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="opTime" label="申请时间">
                     </el-table-column>
                     <el-table-column prop="sts" label="任务状态">
@@ -27,22 +30,15 @@
                             {{stsArr[scope.row.sts]}}
                         </template>
                     </el-table-column>
-					<!-- <el-table-column prop="woNo" label="业务编码">
-                    </el-table-column>
-                    <el-table-column prop="scence" label="使用场景">
-                    </el-table-column>
-                    <el-table-column prop="approvalNo" label="申请工号">
-                    </el-table-column>
-					<el-table-column prop="budget" label="预算金额">
-                    </el-table-column> -->
-
                     <el-table-column label="操作" width="300px" align="center">
                         <template slot-scope="scope">
                             <!-- <el-button size="mini" type="primary" @click="dialogCheck(1,scope.row)">查看</el-button> -->
                             <!-- <el-button size="mini" type="primary" @click="dialogCheck(2,scope.row)">修改</el-button> -->
-                            <el-button size="mini" type="primary" @click="jump(scope.row)">审批</el-button>
-                            <el-button size="mini" type="primary" @click="dialogCheck(scope.row)">查看子任务列表</el-button>
-                            <el-button size="mini" type="danger" @click="delLine(scope.row)">删除</el-button>
+                            <el-button size="mini" type="primary" @click="jump(2, scope.row)">查看</el-button>
+                            <!-- <el-button size="mini" type="primary" @click="jump(1, scope.row)" v-if="loginNoStr == scope.row.nextOpNo && scope.row.woSts == 0">审批</el-button>                             -->
+                           <el-button size="mini" type="primary" @click="jump(1, scope.row)" v-if="loginNoStr == scope.row.nextOpNo">审批</el-button> 
+                            <el-button size="mini" type="primary" @click="jump(3, scope.row)" v-if="(scope.row.provinceCity == 1 && scope.row.nextStep ==7) || (scope.row.provinceCity == 2 && scope.row.nextStep == 11)">子任务列表</el-button>
+                            <el-button size="mini" type="danger" @click="delLine(scope.row)" v-if="loginNoStr == scope.row.opNo && ((scope.row.provinceCity == 1 && scope.row.nextStep <= 7) || (scope.row.provinceCity == 2 && scope.row.nextStep <= 11))">删除</el-button>
                         </template>
                     </el-table-column>
                 </el-table>
@@ -299,7 +295,9 @@
                 approvalinfolist: {
                     opinionradio: 1
                 },
-                stsArr: ['待审批','待确认','待验收','已完成']
+                stsArr: ['待审批','待确认','待验收','已完成'],
+                provinceCityArr:['省',"地市"],
+                loginNoStr: "",
             }
         },
         methods: {
@@ -309,9 +307,16 @@
 				});
 				this.setabList('物料宣传申请','/materialApplicationadd');
 			},
-            jump(v){
+            jump(v, n){
                 // console.log(v.id);
-                this.$router.push("/materialApplicationExa?id="+ v.id + "")
+                if(v === 1){
+                    this.$router.push("/materialApplicationExa?id="+ n.id + "")
+                }else if(v === 2){
+                    this.$router.push("/materialApplicationDetail?id="+ n.id + "")
+                }else if(v === 3){
+                    this.$router.push("/subtaskList?id="+ n.id + "")
+                }
+                
             },
             setabList(n, p) {
             	let params = {
@@ -367,12 +372,11 @@
                     },
                     data: v,
                 }).then((res) => {
-                    // console.log(res.data);
                     this.tableData = res.data.body.pageList.data;
-                    //this.tableData = res.data.data;
-
+                    console.log(res.data.body);
                     // this.total = res.data.totalRecord;
                     this.loading = false;
+
                 });
             },
             // 分页
@@ -524,7 +528,7 @@
             },
             getUser() {
                 this.userInfo = JSON.parse(window.sessionStorage.userInfo);
-
+                this.loginNoStr = this.userInfo.loginNoStr;
             }
         },
         mounted() {

+ 793 - 0
src/pages/main/advertising/materialApplicationDetail.vue

@@ -0,0 +1,793 @@
+<template>
+    <fullscreen :fullscreen.sync="fullscreen" class="container">
+        <div class="container-box">
+            <toolList @iconCli="iconCli" :tooltit="tooltit"></toolList>
+            <div class="search">
+                <mySearch
+                    :searchList="searchList"
+                    @searchInfo="searchInfo"
+                ></mySearch>
+            </div>
+            <div class="section2">
+                <el-button
+                    type="primary"
+                    @click="dialogApplication(2)"
+                    style="margin-right: 20px;margin-bottom: 20px;"
+                    >审批轨迹</el-button
+                >
+                <el-button
+                    type="primary"
+                    @click="dialogApplication(3)"
+                    style="margin-right: 20px;margin-bottom: 20px;"
+                    >导出</el-button
+                >
+                <a
+                    style="margin-right:50px; color:#169BD5; cursor:pointer"
+                    @click="attStatus = true"
+                    v-if="wo.fileUrl != null"
+                    >下载附件</a
+                >
+            </div>
+            <div class="tabbox">
+                <el-table
+                    height="calc(100% - 140px)"
+                    class="com-table"
+                    ref="multipleTable"
+                    :data="tableData"
+                    tooltip-effect="dark"
+                    size="small"
+                    border
+                    style="width: 100%"
+                    v-loading="loading"
+                >
+                    <!-- <el-table-column type="selection" width="55">
+                    </el-table-column> -->
+                    <el-table-column prop="woSts" label="状态">
+                        <template slot-scope="scope">
+                            {{ stsArr[scope.row.woSts] }}
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="regionName" label="地市公司">
+                    </el-table-column>
+                    <el-table-column prop="regionCode" label="公司编码">
+                    </el-table-column>
+                    <el-table-column prop="countyName" label="区县名称">
+                    </el-table-column>
+                    <el-table-column prop="countyCode" label="区县编码">
+                    </el-table-column>
+                    <el-table-column prop="channelCode" label="渠道编码">
+                    </el-table-column>
+                    <el-table-column prop="channelName" label="渠道名称">
+                    </el-table-column>
+                    <el-table-column prop="sceneName" label="场景">
+                    </el-table-column>
+                    <el-table-column prop="metirialType" label="物料类别">
+                    </el-table-column>
+                    <el-table-column prop="metirialCode" label="物料编码">
+                    </el-table-column>
+                    <el-table-column prop="metirialName" label="物料名称">
+                    </el-table-column>
+                    <el-table-column prop="unit" label="物料单位">
+                    </el-table-column>
+                    <el-table-column prop="size" label="规格尺寸">
+                    </el-table-column>
+                    <el-table-column prop="length" label="长">
+                    </el-table-column>
+                    <el-table-column prop="width" label="宽"> </el-table-column>
+                    <el-table-column prop="direction" label="横竖">
+                    </el-table-column>
+                    <el-table-column prop="coefficient" label="系数">
+                    </el-table-column>
+                    <el-table-column prop="sts" label="营业状态">
+                    </el-table-column>
+                    <el-table-column prop="quantity" label="数量" width="100">
+                    </el-table-column>
+                    <el-table-column prop="settlementAmount" label="结算金额">
+                        <template slot-scope="scope">
+                            <div>
+                                {{
+                                    scope.row.quantity *
+                                        scope.row.price *
+                                        scope.row.coefficient
+                                }}
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="supplierName" label="供应商">
+                    </el-table-column>
+                </el-table>
+                <!-- <el-pagination
+                    class="pageBox"
+                    @current-change="currchange"
+                    layout="prev, pager, next"
+                    background
+                    :total="total"
+                >
+                </el-pagination> -->
+            </div>
+        </div>
+        <!-- 审批轨迹 -->
+        <el-dialog
+            :title="titname"
+            :visible.sync="approvalStepDialogStatus"
+            width="50%"
+            :destroy-on-close="true"
+            :modal-append-to-body="false"
+            :close-on-click-modal="false"
+            :before-close="closedia"
+        >
+            <div v-loading="loadinged">
+                <div
+                    style="margin-bottom: 20px;padding: 0 20px;"
+                    v-if="titname != '添加'"
+                >
+                    <el-table
+                        class="com-table"
+                        ref="multipleTable"
+                        :data="rovaList"
+                        tooltip-effect="dark"
+                        size="small"
+                        border
+                        style="width: 100%"
+                    >
+                        <el-table-column prop="woId" label="编号">
+                        </el-table-column>
+                        <el-table-column prop="name" label="环节">
+                        </el-table-column>
+                        <el-table-column prop="opName" label="处理人">
+                        </el-table-column>
+                        <el-table-column prop="opNo" label="处理人工号">
+                        </el-table-column>
+                        <el-table-column prop="opTime" label="处理时间">
+                        </el-table-column>
+                        <el-table-column prop="descs" label="备注">
+                        </el-table-column>
+                    </el-table>
+                </div>
+                <div slot="footer" class="dialog-footer myfooter">
+                    <el-button @click="closedia">关 闭</el-button>
+                </div>
+            </div>
+        </el-dialog>
+
+        <el-dialog
+            title="附件"
+            :visible.sync="attStatus"
+            width="50%"
+            :destroy-on-close="true"
+            :modal-append-to-body="false"
+            :close-on-click-modal="false"
+            :before-close="closedia"
+        >
+            <div slot="title">
+                <div>
+                    附件
+                    <i
+                        class="el-icon-full-screen"
+                        style="float: right; margin-right: 30px"
+                        @click="
+                            () => {
+                                fullscreen = !fullscreen;
+                            }
+                        "
+                    ></i>
+                </div>
+            </div>
+            <div v-loading="loadinged">
+                <div style="margin: 10px 0">
+                    <uploadDown :datalist="datalist"></uploadDown>
+                </div>
+                <div class="dialog-footer myfooter">
+                    <el-button @click="attStatus = false">取 消</el-button>
+                </div>
+            </div>
+        </el-dialog>
+        <myMessage
+            :messTit="messTit"
+            @closeMessage="closeMessage"
+            :centerDialogVisible="centerDialogVisible"
+            v-if="centerDialogVisible"
+        ></myMessage>
+    </fullscreen>
+</template>
+<script>
+import mySearch from "../../../components/search.vue";
+import myMessage from "../../../components/myMessage.vue";
+import toolList from "../../../components/toolList";
+import myUpload from "../../../components/upload";
+import deptTreeOnly from "../../../components/deptTreeOnly.vue";
+import { MessageBox } from "element-ui";
+import { Loading } from "element-ui";
+import uploadDown from "../../../components/uploadDown";
+
+export default {
+    components: {
+        mySearch,
+        myMessage,
+        deptTreeOnly,
+        MessageBox,
+        toolList,
+        myUpload,
+        uploadDown
+    },
+    data() {
+        const regionName = (rule, value, callback) => {
+            if (!this.infolist.regionName) {
+                callback(new Error("不能为空"));
+            } else {
+                callback();
+            }
+        };
+        const advTypeDesc = (rule, value, callback) => {
+            if (!this.infolist.advTypeDesc) {
+                callback(new Error("不能为空"));
+            } else {
+                callback();
+            }
+        };
+        return {
+            loginNo: JSON.parse(sessionStorage.userInfo).loginNo,
+            rules: {
+                regionName: [
+                    {
+                        required: true,
+                        trigger: "change",
+                        validator: regionName
+                    }
+                ],
+                advTypeDesc: [
+                    {
+                        required: true,
+                        trigger: "change",
+                        validator: advTypeDesc
+                    }
+                ]
+            },
+            searchList: [
+                {
+                    type: "sel",
+                    tit: "地市",
+                    value: "",
+                    width: "24%",
+                    options: []
+                },
+                {
+                    type: "sel",
+                    tit: "区县",
+                    value: "",
+                    width: "24%",
+                    options: []
+                },
+                {
+                    type: "sel",
+                    tit: "物料类别",
+                    value: "",
+                    width: "24%",
+                    options: []
+                },
+                {
+                    type: "sel",
+                    tit: "状态",
+                    value: "",
+                    width: "24%",
+                    options: []
+                }
+            ],
+            tooltit: "物料申请审核",
+            fullscreen: false,
+            total: 0,
+            pageSize: 1,
+            tableData: [],
+            supplierDialogStatus: false,
+            disableStatus: false,
+            approvalDialogStatus: false,
+            approvalStepDialogStatus: false,
+            titname: "",
+            infolist: {
+                distributionChoose: ""
+            },
+            approvalinfolist: {
+                opinionradio: 1
+            },
+            userInfo: {},
+            params: {},
+            centerDialogVisible: false,
+            messTit: "",
+            delid: "",
+            loading: false,
+            loadinged: false,
+            fileInfo: {
+                limit: 10,
+                url: "/market/cwo/upload",
+                fileList: []
+            },
+            infoApply: {},
+            rovaList: [],
+            woNoArr: [],
+            supplierOpt: [],
+            isSupplierTable: false,
+            // 树形弹窗
+            checkexa: false,
+            treeListonly: {},
+            defaultList: [],
+            closeList: false,
+            visionchonly: false,
+            depttype: 0,
+            // 固定审批人员
+            fixedDialogStatus: false,
+            userListOpt: [],
+            cMkAdvMetirialWoInfoSubmit: {},
+            stsArr: ["待审批", "审批通过", "打回"],
+            // 分发
+            distributionDialogStatus: false,
+            distributionRegionOpt: [],
+            cWoInfoIssued: {},
+            wo: {},
+            datalist: {
+                url: "/market/cadvBusiMetirialWo/checkExport",
+                type: 2
+            },
+            attStatus: false
+        };
+    },
+    computed: {
+        amountsum: {
+            set() {},
+            get() {
+                var sum = 0;
+                this.tableData.forEach(item => {
+                    sum += parseFloat(
+                        item.price * item.quantity * item.coefficient
+                    );
+                });
+                return sum.toFixed(2);
+            }
+        },
+        countsum: {
+            set() {},
+            get() {
+                var sum = 0;
+                this.tableData.forEach(item => {
+                    sum += parseFloat(item.quantity);
+                });
+                return sum;
+            }
+        }
+    },
+    methods: {
+        tableSelectionChange(val, row) {
+            this.multipleSelection = val;
+
+            // console.log(val);
+            // this.woNoArr=[]
+            // this.multipleSelection.forEach(item => {
+            //     this.woNoArr.push(item.woNo)
+            // });
+            // console.log(this.multipleSelection);
+        },
+        closedia() {
+            this.infolist = {};
+            this.approvalDialogStatus = false;
+            this.approvalinfolist = {};
+            this.supplierDialogStatus = false;
+            this.approvalStepDialogStatus = false;
+            this.distributionDialogStatus = false;
+            this.attStatus = false;
+        },
+        //搜索数据
+        searchInfo(v) {
+            this.params = {};
+            // v[0] ? this.params.metirialName = v[0] : '';
+            v[0] ? (this.params.regionName = v[0]) : "";
+            v[2] ? (this.params.metirialType = v[2]) : "";
+            this.getList(this.params, this.pageSize);
+        },
+        //获取列表
+        getList(v, n) {
+            this.pageSize = n;
+            let _this = this;
+            // this.loading = true;
+            this.tableData = [];
+            // v.assigneeNo = this.loginNo;
+            this.$http({
+                url: "/market/cadvBusiMetirialWo/queryPageForWoInfo",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                    page: '{"pageNo":"' + n + '","pageSize":"10"}'
+                },
+                data: v
+            }).then(res => {
+                // console.log(res.data);
+                this.tableData = res.data.body.pageList.data;
+                this.userListOpt =
+                    res.data.body.queryCurrentAndNext.next.userList;
+                this.total = res.data.totalRecord;
+                this.wo = res.data.body.wo;
+                this.datalist.attList = JSON.parse(this.wo.fileUrl);
+
+                this.searchList[0].options = [];
+                this.searchList[1].options = [];
+                this.searchList[2].options = [];
+                this.searchList[3].options = [];
+                
+            // Array.from(new Set(arr))
+                let temp = [];
+                this.tableData.forEach(item=>{
+                    temp.push({dataCode: item.metirialType, dataName: item.metirialType});
+                });
+                let map = new Map();
+                this.searchList[2].options =  temp.filter((temp) => !map.has(temp.metirialType) && map.set(temp.metirialType, 1));
+                // console.log(this.tableData);
+                this.loading = false;
+            });
+        },
+        // 分页
+        currchange(v) {
+            this.pageSize = v;
+            this.getList(this.params, this.pageSize);
+        },
+
+        // 申请(new)
+        dialogApplication(v, n) {
+            var _this = this;
+            // if(this.multipleSelection == undefined){
+            //     this.centerDialogVisible = true;
+            //     this.messTit = "请至少选择一条进行审批";
+
+            // }else{
+            //     this.approvalDialogStatus = true;
+            //     this.titname = "审批";
+            //     this.disableStatus = false;
+            // }
+            if (v === 2) {
+                this.titname = "审批轨迹";
+                this.approvalStepDialogStatus = true;
+                this.$http({
+                    url: "market/advBusiMetirialWoStep/queryList",
+                    method: "post",
+                    headers: {
+                        "Content-Type": "application/json"
+                    },
+                    data: { mKAdvBusiMetirialWoStep: this.params.woId }
+                }).then(res => {
+                    console.log(res.data);
+                    this.rovaList = res.data;
+                });
+            } else if (v === 3) {
+                this.$http({
+                    url: "/market/cadvBusiMetirialWo/export",
+                    method: "post",
+                    headers: {
+                        "Content-Type": "application/json"
+                    },
+                    responseType: "blob",
+                    data: { id: this.params.woId }
+                }).then(res => {
+                    if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+                        let blob = new Blob([res.data], {
+                            type: "application/vnd.ms-excel"
+                        });
+                        window.navigator.msSaveOrOpenBlob(
+                            blob,
+                            this.wo.bizName + ".xlsx"
+                        );
+                    } else {
+                        /* 火狐谷歌的文件下载方式 */
+                        var blob = new Blob([res.data]);
+                        var downloadElement = document.createElement("a");
+                        var href = window.URL.createObjectURL(blob);
+                        downloadElement.href = href;
+                        downloadElement.download = this.wo.bizName + ".xlsx";
+                        document.body.appendChild(downloadElement);
+                        downloadElement.click();
+                        document.body.removeChild(downloadElement);
+                        window.URL.revokeObjectURL(href);
+                    }
+                });
+            }
+        },
+
+        treeCheckonly(v) {
+            this.treeListonly = v;
+        },
+        //添加
+        dialogCli(v) {
+            // 1审批 2审批轨迹 3导出 4供应商 5任务分发
+            if (v === 1) {
+                this.approvalDialogStatus = false;
+                // let list = {};
+                this.cMkAdvMetirialWoInfoSubmit.mkAdvBusiMetirialWoInfoList = this.multipleSelection;
+                this.cMkAdvMetirialWoInfoSubmit.woId = this.params.woId;
+                this.cMkAdvMetirialWoInfoSubmit.remark = this.approvalinfolist.opinion;
+                if (this.approvalinfolist.opinionradio == 1) {
+                    this.cMkAdvMetirialWoInfoSubmit.woSts = "1";
+                    // console.log(list);
+                    if (this.userListOpt == null) {
+                        // 树形审批人
+                        this.checkexa = true;
+                    } else {
+                        // 固定审批人弹窗
+                        this.fixedDialogStatus = true;
+                    }
+                    // this.submitInfo("/market/cadvBusiMetirialWo/submitWo", list);
+                } else if (this.approvalinfolist.opinionradio == 2) {
+                    this.cMkAdvMetirialWoInfoSubmit.woSts = "2";
+                    this.checkexa = false;
+                    this.fixedDialogStatus = false;
+
+                    console.log(this.cMkAdvMetirialWoInfoSubmit);
+                    this.submitInfo(
+                        "/market/cadvBusiMetirialWo/submitWo",
+                        this.cMkAdvMetirialWoInfoSubmit
+                    );
+                }
+            } else if (v === 2) {
+                this.approvalStepDialogStatus = false;
+            } else if (v === 3) {
+                //
+            }
+        },
+        submitInfo(u, v) {
+            let _this = this;
+            let loadingInstance = Loading.service()
+            this.$http({
+                url: u,
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json"
+                },
+                data: v
+            }).then(res => {
+                loadingInstance.close()
+                if (res.data.result === 1) {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: "error"
+                    });
+                }
+                if (res.data.result === 2) {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: "error"
+                    });
+                } else {
+                    _this.$message({
+                        message: "成功",
+                        type: "success"
+                    });
+                    _this.getList(this.params, this.pageSize);
+                }
+            });
+        },
+        closeMessage(v) {
+            this.centerDialogVisible = false;
+            let _this = this;
+            if (v === 1) {
+                _this
+                    .$http({
+                        url: "/bpm/api/deleteBpmPrePlugin",
+                        method: "post",
+                        headers: {
+                            "Content-Type": "application/json"
+                        },
+                        data: {
+                            id: this.delid
+                        }
+                    })
+                    .then(res => {
+                        if (res.data.result === 1) {
+                            _this.$message({
+                                message: res.data.desc,
+                                type: "error"
+                            });
+                        } else {
+                            _this.$message({
+                                message: "删除成功",
+                                type: "success"
+                            });
+                            _this.getList(this.params, this.pageSize);
+                        }
+                    });
+            }
+        },
+        //删除
+        delLine(v) {
+            this.centerDialogVisible = true;
+            this.messTit = "即将删除此条数据, 是否删除?";
+            this.delid = v.id;
+        },
+        //文件返回值
+        uploadBack(v) {
+            // console.log(v);
+        },
+        //功能栏
+        iconCli(v) {
+            if (v === 1) {
+                this.getList(this.params, this.pageSize);
+            }
+            if (v === 2) {
+                this.fullscreen = !this.fullscreen;
+            }
+        },
+        getUser() {
+            this.userInfo = JSON.parse(window.sessionStorage.userInfo);
+        }
+    },
+    mounted() {
+        if (JSON.stringify(this.$route.query) != "{}") {
+            this.params.woId = this.$route.query.id;
+        }
+        this.getList(this.params, 1);
+        this.getUser();
+    },
+    watch: {
+        $route() {
+            this.getList(this.params, 1);
+        }
+    },
+    created() {}
+};
+</script>
+<style scoped lang="scss">
+.onetab {
+    margin-bottom: 20px;
+    padding: 0 20px;
+}
+
+.titbox {
+    div {
+        float: right;
+
+        i {
+            font-size: 22px;
+            margin-left: 20px;
+            cursor: pointer;
+        }
+    }
+}
+
+.tabbox {
+    margin-top: 15px;
+}
+
+.pageBox {
+    text-align: right;
+    margin-top: 10px;
+}
+
+.info-line {
+    width: 100%;
+    display: block;
+    padding-left: 20px;
+
+    div {
+        width: 50%;
+        display: inline-block;
+    }
+
+    span {
+        width: 80px;
+        display: inline-block;
+        text-align: left;
+
+        i {
+            color: red;
+            display: inline-block;
+            padding-right: 5px;
+        }
+    }
+
+    .el-select,
+    .el-input {
+        width: calc(100% - 100px);
+    }
+}
+
+.online {
+    width: 100%;
+
+    .el-select {
+        width: calc(100% - 100px);
+    }
+
+    span {
+        vertical-align: top;
+    }
+
+    .el-textarea {
+        width: calc(100% - 100px);
+    }
+}
+.adv-type {
+    margin-top: 20px;
+    display: flex;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    // border: 1px solid #ddd;
+    border-radius: 5px;
+    padding: 20px;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+    div {
+        width: 33%;
+        text-align: center;
+        height: 80px;
+        overflow: hidden;
+        min-width: 100px;
+        cursor: pointer;
+        padding-top: 10px;
+        margin: 10px 0;
+    }
+    div:hover {
+        background: #cfe8fc;
+        border-radius: 5px;
+    }
+    span {
+        width: 100%;
+        display: inline-block;
+        height: 40px;
+        // line-height: 40px;
+        i {
+            color: #0074d9;
+            font-size: 36px;
+        }
+    }
+}
+.section2 {
+    display: flex;
+    align-items: center;
+    margin: 40px 0;
+    button {
+        margin-bottom: 0 !important;
+    }
+    h3 {
+        margin-right: 40px;
+    }
+}
+.t-footer {
+    text-align: center;
+    padding-right: 20px;
+    margin-top: 20px;
+    padding-bottom: 20px;
+}
+.tree {
+    width: calc(50% - 60px) !important;
+    display: inline-block;
+    margin-right: 20px;
+    height: 300px;
+    overflow-y: scroll;
+
+    .el-icon-error {
+        float: right;
+        font-size: 20px;
+        margin-top: 9px;
+        cursor: pointer;
+    }
+}
+
+.treeUser {
+    margin: 0;
+    border: 1px solid #ddd;
+
+    p {
+        background: #f4f4f4;
+        padding: 0 20px;
+        margin-bottom: 5px;
+    }
+}
+
+.treeUserb {
+    width: calc(100% - 100px);
+    border: 1px solid #ddd;
+    background: #f4f4f4;
+    border-radius: 3px;
+    height: auto;
+    overflow: hidden;
+
+    p {
+        display: inline-block;
+        padding: 0 20px;
+        margin-bottom: 5px;
+    }
+}
+</style>

+ 390 - 109
src/pages/main/advertising/materialApplicationExa.vue

@@ -13,6 +13,7 @@
                     type="primary"
                     @click="dialogApplication(1)"
                     style="width: 80px;margin-right: 20px;margin-bottom: 20px;"
+                    v-if="(wo.provinceCity == 1 && wo.nextStep != 7 && wo.nextStep != 11) || (wo.provinceCity == 2 && wo.nextStep != 11)"
                     >审批</el-button
                 >
                 <el-button
@@ -31,22 +32,39 @@
                     type="primary"
                     @click="dialogApplication(4)"
                     style="margin-right: 20px;margin-bottom: 20px;"
+                    v-if="
+                        (step.serialNum == 3 && step.provinceCity == 1) ||
+                            (step.serialNum == 6 && step.provinceCity == 2)
+                    "
                     >供应商</el-button
                 >
                 <el-button
                     type="primary"
                     @click="dialogApplication(5)"
                     style="margin-right: 20px;margin-bottom: 20px;"
+                    v-if="
+                        (step.serialNum == 7 && step.provinceCity == 1) ||
+                            (step.serialNum == 10 && step.provinceCity == 2)
+                    "
                     >任务分发</el-button
                 >
+<<<<<<< HEAD
+                <a
+                    style="margin-right:50px; color:#169BD5; cursor:pointer"
+                    @click="attStatus = true"
+                    v-if="wo.fileUrl != null"
+                    >下载附件</a
+                >
+=======
                 <a style="margin-right:50px; color:#169BD5; cursor:pointer" @click="attStatus = true;">下载附件</a>
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
 
                 <h3>预计总金额:{{ amountsum }}</h3>
                 <h3>总数: {{ countsum }}</h3>
             </div>
             <div class="tabbox">
                 <el-table
-                    height="calc(100% - 40px)"
+                    height="calc(100% - 140px)"
                     class="com-table"
                     ref="multipleTable"
                     :data="tableData"
@@ -55,7 +73,7 @@
                     border
                     style="width: 100%"
                     v-loading="loading"
-                    @select="tableSelectionChange"
+                    @selection-change="tableSelectionChange"
                 >
                     <el-table-column type="selection" width="55">
                     </el-table-column>
@@ -97,21 +115,32 @@
                     </el-table-column>
                     <el-table-column prop="priority" label="优先级">
                     </el-table-column>
+                    <el-table-column prop="settlementAmount" label="结算金额">
+                        <template slot-scope="scope">
+                            <div>
+                                {{
+                                    scope.row.quantity *
+                                        scope.row.price *
+                                        scope.row.coefficient
+                                }}
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column
-                        prop="supplier"
+                        prop="supplierName"
                         label="供应商"
-                        v-if="supplierDialogStatus"
+                        v-if="infolist.name != null"
                     >
                     </el-table-column>
                 </el-table>
-                <el-pagination
+                <!-- <el-pagination
                     class="pageBox"
                     @current-change="currchange"
                     layout="prev, pager, next"
                     background
                     :total="total"
                 >
-                </el-pagination>
+                </el-pagination> -->
             </div>
         </div>
         <!-- 审批 -->
@@ -184,25 +213,22 @@
                         border
                         style="width: 100%"
                     >
-                        <el-table-column prop="taskId" label="编号">
+                        <el-table-column prop="woId" label="编号">
                         </el-table-column>
-                        <el-table-column prop="taskName" label="环节">
+                        <el-table-column prop="name" label="环节">
                         </el-table-column>
-                        <el-table-column prop="assigneeName" label="处理人">
+                        <el-table-column prop="opName" label="处理人">
                         </el-table-column>
-                        <el-table-column prop="assigneeNo" label="处理人工号">
+                        <el-table-column prop="opNo" label="处理人工号">
                         </el-table-column>
                         <el-table-column prop="opTime" label="处理时间">
                         </el-table-column>
-                        <el-table-column prop="remark" label="备注">
+                        <el-table-column prop="descs" label="备注">
                         </el-table-column>
                     </el-table>
                 </div>
                 <div slot="footer" class="dialog-footer myfooter">
-                    <el-button @click="closedia">取 消</el-button>
-                    <el-button type="primary" @click="dialogCli(2)"
-                        >确 定</el-button
-                    >
+                    <el-button @click="closedia">关 闭</el-button>
                 </div>
             </div>
         </el-dialog>
@@ -254,53 +280,83 @@
             </div>
         </el-dialog>
         <!-- 任务分发 -->
-        <!-- <el-dialog
+        <el-dialog
             :title="titname"
-            :visible.sync="supplierDialogStatus"
-            width="30%"
+            :visible.sync="distributionDialogStatus"
+            width="50%"
             :destroy-on-close="true"
             :modal-append-to-body="false"
             :close-on-click-modal="false"
             :before-close="closedia"
         >
             <div v-loading="loadinged">
-                <el-form
-                :model="infolist"
-                ref="infolist"
-                :rules="rules"
-                style="height: 30vh;"
-            >
-                <div class="info-line">
-                    <el-form-item prop="" style="width: 100%">
-                        <span>供应商</span>
-                        <el-select
-                            @change="changeSearch(1)"
-                            clearable
-                            v-model="infolist.sceneName"
-                            placeholder="供应商"
-                            :disabled="disableStatus"
+                <el-form :model="infolist" ref="infolist" :rules="rules">
+                    <div class="info-line">
+                        <el-form-item
+                            prop=""
+                            style="width: 100%"
+                            class="info-line online"
                         >
-                            <el-option
-                                v-for="(items, index) in sceneNameopt"
-                                :key="index"
-                                :label="items.sceneName"
-                                :value="items.sceneName"
+                            <span>任务分发</span>
+                            <el-select
+                                clearable
+                                v-model="infolist.distributionChoose"
+                                placeholder="任务分发"
                             >
+<<<<<<< HEAD
+                                <el-option
+                                    v-for="(items,
+                                    index) in distributionRegionOpt"
+                                    :key="index"
+                                    :label="items"
+                                    :value="items"
+                                >
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item
+                            prop="visiblec"
+                            style="width: 100%"
+                            class="info-line online"
+                        >
+                            <span>审批人员</span>
+                            <deptTreeOnly
+                                class="tree"
+                                @treeCheck="treeCheckonly"
+                                :defaultList="defaultList"
+                                :type="depttype"
+                                :closeList="closeList"
+                            ></deptTreeOnly>
+                            <div class="tree treeUser">
+                                <p>
+                                    {{ treeListonly.leaderAuditName }}
+                                    <i
+                                        v-if="treeListonly.leaderAuditName"
+                                        @click="deletes()"
+                                        class="el-icon-error"
+                                    ></i>
+                                </p>
+                            </div>
+                        </el-form-item>
+                    </div>
+                </el-form>
+=======
                             </el-option>
                         </el-select>
                     </el-form-item>
 
                 </div>
             </el-form>
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
 
-            <div class="t-footer">
-                <el-button type="primary" @click="dialogCli(3)"
-                    >确 定</el-button
-                >
-                <el-button @click="closedia">取 消</el-button>
-            </div>
+                <div class="t-footer">
+                    <el-button type="primary" @click="dialogCli(5)"
+                        >确 定</el-button
+                    >
+                    <el-button @click="closedia">取 消</el-button>
+                </div>
             </div>
-        </el-dialog> -->
+        </el-dialog>
         <!-- 选择固定审批人 -->
         <el-dialog
             title="选择审批人"
@@ -322,7 +378,6 @@
                         <el-form-item prop="" style="width: 100%">
                             <span>审批人员</span>
                             <el-select
-                                @change="changeSearch(4)"
                                 clearable
                                 v-model="infolist.loginNameStr"
                                 placeholder="审批人员"
@@ -395,7 +450,10 @@
                 </div>
             </div>
         </el-dialog>
+<<<<<<< HEAD
+=======
 
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
         <el-dialog
             title="附件"
             :visible.sync="attStatus"
@@ -408,17 +466,33 @@
             <div slot="title">
                 <div>
                     附件
+<<<<<<< HEAD
+                    <i
+                        class="el-icon-full-screen"
+                        style="float: right; margin-right: 30px"
+                        @click="
+                            () => {
+                                fullscreen = !fullscreen;
+                            }
+                        "
+                    ></i>
+=======
                     <i class="el-icon-full-screen" style="float: right; margin-right: 30px" @click="
                 () => {
                   fullscreen = !fullscreen;
                 }"></i>
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
                 </div>
             </div>
             <div v-loading="loadinged">
                 <div style="margin: 10px 0">
+<<<<<<< HEAD
+                    <uploadDown :datalist="datalist"></uploadDown>
+=======
                     <uploadDown
                         :datalist="datalist"
                     ></uploadDown>
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
                 </div>
                 <div class="dialog-footer myfooter">
                     <el-button @click="attStatus = false">取 消</el-button>
@@ -437,9 +511,16 @@
 import mySearch from "../../../components/search.vue";
 import myMessage from "../../../components/myMessage.vue";
 import toolList from "../../../components/toolList";
+<<<<<<< HEAD
+import myUpload from "../../../components/upload";
+import deptTreeOnly from "../../../components/deptTreeOnly.vue";
+import { MessageBox } from "element-ui";
+import { Loading } from "element-ui";
+=======
 // import myUpload from "../../../components/upload";
 // import deptTreeOnly from "../../../components/deptTreeOnly.vue";
 // import { MessageBox } from "element-ui";
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
 import uploadDown from "../../../components/uploadDown";
 
 export default {
@@ -449,8 +530,13 @@ export default {
         // deptTreeOnly,
         // MessageBox,
         toolList,
+<<<<<<< HEAD
+        myUpload,
+        uploadDown
+=======
         // myUpload,
         uploadDown,
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
     },
     data() {
         const regionName = (rule, value, callback) => {
@@ -486,17 +572,25 @@ export default {
                 ]
             },
             searchList: [
-                // {
-                //     type: 'input',
-                //     tit: '物料名称',
-                //     value: '',
-                //     width: '48%',
-                // },
+                {
+                    type: "sel",
+                    tit: "地市",
+                    value: "",
+                    width: "32%",
+                    options: []
+                },
+                {
+                    type: "sel",
+                    tit: "区县",
+                    value: "",
+                    width: "32%",
+                    options: []
+                },
                 {
                     type: "sel",
                     tit: "物料类别",
                     value: "",
-                    width: "98%",
+                    width: "32%",
                     options: []
                 }
                 // {
@@ -517,7 +611,9 @@ export default {
             approvalDialogStatus: false,
             approvalStepDialogStatus: false,
             titname: "",
-            infolist: {},
+            infolist: {
+                distributionChoose: ""
+            },
             approvalinfolist: {
                 opinionradio: 1
             },
@@ -535,17 +631,10 @@ export default {
             },
             infoApply: {},
             rovaList: [
-                {
-                    taskId: "178456126588466",
-                    taskName: "流程发起",
-                    assigneeName: "某某",
-                    assigneeNo: "moumou",
-                    opTime: "2021-06-21 12:56:24",
-                    remark: "fff"
-                }
             ],
             woNoArr: [],
             supplierOpt: [],
+            isSupplierTable: false,
             // 树形弹窗
             checkexa: false,
             treeListonly: {},
@@ -558,12 +647,28 @@ export default {
             userListOpt: [],
             cMkAdvMetirialWoInfoSubmit: {},
             stsArr: ["待审批", "审批通过", "打回"],
+<<<<<<< HEAD
+            // 分发
+            distributionDialogStatus: false,
+            distributionRegionOpt: [],
+            cWoInfoIssued: {},
+            wo: {},
+            datalist: {
+                url: "/market/cadvBusiMetirialWo/checkExport",
+                type: 2
+            },
+            attStatus: false,
+            step: {},
+            passedList:[],
+            multipleSelection:[]
+=======
             wo:{},
             datalist: {
                 url: "/market/cadvBusiMetirialWo/checkExport",
                 type: 2,
             },
             attStatus: false,
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
         };
     },
     computed: {
@@ -593,7 +698,7 @@ export default {
     methods: {
         tableSelectionChange(val, row) {
             this.multipleSelection = val;
-
+            console.log(this.multipleSelection);
             // console.log(val);
             // this.woNoArr=[]
             // this.multipleSelection.forEach(item => {
@@ -607,22 +712,26 @@ export default {
             this.approvalDialogStatus = false;
             this.approvalinfolist = {};
             this.supplierDialogStatus = false;
-            // this.approvalinfolist =
             this.approvalStepDialogStatus = false;
+<<<<<<< HEAD
+            this.distributionDialogStatus = false;
+=======
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
             this.attStatus = false;
         },
         //搜索数据
         searchInfo(v) {
-            this.params = {};
+            // this.params = {};
             // v[0] ? this.params.metirialName = v[0] : '';
-            v[0] ? (this.params.regionName = v[0]) : "";
+            v[2] ? (this.params.metirialType = v[2]) : "";
+            // this.params.woId
             this.getList(this.params, this.pageSize);
         },
         //获取列表
         getList(v, n) {
             this.pageSize = n;
             let _this = this;
-            // this.loading = true;
+            this.loading = true;
             this.tableData = [];
             // v.assigneeNo = this.loginNo;
             this.$http({
@@ -634,13 +743,43 @@ export default {
                 },
                 data: v
             }).then(res => {
+<<<<<<< HEAD
+                // console.log(res.data.body);
+                // this.tableData = res.data.body.pageList.data;
+                res.data.body.pageList.data.forEach(item=>{
+                    if (item.woSts == '0') {
+                        this.tableData.push(item);
+                    } else if (item.woSts == '1') {
+                        this.passedList.push(item);
+                    }
+                });
+                this.userListOpt =
+                    res.data.body.queryCurrentAndNext.next.userList;
+                this.total = res.data.totalRecord;
+                this.wo = res.data.body.wo;
+                this.datalist.attList = JSON.parse(this.wo.fileUrl);
+                this.step = res.data.body.step;
+                this.searchList[2].options = [];
+                // Array.from(new Set(arr))
+                let temp = [];
+                this.tableData.forEach(item=>{
+                    temp.push({dataCode: item.metirialType, dataName: item.metirialType});
+                });
+                let map = new Map();
+                this.searchList[2].options =  temp.filter((temp) => !map.has(temp.metirialType) && map.set(temp.metirialType, 1));
+                
+                
+                
+=======
                 // console.log(res.data);
                 this.tableData = res.data.body.pageList.data;
                 this.userListOpt = res.data.body.queryCurrentAndNext.next.userList;
                 this.total = res.data.totalRecord;
                 this.wo = res.data.body.wo;
                 this.datalist.attList = JSON.parse(this.wo.fileUrl);
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
                 this.loading = false;
+                
             });
         },
         // 分页
@@ -652,41 +791,63 @@ export default {
         // 申请(new)
         dialogApplication(v, n) {
             var _this = this;
-            // if(this.multipleSelection == undefined){
-            //     this.centerDialogVisible = true;
-            //     this.messTit = "请至少选择一条进行审批";
-
-            // }else{
-            //     this.approvalDialogStatus = true;
-            //     this.titname = "审批";
-            //     this.disableStatus = false;
-            // }
-            if (!this.multipleSelection) this.multipleSelection = [];
+            // if (!this.multipleSelection) this.multipleSelection = [];
+            
             if (v === 1) {
                 if (
                     this.multipleSelection == undefined ||
                     this.multipleSelection == ""
                 ) {
+                    
                     MessageBox.alert("请至少选择一条进行审批", "温馨提示", {
                         confirmButtonText: "确定"
                     });
+                    // step.serialNum == 3 && step.provinceCity == 1) || (step.serialNum == 6 && step.provinceCity == 2
                 } else {
-                    this.titname = "审批";
-                    this.approvalDialogStatus = true;
+                    if ((this.step.serialNum == 3 &&this.step.provinceCity == 1) ||(this.step.serialNum == 6 &&this.step.provinceCity == 2)) {
+                        let n = 0;
+                        this.multipleSelection.forEach(item=>{
+                            // console.log(item);
+                            if(item.supplierName == null || item.supplierName == undefined){
+                                
+                                n =1;
+                                return;
+                            }
+                        })
+                        if(n==1){
+                            MessageBox.alert(
+                                    "请先选择供应商再进行审批",
+                                    "温馨提示",
+                                    {
+                                        confirmButtonText: "确定"
+                                    }
+                                );
+                                return;
+                        }else{
+                            this.titname = "审批";
+                            this.approvalDialogStatus = true;
+                        }
+                            
+                        
+                    }else{
+                            this.titname = "审批";
+                            this.approvalDialogStatus = true;
+                        }
+                    
                 }
             } else if (v === 2) {
-                if (
-                    this.multipleSelection == undefined ||
-                    this.multipleSelection == ""
-                ) {
-                    MessageBox.alert("请选择一条查看审批轨迹", "温馨提示", {
-                        confirmButtonText: "确定"
-                    });
-                } else if (this.multipleSelection.length > 1) {
-                    MessageBox.alert("只能选择一条查看审批轨迹", "温馨提示", {
-                        confirmButtonText: "确定"
-                    });
-                } else {
+                // if (
+                //     this.multipleSelection == undefined ||
+                //     this.multipleSelection == ""
+                // ) {
+                //     MessageBox.alert("请选择一条查看审批轨迹", "温馨提示", {
+                //         confirmButtonText: "确定"
+                //     });
+                // } else if (this.multipleSelection.length > 1) {
+                //     MessageBox.alert("只能选择一条查看审批轨迹", "温馨提示", {
+                //         confirmButtonText: "确定"
+                //     });
+                // } else {
                     this.titname = "审批轨迹";
                     this.approvalStepDialogStatus = true;
                     this.$http({
@@ -695,11 +856,15 @@ export default {
                         headers: {
                             "Content-Type": "application/json"
                         },
-                        data: {mKAdvBusiMetirialWoStep: this.params.woId}
+                        data: { mKAdvBusiMetirialWoStep: this.params.woId }
                     }).then(res => {
                         console.log(res);
                     });
+<<<<<<< HEAD
+                // }
+=======
                 }
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
             } else if (v === 3) {
                 this.$http({
                     url: "/market/cadvBusiMetirialWo/export",
@@ -712,7 +877,11 @@ export default {
                 }).then(res => {
                     if (window.navigator && window.navigator.msSaveOrOpenBlob) {
                         let blob = new Blob([res.data], {
+<<<<<<< HEAD
+                            type: "application/vnd.ms-excel"
+=======
                             type: "application/vnd.ms-excel",
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
                         });
                         window.navigator.msSaveOrOpenBlob(
                             blob,
@@ -732,6 +901,16 @@ export default {
                     }
                 });
             } else if (v === 4) {
+                if (
+                    this.multipleSelection == undefined ||
+                    this.multipleSelection == ""
+                ) {
+                    MessageBox.alert("请至少选择一条", "温馨提示", {
+                        confirmButtonText: "确定"
+                    });
+                    return;
+                    // step.serialNum == 3 && step.provinceCity == 1) || (step.serialNum == 6 && step.provinceCity == 2
+                }
                 this.titname = "选择供应商";
                 this.supplierDialogStatus = true;
                 this.$http({
@@ -747,13 +926,12 @@ export default {
                 });
             } else if (v === 5) {
                 this.titname = "任务分发";
+                this.distributionDialogStatus = true;
                 let regionArr = [];
                 this.tableData.forEach(item => {
                     regionArr.push(item.regionName);
                 });
-                let newRegionArr = [...new Set(regionArr)];
-
-                // console.log(newRegionArr);
+                this.distributionRegionOpt = [...new Set(regionArr)];
             }
         },
 
@@ -773,22 +951,83 @@ export default {
                 if (this.approvalinfolist.opinionradio == 1) {
                     this.cMkAdvMetirialWoInfoSubmit.woSts = "1";
                     // console.log(list);
+                    if (this.userListOpt == null) {
+                        // 树形审批人
+                        this.checkexa = true;
+                    } else {
+
+                        if (this.tableData.length != this.multipleSelection.length) {
+                            this.fixedDialogStatus = false;
+                            this.submitInfo(
+                                "/market/cadvBusiMetirialWo/submitWo",
+                                this.cMkAdvMetirialWoInfoSubmit
+                            );
+                        } else {
+                            // 固定审批人弹窗
+                            if (this.userListOpt.length == 1) {
+                                this.cMkAdvMetirialWoInfoSubmit.nextOpNo = this.userListOpt[0].loginNoStr;
+                                this.cMkAdvMetirialWoInfoSubmit.nextOpName = this.userListOpt[0].loginNameStr;
+                                this.fixedDialogStatus = false;
 
+                                // console.log(this.cMkAdvMetirialWoInfoSubmit);
+                                this.submitInfo(
+                                    "/market/cadvBusiMetirialWo/submitWo",
+                                    this.cMkAdvMetirialWoInfoSubmit
+                                );
+                                // userListSingle = "";
+                                this.approvalinfolist.opinionradio = "1";
+                                this.approvalinfolist.opinion = "";
+                            }else{
+                                this.fixedDialogStatus = true;
+                            }
+                        }
+                    }
                     // this.submitInfo("/market/cadvBusiMetirialWo/submitWo", list);
                 } else if (this.approvalinfolist.opinionradio == 2) {
                     this.cMkAdvMetirialWoInfoSubmit.woSts = "2";
-                    // console.log(list);
-                    // this.submitInfo("/market/cadvBusiMetirialWo/submitWo", list);
-                }
-                if (this.userListOpt == null) {
-                    // 树形审批人
-                    this.checkexa = true;
-                } else {
-                    // 固定审批人弹窗
-                    this.fixedDialogStatus = true;
+                    if (this.tableData.length == this.multipleSelection.length && this.passedList.length > 0) {
+                        if (this.userListOpt == null) {
+                            // 树形审批人
+                            this.checkexa = true;
+                        } else {
+
+                            if (this.tableData.length != this.multipleSelection.length) {
+                                this.fixedDialogStatus = false;
+                                this.submitInfo(
+                                    "/market/cadvBusiMetirialWo/submitWo",
+                                    this.cMkAdvMetirialWoInfoSubmit
+                                );
+                            } else {
+                                // 固定审批人弹窗
+                                if (this.userListOpt.length == 1) {
+                                    this.cMkAdvMetirialWoInfoSubmit.nextOpNo = this.userListOpt[0].loginNoStr;
+                                    this.cMkAdvMetirialWoInfoSubmit.nextOpName = this.userListOpt[0].loginNameStr;
+                                    this.fixedDialogStatus = false;
+
+                                    // console.log(this.cMkAdvMetirialWoInfoSubmit);
+                                    this.submitInfo(
+                                        "/market/cadvBusiMetirialWo/submitWo",
+                                        this.cMkAdvMetirialWoInfoSubmit
+                                    );
+                                    // userListSingle = "";
+                                    this.approvalinfolist.opinionradio = "1";
+                                    this.approvalinfolist.opinion = "";
+                                }else{
+                                    this.fixedDialogStatus = true;
+                                }
+                            }
+                        }
+                    } else {
+                        this.checkexa = false;
+                        this.fixedDialogStatus = false;
+
+                        console.log(this.cMkAdvMetirialWoInfoSubmit);
+                        this.submitInfo(
+                            "/market/cadvBusiMetirialWo/submitWo",
+                            this.cMkAdvMetirialWoInfoSubmit
+                        );
+                    }
                 }
-                // this.checkexa = true;
-                // console.log(param);
             } else if (v === 2) {
                 this.approvalStepDialogStatus = false;
             } else if (v === 3) {
@@ -807,19 +1046,41 @@ export default {
                 // this.multipleSelection.supplierCode = supplierChoose[0].code;
                 // console.log(this.multipleSelection);
             } else if (v === 5) {
+<<<<<<< HEAD
+                this.cWoInfoIssued.nextOpNo = this.treeListonly.leaderAuditNo;
+                this.cWoInfoIssued.nextOpName = this.treeListonly.leaderAuditName;
+                this.cWoInfoIssued.woId = this.params.woId;
+                this.cWoInfoIssued.regionName = this.infolist.distributionChoose;
+                // console.log(this.cWoInfoIssued);
+                this.distributionDialogStatus = false;
+                this.submitInfo(
+                    "/market/cadvBusiMetirialWo/issued",
+                    this.cWoInfoIssued
+                );
+            } else if (v === 6) {
+=======
             }else if (v === 6) {
+>>>>>>> 3467b0ae790b859d7d683f21ae7570080f5a5210
                 let userListSingle = "";
                 userListSingle = this.userListOpt.filter(item => {
                     return item.loginNameStr == this.infolist.loginNameStr;
                 });
 
-                this.list.nextOpNo = userListSingle[0].loginNoStr;
-                this.list.nextOpName = userListSingle[0].loginNameStr;
+                this.cMkAdvMetirialWoInfoSubmit.nextOpNo =
+                    userListSingle[0].loginNoStr;
+                this.cMkAdvMetirialWoInfoSubmit.nextOpName =
+                    userListSingle[0].loginNameStr;
                 this.fixedDialogStatus = false;
+
+                console.log(this.cMkAdvMetirialWoInfoSubmit);
                 this.submitInfo(
                     "/market/cadvBusiMetirialWo/submitWo",
                     this.cMkAdvMetirialWoInfoSubmit
                 );
+                userListSingle = "";
+                this.approvalinfolist.opinionradio = "1";
+                this.approvalinfolist.opinion = "";
+                // console.log(this.cMkAdvMetirialWoInfoSubmit);
             } else if (v === 7) {
                 this.cMkAdvMetirialWoInfoSubmit.nextOpNo = this.treeListonly.leaderAuditNo;
                 this.cMkAdvMetirialWoInfoSubmit.nextOpName = this.treeListonly.leaderAuditName;
@@ -829,10 +1090,15 @@ export default {
                     "/market/cadvBusiMetirialWo/submitWo",
                     this.cMkAdvMetirialWoInfoSubmit
                 );
+                this.treeListonly = {};
+                this.approvalinfolist.opinionradio = "1";
+                this.approvalinfolist.opinion = "";
             }
         },
         submitInfo(u, v) {
             let _this = this;
+            // this.loading = true;
+            let loadingInstance = Loading.service()
             this.$http({
                 url: u,
                 method: "post",
@@ -841,18 +1107,34 @@ export default {
                 },
                 data: v
             }).then(res => {
+                loadingInstance.close()
                 if (res.data.result === 1) {
                     _this.$message({
                         message: res.data.desc,
                         type: "error"
                     });
+                }
+                if (res.data.result === 2) {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: "error"
+                    });
                 } else {
                     _this.$message({
                         message: "成功",
                         type: "success"
                     });
+
+
+                    if (this.tableData.length == this.multipleSelection.length) {
+                        this.$router.push("/materialApplication")
+                    }
+                    this.treeListonly = {}
+                    this.infolist.distributionChoose = "";
                     _this.getList(this.params, this.pageSize);
                 }
+                // this.loading = false;
+
             });
         },
         closeMessage(v) {
@@ -911,7 +1193,6 @@ export default {
     },
     mounted() {
         if (JSON.stringify(this.$route.query) != "{}") {
-            // console.log(this.$route.query.id);
             this.params.woId = this.$route.query.id;
         }
         this.getList(this.params, 1);

File diff suppressed because it is too large
+ 312 - 317
src/pages/main/advertising/materialApplicationadd.vue


File diff suppressed because it is too large
+ 989 - 575
src/pages/main/advertising/materiel.vue


+ 93 - 48
src/pages/main/advertising/supplier.vue

@@ -3,7 +3,7 @@
         <div class="container-box">
             <toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
             <div class="search">
-                <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
+                <!-- <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch> -->
                 <el-button class="btn-check" size="medium" type="primary" @click="dialogCheck(3)">添加
                 </el-button>
             </div>
@@ -19,11 +19,14 @@
                     </el-table-column>
                     <el-table-column prop="frameContractNo" label="合同编号">
                     </el-table-column>
- 
 					<el-table-column prop="cost" label="框架总额">
                     </el-table-column>
-					<el-table-column prop="buyTypeName" label="采购类型">
+                    <el-table-column prop="lastCost" label="框架剩余总额">
+                    </el-table-column>
+                    <el-table-column prop="schedule" label="框架总额进度">
 					</el-table-column>
+					<!-- <el-table-column prop="buyTypeName" label="采购类型">
+					</el-table-column> -->
 					<el-table-column prop="contractEndTime" label="截止时间">
 					</el-table-column>
                     <el-table-column label="操作" width="160px" align="center">
@@ -58,6 +61,14 @@
 						    <span>框架总额</span>
 						    <el-input v-model="infolist.cost" placeholder="框架总额" :disabled="disableStatus"></el-input>
 						</el-form-item>
+                        <el-form-item prop="lastCost">
+						    <span>剩余总额</span>
+						    <el-input v-model="infolist.lastCost" placeholder="剩余总额" :disabled="disableStatus"></el-input>
+						</el-form-item>
+                        <el-form-item prop="schedule">
+						    <span>总额进度</span>
+						    <el-input v-model="infolist.schedule" placeholder="总额进度" disabled></el-input>
+						</el-form-item>
 						<el-form-item prop="frameContractName">
 						    <span>合同名称</span>
 						    <el-input v-model="infolist.frameContractName" placeholder="合同名称" :disabled="disableStatus"></el-input>
@@ -76,7 +87,7 @@
 						    <el-date-picker v-model="infolist.contractEndTime" type="date" placeholder="截止时间">
 						    </el-date-picker>
 						</el-form-item>
-						<el-form-item prop="type">
+						<!-- <el-form-item prop="type">
 						    <span>采购类型</span>
 						    <el-select :disabled="disableStatus" :popper-append-to-body="false"
 						    	v-model="infolist.buyTypeName" placeholder="采购类型">
@@ -84,7 +95,7 @@
 						    		:value="item.name">
 						    	</el-option>
 						    </el-select>
-						</el-form-item>
+						</el-form-item> -->
                     </div>
                 </el-form>
 
@@ -101,13 +112,13 @@
 
 </template>
 <script>
-    import mySearch from "../../../components/search.vue";
+    //import mySearch from "../../../components/search.vue";
     import myMessage from "../../../components/myMessage.vue"
     import toolList from '../../../components/toolList'
 
     export default {
         components: {
-            mySearch,
+            //mySearch,
             myMessage,
             toolList
         },
@@ -119,20 +130,34 @@
                     callback()
                 }
             }
-            const buyTypeName = (rule, value, callback) => {
-                if (!this.infolist.buyTypeName) {
+            // const buyTypeName = (rule, value, callback) => {
+            //     if (!this.infolist.buyTypeName) {
+            //         callback(new Error('不能为空'))
+            //     } else {
+            //         callback()
+            //     }
+            // }
+			const cost = (rule, value, callback) => {
+                if (!this.infolist.cost) {
                     callback(new Error('不能为空'))
                 } else {
                     callback()
                 }
             }
-			const cost = (rule, value, callback) => {
-                if (!this.infolist.cost) {
+            const lastCost = (rule, value, callback) => {
+                if (!this.infolist.lastCost) {
                     callback(new Error('不能为空'))
                 } else {
                     callback()
                 }
             }
+            // const schedule = (rule, value, callback) => {
+            //     if (!this.infolist.schedule) {
+            //         callback(new Error('不能为空'))
+            //     } else {
+            //         callback()
+            //     }
+            // }
             const frameContractName = (rule, value, callback) => {
                 if (!this.infolist.frameContractName) {
                     callback(new Error('不能为空'))
@@ -173,6 +198,16 @@
                         trigger: 'blur',
                         validator: cost
                     }],
+                    lastCost: [{
+                        required: true,
+                        trigger: 'blur',
+                        validator: lastCost
+                    }],
+                    // schedule: [{
+                    //     required: true,
+                    //     trigger: 'blur',
+                    //     validator: schedule
+                    // }],
 					frameContractName: [{
                         required: true,
                         trigger: 'blur',
@@ -193,35 +228,35 @@
                         trigger: 'change',
                         validator: contractEndTime
                     }],
-                    buyTypeName: [{
-                        required: true,
-                        trigger: 'change',
-                        validator: buyTypeName
-                    }],
+                    // buyTypeName: [{
+                    //     required: true,
+                    //     trigger: 'change',
+                    //     validator: buyTypeName
+                    // }],
                 },
-                searchList: [
-                    {
-                        type: 'input',
-                        tit: '供应商名称',
-                        value: '',
-                        width: '48%',
-                    },{
-                        type: 'sel',
-                        tit: '采购类型',
-                        value: '',
-                        width: '48%',
-						options:[
-							{
-								dataCode:'1',
-								dataName:'一采'
-							},
-							{
-								dataCode:'2',
-								dataName:'二采'
-							}
-						]
-                    }
-                ],
+                // searchList: [
+                //     {
+                //         type: 'input',
+                //         tit: '供应商名称',
+                //         value: '',
+                //         width: '48%',
+                //     },{
+                //         type: 'sel',
+                //         tit: '采购类型',
+                //         value: '',
+                //         width: '48%',
+				// 		options:[
+				// 			{
+				// 				dataCode:'1',
+				// 				dataName:'一采'
+				// 			},
+				// 			{
+				// 				dataCode:'2',
+				// 				dataName:'二采'
+				// 			}
+				// 		]
+                //     }
+                // ],
                 tooltit:'供应商管理',
                 fullscreen: false,
                 total: 0,
@@ -265,13 +300,14 @@
                 this.infolist = {};
                 this.dialogStatus = false;
             },
-            //搜索数据
-            searchInfo(v) {
-                this.params = {};
-                v[0] ? this.params.name = v[0] : '';
-                v[1] ? this.params.buyTypeCode = v[1] : '';
-                this.getList(this.params, this.pageSize);
-            },
+            // //搜索数据
+            // searchInfo(v) {
+            //     this.params = {};
+            //     v[0] ? this.params.name = v[0] : '';
+            //     v[1] ? this.params.buyTypeCode = v[1] : '';
+            //     this.getList(this.params, this.pageSize);
+            // },
+            
             //获取列表
             getList(v, n) {
                 this.pageSize = n;
@@ -287,6 +323,7 @@
                     },
                     data: v,
                 }).then((res) => {
+                    console.log(res.data.data);
                     this.tableData = res.data.data;
                     this.total = res.data.totalRecord;
                     this.loading = false;
@@ -322,7 +359,7 @@
                     this.dialogStatus = false;
                     return
                 } else {
-					this.infolist.buyTypeCode = this.infolist.buyTypeName == '一采'?'1':'2';
+					// this.infolist.buyTypeCode = this.infolist.buyTypeName == '一采'?'1':'2';
                     this.infolist.opTime = this.$formatDate(new Date(), "YYYY-MM-DD");
                     this.infolist.contractSignTime = this.infolist.contractSignTime?this.$formatDate(this.infolist.contractSignTime, "YYYY-MM-DD"):'';
                     this.infolist.contractEndTime = this.infolist.contractEndTime?this.$formatDate(this.infolist.contractEndTime, "YYYY-MM-DD"):'';
@@ -352,7 +389,12 @@
                                     message: res.data.desc,
                                     type: 'error'
                                 });
-                            } else {
+                            } else if(res.data.result === -1){
+                                _this.$message({
+                                    message: res.data.desc,
+                                    type: 'fail'
+                                });
+                            }else {
                                 _this.$message({
                                     message: '成功',
                                     type: 'success'
@@ -498,4 +540,7 @@
             width: calc(100% - 100px);
         }
     }
+    .container .search{
+        justify-content: flex-end
+    }
 </style>