瀏覽代碼

Merge branch 'bing-shangxuan' into 'master'

Bing shangxuan

See merge request spfm/spfm-market-front!473
杨壁繁 2 年之前
父節點
當前提交
1c38b777b5

+ 179 - 0
src/components/el-formfour.vue

@@ -0,0 +1,179 @@
+<template>
+  <div>
+    <slot :name="list.name"></slot>
+    <el-table
+      ref="table"
+      style="width: 100%"
+      :data="list.data"
+      :height="list.height + 'px'"
+      :max-height="list.height + 'px'"
+      @row-click="getRowData"
+      @selection-change="selectionChange"
+      empty-text="暂无数据"
+      @cell-click="getRowList"
+      :cell-style="columnbackgroundStyle"
+      row-key="id"
+      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+    >
+      <!-- 是否多选 -->
+      <el-table-column
+        v-if="list.isSelection"
+        :selecttable="list"
+        type="selection"
+        :width="list.width || 50"
+        align="center"
+      />
+
+      <!-- 是否需要序号 -->
+      <el-table-column
+        v-if="list.isIndex"
+        type="index"
+        label="序号"
+        width="55"
+        align="center"
+      />
+      <template v-for="item in list.titledata">
+        <el-table-column
+          :key="item.prop"
+          :prop="item.prop"
+          :label="item.label"
+          align="center"
+          show-overflow-tooltip
+          :width="item.width || 100"
+        />
+      </template>
+      <!-- 操作列 -->
+      <el-table-column
+        v-if="list.isOperation"
+        v-bind="list.data && list.data.length ? { fixed: 'right' } : null"
+        style="margin-right: 20px"
+        class-name="handle-td"
+        label-class-name="tc"
+        :label="list.operation.label"
+        align="center"
+      >
+        <!-- UI统一一排放3个,4个以上出现更多 -->
+        <template slot-scope="scope">
+          <!-- 三个一排的情况,去掉隐藏的按钮后的长度 -->
+          <template v-if="list.operation.data.length > 0">
+            <div class="btn">
+              <div v-for="item in list.operation.data" :key="item.label">
+                <template v-if="item.type !== 'icon'">
+                  <el-button
+                    v-bind="item"
+                    :type="item.type ? item.type : ''"
+                    size="mini"
+                    @click.native.prevent="
+                      item.handleRow(scope.$index, scope.row, item.label)
+                    "
+                  >
+                    {{ item.label }}
+                  </el-button>
+                </template>
+                <template v-else>
+                  <i
+                    :class="[icon, item.icon]"
+                    v-bind="item"
+                    @click="item.handleRow(scope.$index, scope.row, item.label)"
+                  />
+                </template>
+              </div>
+            </div>
+          </template>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="page">
+      <el-pagination
+        style="display: flex; flex-direction: row-reverse"
+        v-if="list.pageData.total > 0"
+        :current-page.sync="page"
+        :page-sizes="
+          list.pageData.pageSizes ? list.pageData.pageSizes : [5, 10, 15, 20]
+        "
+        :page-size="list.pageData.pageSize"
+        layout="total,  prev, pager, next, jumper"
+        :total="list.pageData.total"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data(){
+    return{
+     page:1
+    }
+  },
+  props: {
+    //  表格数据和表格部分属性的对象
+    // eslint-disable-next-line vue/require-default-prop
+    list: {
+      type: Object,
+    },
+  },
+  created() {
+
+  },
+  methods: {
+    // columnbackgroundStyle({ row, column, rowIndex, columnIndex }) {
+    //   if (column.type == "default") {
+    //     if (column.label === "文件标题") {
+    //       return "color:#0682CD;";
+    //     }
+    //   }
+    // },
+    columnbackgroundStyle({ row, column, rowIndex, columnIndex }) {
+      if (column.type == "default") {
+        if (column.type == "default") {
+        // if (column.property === "need_name"||column.property === "needName"||column.property === "doc_title"||column.property === "document_title") {
+        //   return "color:#0682CD;";
+        // }
+        if(columnIndex == 0){
+               return "color:#0682CD;";
+             
+            }
+      }
+      
+      }
+    },
+    selectionChange(val) {
+
+      //多选数字回调
+      this.$emit("num", val);
+    },
+    handleAdd(name) {
+     
+      this.$emit("toolMsg", name);
+    },
+    handleRow(index, row, lable) {
+     
+    },
+    handleSizeChange(val) {
+      this.$emit("changeSize", val);
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      this.$emit("changeNum", val);
+      console.log(`当前页: ${val}`);
+    },
+    // 点击行即可选中
+    getRowData(row) {
+      this.$refs.table.toggleRowSelection(row);
+    },
+    getRowList(row, column, event, cell) {
+      this.$emit("clickDemand", column.label, row);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.btn{
+  display: flex;
+  justify-content: center;
+}
+</style>

+ 10 - 11
src/components/workflowBasexcwls.vue

@@ -355,7 +355,7 @@ export default {
       });
     },
     async nextWork(list) {
-      console.log(list);
+  
       //e:yes||no,list:传入数组,title:结束标签,res:驳回标签,id:工单更新id
       let _this = this;
       let obj = {
@@ -374,7 +374,7 @@ export default {
       }
       await this.common.httpPost(obj, success);
       function success(data) {
-        console.log(data);
+     
         if (data != null) {
           if (_this.TransferStatus === true) {
             let list = {
@@ -422,15 +422,14 @@ export default {
         },
         data: e,
       }).then((res) => {
-        console.log(res.data.body[0].resourceId);
+     
         this.list.resourceId = res.data.body[0].resourceId;
         this.$emit("updateForm", true);
       });
     },
     //查询路径接口
     getNextPath(e, status) {
-      console.log(e);
-      console.log(this.requestForm);
+     
       let { fresourceId, processDefinitionKey } = this.requestForm;
       let list = {
         fresourceId: fresourceId,
@@ -445,7 +444,7 @@ export default {
         },
         data: list,
       }).then((res) => {
-        console.log(res.data.body);
+       
         if (status === 1) {
           //第一次进入取路径
           this.initialList = res.data.body;
@@ -485,7 +484,7 @@ export default {
           if (res.data.body.nextShapes[0].condition !== null) {
             this.node = res.data.body;
           } else {
-            console.log(res.data.body.nextShapes[0].resourceId);
+          
             this.getNextPath(res.data.body.nextShapes[0].resourceId, 2);
           }
         }
@@ -512,7 +511,7 @@ export default {
         e.nextShapes[0].properties.documentation === createdId
           ? this.list.createId
           : e.nextShapes[0].properties.documentation;
-      console.log(id);
+     
       this.$http({
         url: "/market/api/user/info/queryNodePers?params=" + id,
         method: "post",
@@ -521,14 +520,14 @@ export default {
         },
         data: "",
       }).then((res) => {
-        console.log(status);
+      
         if (status === 2) {
           this.treeCopyList = res.data; //抄送
           //  this.$refs.defTrees.treeList = res.data;
         } else {
           this.treeList = res.data; //抄送
           // this.$refs.defTree.treeList = res.data;
-          console.log(this.treeList);
+          // console.log(this.treeList);
         }
       });
     },
@@ -600,7 +599,7 @@ export default {
           dictCodePks: "approval",
         },
       }).then((res) => {
-        console.log(res);
+     
         this.commonlyList = res.data;
       });
     },

+ 12 - 0
src/config/dev.js

@@ -4,9 +4,12 @@ let devs = {
     BASE_URL: "http://43.138.50.94:9600/", //本地环境
     BASE_API: "http://43.138.50.94:8880/api",//工作流本地环境
     EXCEL_URL: "http://43.138.50.94:7777", //本地excel路径
+    OFFICE_URL:'http://43.138.50.94:7779',  //在线office路径
     provincialWorkOrderAreafresourceId: 'a682dc9f-2fea-11ed-a6ed-02427ba2d388',//通用工单地市
     provincialWorkOrderfresourceId: '08368848-2fde-11ed-a6ed-02427ba2d388',//通用工单省
     riskMaterialsfresourceId: 'c9104902-6575-11ed-8e1e-d6cd97160e00',//风险防控
+    materialApplicationfresourceId:'6cc2a037-a750-11ed-886f-d6cd97160e00',//宣传物料省
+    materialApplicationdsfresourceId:'241efa62-a816-11ed-886f-d6cd97160e00',//宣传物料地市
     accountApplicationfresourceId: 'b3e6cc47-b1a9-11ed-886f-d6cd97160e00',//账号申请流程
     accountdelfresourceId: '6a5fc7b5-b290-11ed-886f-d6cd97160e00',//账号删除
     accountPermissionsfresourceId: '14c60ff0-b1a8-11ed-886f-d6cd97160e00',//账号权限申请流程
@@ -31,12 +34,15 @@ let devs = {
 }
 let dev = {
     TITLE: '本地环境',
+    OFFICE_URL:'http://43.138.50.94:7779',  //在线office路径
     BASE_URL: "http://127.0.0.1:8080", //本地环境
     BASE_API: "http://43.138.50.94:8880/api",//工作流本地环境
     EXCEL_URL: "http://43.138.50.94:7777", //本地excel路径
     provincialWorkOrderAreafresourceId: 'a682dc9f-2fea-11ed-a6ed-02427ba2d388',//通用工单地市
     provincialWorkOrderfresourceId: '08368848-2fde-11ed-a6ed-02427ba2d388',//通用工单省
     riskMaterialsfresourceId: 'c9104902-6575-11ed-8e1e-d6cd97160e00',//风险防控
+    materialApplicationfresourceId:'6cc2a037-a750-11ed-886f-d6cd97160e00',//宣传物料省
+    materialApplicationdsfresourceId:'241efa62-a816-11ed-886f-d6cd97160e00',//宣传物料地市
     accountApplicationfresourceId: 'b3e6cc47-b1a9-11ed-886f-d6cd97160e00',//账号申请流程
     accountdelfresourceId: '6a5fc7b5-b290-11ed-886f-d6cd97160e00',//账号删除
     accountPermissionsfresourceId: '14c60ff0-b1a8-11ed-886f-d6cd97160e00',//账号权限申请流程
@@ -61,12 +67,15 @@ let dev = {
 }
 let test = {
     TITLE: '测试环境',
+    OFFICE_URL:'http://10.149.85.91:8000',  //在线office路径
     BASE_URL: "http://10.149.85.91:8000/spfm", //测试环境
     BASE_API: "http://10.149.85.91:8000/api",//工作流测试环境
     EXCEL_URL: "http://10.149.85.91:7777", //测试excel路径
     provincialWorkOrderAreafresourceId: '33b0af93-b1ce-11ed-be6b-00505687dcd3',//通用工单地市
     provincialWorkOrderfresourceId: '4fdbb96e-8bfd-11ed-8988-00505687dcd3',//通用工单省
     riskMaterialsfresourceId: '3124a2d4-7209-11ed-8d6f-00505687dcd3',//风险防控
+    materialApplicationfresourceId:'8f0e9c49-b348-11ed-be6b-00505687dcd3',//宣传物料省
+    materialApplicationdsfresourceId:'a7f127b7-b348-11ed-be6b-00505687dcd3',//宣传物料地市
     accountApplicationfresourceId: '9acf34bf-b24d-11ed-be6b-00505687dcd3',//账号申请流程
     accountdelfresourceId: 'e907b062-b33f-11ed-be6b-00505687dcd3',//账号删除
     accountPermissionsfresourceId: '2b9e648d-b24d-11ed-be6b-00505687dcd3',//账号权限申请流程
@@ -91,12 +100,15 @@ let test = {
 }
 let prod = {
     TITLE: '线上环境',
+    OFFICE_URL:'http://10.230.26.15:8000',  //在线office路径
     BASE_URL: "http://10.230.26.15:8000/mkt", //线上环境
     BASE_API: "http://10.230.26.15:8000/api",//工作流线上环境
     EXCEL_URL: "http://10.230.26.15:7777", //线上excel路径
     provincialWorkOrderAreafresourceId: 'db26384e-b984-11ed-afb6-e00084564cce',//通用工单地市
     provincialWorkOrderfresourceId: '9b83efc7-b984-11ed-afb6-e00084564cce',//通用工单省
     riskMaterialsfresourceId: 'canvas',//风险防控
+    materialApplicationfresourceId:'b58e5e25-ce13-11ed-afb6-e00084564cce',//宣传物料省
+    materialApplicationdsfresourceId:'cd072057-ce13-11ed-afb6-e00084564cce',//宣传物料地市
     authoriZation: 'a4c88c4e-d99e-11ed-8255-e00084564cce',//口令授权
     backupRequire: 'b5c62d50-d99d-11ed-8255-e00084564cce',//备份需求
     emergencyPlan: '8bcdfa43-d9a0-11ed-8255-e00084564cce',//应急预案

+ 2 - 2
src/pages/main/advertising/index.vue

@@ -21,11 +21,11 @@
 			<div class="adv-type">
 				 <div class="wfour" @click="jumpinfo('/materialApplication','宣传物料申请及审批-省代地市下单')">
 			        <span><i class="el-icon-folder-opened"></i></span>
-			        <span>宣传物料申请及审批-省代地市下单</span>
+			        <span>宣传物料申请及审批-省公司发起</span>
 			    </div>
 				 <div class="wfour" @click="jumpinfo('/materialApplicationds','宣传物料申请及审批-地市下单')">
 			        <span><i class="el-icon-folder-opened"></i></span>
-			        <span>宣传物料申请及审批-地市下单</span>
+			        <span>宣传物料申请及审批-地市发起</span>
 			    </div>
 				<!-- <div class="wfour" @click="jumpinfo('/materialApplicationc','市级物料申请')">
 				        <span><i class="el-icon-folder-opened"></i></span>

+ 138 - 143
src/pages/main/advertising/materialApplication.vue

@@ -25,6 +25,7 @@
                     ref="TableList"
                     @clickDemand="clickDemand"
                     @changeNum="changeNum"
+                    @changeSize="changeSize"
                 ></tableList>
             </div>
             <div class="tabbox" v-if="this.childname == 'three'">
@@ -53,12 +54,12 @@
                             <!-- <el-table-column label="结算金额" prop="replyContent"></el-table-column> -->
                             <el-table-column label="麦穗" prop="gys1Price"></el-table-column>
                             <el-table-column label="神笔" prop="gys2Price"></el-table-column>
-                            <el-table-column label="状态" prop="taskName"></el-table-column>
+                            <el-table-column label="状态" prop="taskname"></el-table-column>
                             <el-table-column label="操作"  fixed="right" align="center">
                                 <template slot-scope="scope">
-                                    <el-button size="mini" type="text" @click="getinform(scope.row)" v-if="scope.row.taskName == null">
+                                    <el-button size="mini" type="text" @click="getinform(scope.row)" v-if="scope.row.taskname == null || scope.row.taskname == '起草'">
                                         任务下发</el-button>
-                                    <el-button size="mini" type="text" @click="chakanfaqi(scope.row)" v-if="scope.row.taskName != null">
+                                    <el-button size="mini" type="text" @click="chakanfaqi(scope.row)" v-if="scope.row.taskname != null && scope.row.taskname != '起草'">
                                         查看</el-button>
                                 </template>
                                  <!-- <template slot-scope="scope">
@@ -100,6 +101,7 @@
         <el-dialog
         title="处理操作"
         :visible.sync="dialogVisible1"
+        v-if="dialogVisible1"
         :before-close="handleCloses"
         width="100%"
         height="100vh"
@@ -137,6 +139,7 @@
         class="dialogClass"
         top="0"
         :modal="false"
+        :show-close="false"
         :modal-append-to-body="true"
       >
         <span class="dialog-body">
@@ -205,7 +208,7 @@
             </el-col>
             <el-col :span="8" style="width: 410px">
              <el-form-item prop="gys" label="供应商">
-            <!-- <span>供应商</span> -->
+            <!-- <span>供应商</span>省公司宣传负责人 -->
             <el-select
                @change="gysMing(1, $event)"
               clearable
@@ -307,7 +310,7 @@
                       </div>
                     </template> -->
                   </el-table-column>
-                   <el-table-column label="操作"  fixed="right" align="center" v-if="this.infolist.tabletaskName == '起草'">
+                   <el-table-column label="操作"  fixed="right" align="center" v-if="this.infolist.tabletaskName == '起草' || this.infolist.tabletaskName == '地市宣传负责人'">
                                 <template slot-scope="scope">
                                     <el-button size="mini" type="text" @click="updatexiuform(scope.row)"  :disabled="xiugaizhuan">
                                         修改</el-button>
@@ -401,7 +404,8 @@
       width="50%"
       :destroy-on-close="true"
       :modal-append-to-body="false"
-      :close-on-click-modal="false"
+      
+      :show-close="false"
       :before-close="closedia"
     >
       <el-form
@@ -418,6 +422,7 @@
               clearable
               v-model="rulelist.useCase"
               placeholder="使用场景"
+              disabled
             >
               <el-option
                 v-for="(items, index) in useCaseopt"
@@ -432,6 +437,7 @@
             <el-select
               v-model="rulelist.formType"
               placeholder="请选择表单类型"
+              disabled
             >
               <el-option
                 v-for="(item, index) in optionList"
@@ -447,6 +453,7 @@
               clearable
               v-model="rulelist.material"
               placeholder="物料名称"
+              disabled
             >
               <el-option
                 v-for="(items, index) in metirialOpt"
@@ -462,6 +469,7 @@
                         v-model="rulelist.quantity"
                         placeholder="数量"
                         type="number"
+                        oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"
                         style="width:256px"
                         >
             </el-input>
@@ -483,7 +491,7 @@
       <div class="t-footer">
         <!--  -->
         <el-button type="primary" @click="gengxinge">确 定</el-button>
-        <el-button @click="closediaform">取 消</el-button>
+        <!-- <el-button @click="closediaform">取 消</el-button> -->
       </div>
     </el-dialog>
         <el-dialog
@@ -532,9 +540,10 @@
     import mySearch from "../../../components/search.vue";
     import myMessage from "../../../components/myMessage.vue"
     import toolList from '../../../components/toolList'
-	import myUpload from '../../../components/upload'
-    import tableList from "../../../components/el-form";
+	  import myUpload from '../../../components/uploadfour'
+    import tableList from "../../../components/el-formfour";
     import Workflow from "../../../components/workflowBase";
+    import getConfig from '../../../config/dev.js'
 // import Workflow from "../../../components/workflow";
     // import WorkflowEntrance from "../../../components/workflowEntrance";
    import {
@@ -547,7 +556,7 @@
             mySearch,
             myMessage,
             toolList,
-			myUpload,
+			      myUpload,
             eltabs,
             tableList,
             Workflow,
@@ -570,7 +579,7 @@
             // }
             return {
                   requestForm: {
-                    fresourceId: "6cc2a037-a750-11ed-886f-d6cd97160e00",
+                    fresourceId: getConfig().materialApplicationfresourceId,
                     processDefinitionKey: "xcwl_pro_process",
                     taskId:"",
                     },
@@ -691,7 +700,7 @@
           },
            {
             label: "状态",
-            prop: "taskName",
+            prop: "taskname",
             width: 200,
           },
         ], //表格头
@@ -723,9 +732,7 @@
                             label: "任务下发", // 操作名称
                             type: "", //按钮类型
                             handleRow: function (e, r, o) {
-                                console.log(e);
-                                console.log(r);
-                                console.log(o);
+                               
                                 // getinform
                                 // this.getinform(r);
                             }, // 自定义事件
@@ -815,7 +822,7 @@
           },
            {
             label: "状态",
-            prop: "taskName",
+            prop: "taskname",
             width: 200,
           },
         ], //表格头
@@ -847,9 +854,7 @@
                             label: "任务下发", // 操作名称
                             type: "", //按钮类型
                             handleRow: function (e, r, o) {
-                                console.log(e);
-                                console.log(r);
-                                console.log(o);
+                             
                                 // getinform
                                 // this.getinform(r);
                             }, // 自定义事件
@@ -1010,7 +1015,7 @@
                 updisabled:false,
 				fileInfo: {
 				    limit: 10,
-				    url: '/market/waf/upload',
+				    url: '/market/waf/uploadByMinio',
 				    fileList: []
 				},
 				infoApply:{},
@@ -1033,8 +1038,7 @@
         watch:{
           'infolist.tabletaskName':{
           handler(newVal,oldVal){
-            // console.log(this.ruleForm);
-            console.log(newVal);
+           
             let rule1 = {
              gys: [
                 { required: true, validator: this.validatorFile , trigger: "blur" },
@@ -1047,12 +1051,12 @@
                 { required: true, validator: this.validatorLianjie , trigger: "blur" },],
             }
             if(newVal === '省公司宣传负责人'){
-              console.log(121);
+        
               this.rules = { ...this.rules, ...rule1 }
-              console.log(111);
+           
               }
               else if(newVal === '区县公司负责人'){
-                console.log(1234);
+             
                this.rules = { ...this.rules, ...rule2 }
               }
           },
@@ -1061,15 +1065,14 @@
           },
           //  'infolist.tabletaskName':{
           // handler(newVal,oldVal){
-          //   // console.log(this.ruleForm);
-          //   // console.log(newVal);
+        
           //   let rule2 = {
           //    districtScore: [
           //       { required: true, validator: this.validatorDafen , trigger: "blur" },],
           //     materialUrl: [
           //       { required: true, validator: this.validatorLianjie , trigger: "blur" },],
           //   }
-          //   if(newVal === '市公司主管宣传副主任'){
+          //   if(newVal === '省公司宣传负责人'){
           //     this.rules = { ...this.rules, ...rule }
           //     }
           // },
@@ -1079,7 +1082,7 @@
         },
         methods: {
             clickTabs(name){
-                console.log(name);
+             
                 this.pageNo = "1";
                 this.page = "1";
                 this.childname = name;
@@ -1097,8 +1100,27 @@
               changeNum(val) {
                 this.page = val;
                 this.pageNo = val;
-                console.log(this.page);
-                console.log(this.childname);
+             
+                switch (this.childname) {
+                    case "first":
+                    this.getTodoList();
+                    // this.iniTiate();
+
+                    break;
+                    case "two":
+                        this.haveDone();
+
+                    break;
+                    case "three":
+
+                    // this.iniTiate();
+                    // this.Table = this.thirdTable;
+                }
+                },
+                  changeSize(val) {
+                this.size = val;
+                this.pageSize = val;
+              
                 switch (this.childname) {
                     case "first":
                     this.getTodoList();
@@ -1116,7 +1138,7 @@
                 }
                 },
                   clickDemand(e, r) {
-      //  console.log(e,r);
+    
       if (e === "业务名称") {
         if(this.childname == "first"){
           
@@ -1153,7 +1175,12 @@
     chakanfaqi(r){
 
         this.operationZuo(r); //点标题
-         this.deal = false;
+         
+         if(r.taskname == "起草" || r.taskname == "地市宣传负责人"){
+          this.deal = true;
+         }else{
+          this.deal = false;
+         }
          this.baocun = false;
         this.clickForm1(r)
     },
@@ -1162,10 +1189,10 @@
     // },
       //点击标题
          operationZuo(r){
-          console.log(r);
+      
           let list = {}
           list.id = r.id,
-          // console.log(row)
+        
           this.$http({
             url:"/market/xcwlProcess/query",
             method:"post",
@@ -1187,18 +1214,19 @@
             this.infolist.taskId = r.taskId;
             this.infolist.id = r.id;
             this.infolist.createId = r.createId;
-            this.infolist.tabletaskName = r.taskName;
-            // console.log(this.infolist.tabletaskname);
+            this.infolist.tabletaskName = r.taskname;
+          
             this.infolist.gys = res.data.xcwlProProcessList[0].selectedGys;
             this.infolist.districtScore = res.data.xcwlProProcessList[0].districtScore;
             this.infolist.materialUrl = res.data.xcwlProProcessList[0].materialUrl;
-            if(r.taskName != "起草"){
+            this.infolist.id1 = res.data.xcwlProProcessList[0].xcwlId;
+            if(r.taskName != "起草" ||r.taskName != "地市宣传负责人"){
               this.disableStatus = true;
                this.updisabled = true;  //上传附件
             }else{
               this.updisabled = false;
             }
-             if(this.infolist.tabletaskName === "起草" || this.infolist.tabletaskName === "省公司宣传负责人" || this.infolist.tabletaskName === "区县公司负责人"){
+             if(this.infolist.tabletaskName === "起草" || this.infolist.tabletaskName === "省公司宣传负责人" || this.infolist.tabletaskName === "区县公司负责人" ||this.infolist.tabletaskName === "地市宣传负责人"){
             
             this.baocun = true;
             
@@ -1213,9 +1241,9 @@
                     },
                     data:{},
                   }).then((res) => {
-                  // console.log(res.data);
+              
                   this.gysopt = res.data;
-                  // console.log( this.infolist.gysopt);
+                
                     // this.infomaterType = res.data;
                     // if(res.data){
                     //  this.typests = false;
@@ -1226,24 +1254,24 @@
         },
          uploadBack(v) {
           this.attList = v;
-          console.log(this.attList);
+          // console.log(this.attList);
 
     },
     gysMing(n,ev){
         let that = this;
-            // console.log(that);
+        
             let hh = that.gysopt.filter(function (c, i, a) {
-              // console.log(c,i,a);
+            
            if (c.name == that.infolist.gys) {
           return c;
            }
           });
          this.selectLetter = hh[0].code;
-         console.log(this.selectLetter);
+        //  console.log(this.selectLetter);
     },
     dealwith(){
       if(this.infolist.tabletaskName == "省公司宣传负责人" || this.infolist.tabletaskName == "区县公司负责人"){
-       console.log(this.teshuhuanjie);
+     
        if(this.teshuhuanjie.length == 0){
            this.$message.error("请先点击保存");
         }else{
@@ -1255,7 +1283,7 @@
       
     },
     updatexiuform(r){
-      console.log(r);
+   
       this.typests = true;
       this.rulelist = r;
     },
@@ -1265,26 +1293,30 @@
     //更新表格
     gengxinge(){
        this.typests = false;
-        // this.$http({
-        //             url: "/market/xcwlProcess/update",
-        //             method: "post",
-        //             headers: {
-        //               "Content-Type": "application/json",
-        //             },
+         let rulelistform = {}
+         rulelistform.metirialName = this.rulelist.material;
+         rulelistform.quantity = this.rulelist.quantity;
+         rulelistform.ratio = this.rulelist.coefficient;
+        this.$http({
+                    url: "/market/xcwlProcessImport/getPriByMetirialName",
+                    method: "post",
+                    headers: {
+                      "Content-Type": "application/json",
+                    },
                   
-        //             data: this.rulelist,
-        //           }).then((res) => {
-        //           console.log(res.data);
-        //             // this.infomaterType = res.data;
-        //             if(res.data){
-        //              this.typests = false;
-        //               return;
-        //             }
-        //           });
+                    data: rulelistform,
+                  }).then((res) => {
+                
+
+                    this.infomaterType[0].gys1Price = res.data.body.gys1Price;
+                    this.infomaterType[0].gys2Price = res.data.body.gys2Price;
+
+                   
+                  });
     },
       validatorFile(rule,value,callback){
       if(this.infolist.gys == null){
-        // console.log(this.ruleForm.addJobNumber);
+       
         callback(new Error('请选择供应商'));
       }else{
         
@@ -1293,7 +1325,7 @@
     },
       validatorDafen(rule,value,callback){
       if(this.infolist.districtScore == null || ""){
-        console.log(this.infolist.districtScore);
+     
         callback(new Error('请输入区县打分'));
       }else{
         
@@ -1302,7 +1334,7 @@
     },
      validatorLianjie(rule,value,callback){
       if(this.infolist.materialUrl == null || ""){
-        console.log(this.infolist.materialUrl);
+     
         callback(new Error('请输入物料验证材料链接'));
       }else{
         
@@ -1311,38 +1343,14 @@
     },
     //任务下发
     getinform(r){
-      console.log(r);
+   
       this.infolist = r;
       this.infolist.id = r.id;
       this.request_form.businessKey = r.id;
       this.getUserIds();
-    //   console.log(this.request_form);
-    //   this.infolist.userId = this.request_form.userId;
-    //   this.infolist.userName = this.request_form.userName;
-    //   console.log(r);
-    //   this.clickHandle(r);
+   
     },
-       //获取userID
-    //   getUserIds() {
-    //     this.$http({
-    //     url: "/market/waf/queryRoleByName",
-    //     method: "post",
-    //     headers: {
-    //      "Content-Type": "application/json",
-    //     },
-    //      data: {
-    //       userCode: JSON.parse(window.sessionStorage.userInfo).loginNo,
-    //    },
-    //   }).then((res) => {
-    //     // console.log(res.data.data.rows[0].name);
-    //     // console.log(res.data.data.rows[0].userCode);
-    //     this.request_form.userName = res.data.data.rows[0].name;
-    //     this.request_form.userId = res.data.data.rows[0].userCode;
-    //     this.request_form.title = this.infolist.needName;
-    //     console.log(this.request_form);
-    //     this.clickHandle(this.infolist);
-    //    });
-    //  },
+    
         getUserIds() {
         let id = JSON.parse(window.sessionStorage.userInfo).loginNo
         this.$http({
@@ -1355,18 +1363,16 @@
           // params: JSON.parse(window.sessionStorage.userInfo).loginNo,
        },
       }).then((res) => {
-        // console.log(res.data.data.rows[0].name);
-        // console.log(res.data.data.rows[0].userCode);
-        // console.log(res.data[0].children);
+    
         this.request_form.userName = res.data[0].children[0].loginNameStr;
         this.request_form.userId = res.data[0].children[0].loginNoStr;
         this.request_form.title = '[市场工作台]-'+'省宣传物料申请及审批-'+ this.infolist.needName;
-        // console.log(this.request_form);
+      
         this.clickHandle(this.infolist);
        });
      },
      async clickHandle(e) {
-        console.log(this.request_form);
+    
       let _this = this;
       let obj = {
       url: this.$url.formList.startWork, //开始工作流接口
@@ -1379,12 +1385,7 @@
       
       let res = await this.common.httpPost(obj, success);
       function success(data) {
-        console.log(data);
-//         _this.ruleForm.taskId = _this.ruleForm.taskId;
-        // a = a 
-//         _this.taskId = data.data;
-      //  console.log(data);
-      //  console.log(data.code);
+     
       _this.infolist.processId = data.data;
        let list = {
          id: e.id,
@@ -1394,15 +1395,14 @@
           
           // resourceId: _this.nextPath.currentShape[0].resourceId,
        };
-        // console.log(processDefinitionKey);
-        console.log(list);
+        
          _this.setUpdate(list);
       }
      },
     //更新工作流接口
 
     setUpdate(e) {
-      console.log(e);
+  
       this.$http({
        url: "/market/waf/updateBase",
         method: "post",
@@ -1417,7 +1417,7 @@
     },
      //是否最后一个人
     async getLastName() {
-      console.log(this.infolist);
+   
       let list = {
         procinstid: this.infolist.processId,
         taskid: this.infolist.taskId,
@@ -1436,7 +1436,7 @@
 
       let res = await this.common.httpPost(obj, success);
       function success(data) {
-        console.log(data);
+      
         if (data.lastMan == true) {
           _this.adminResourceId = data.adminResourceId;
         }
@@ -1445,7 +1445,7 @@
         _this.isWorkflowStatus = data.lastMan == false ? false : true;
         _this.lastManList = data;
 
-        // console.log(_this.isWorkflowStatus);
+      
       }
     },
      getNextPath(e) {
@@ -1471,20 +1471,20 @@
         data: list,
       }).then((res) => {
         if (res.data.body.nextShapes[0].multi) {
-          console.log('这是mulit节点');
+          // console.log('这是mulit节点');
           if (res.data.body.nextShapes[0].multi.multi === "true") {
-             console.log('这是mulit节点');
+            //  console.log('这是mulit节点');
             this.getLastName();
           } else {
             this.adminResourceId = ''
-            console.log('这不是mulit节点');
+            // console.log('这不是mulit节点');
             this.destroy = true;
             this.dialogVisible1 = true;
             // this.getMetirialType();
           }
         } else {
           this.adminResourceId = ''
-          console.log('这不是mulit节点');
+          // console.log('这不是mulit节点');
           this.destroy = true;
           this.dialogVisible1 = true;
         //   this.getMetirialType();
@@ -1497,8 +1497,7 @@
     },
     //处理按钮,开始工作流接口
     clickHandles() {
-      //   console.log(this.infolist.resourceId);
-      // this.getNextPath(this.infolist.resourceId || "");
+     
       this.dialogVisible1 = true;
     },
       async clickForm(r) {
@@ -1555,33 +1554,32 @@
       this.dialogVisible1 = false;
       this.dialogVisible = false;
       this.getIssueList();
+      this.getTodoList();
+      this.haveDone();
     //   this.refreshbtn();
     },
-    //  changeNum(e) {
-    //         console.log(e)
-    //         this.pageNo = e;
-    //         this.page = e;
-    //         this.firstTable.pageData.pageNum = e;
-    //         this.getTodoList()
-    //     },
+    
             adminhandleSizeChange(val) {
-            console.log(`每页 ${val} 条`);
+            // console.log(`每页 ${val} 条`);
         },
          adminhandleCurrentChange(val) {
-            // console.log(e)
+         
             this.pageNo = val;
 
             this.getIssueList()
-            console.log(`当前页: ${val}`);
+            // console.log(`当前页: ${val}`);
         },
         handleCloses() {
           this.treeList = [];
           this.textarea = "";
           this.dialogVisible1 = false;
-
+          this.getTodoList();
+          this.haveDone();
+          this.getIssueList();
     },
     close(){
      this.dialogVisible = false;
+     this.tableData1 = [];
     },
     //我发起列表
        getIssueList(e) {
@@ -1648,7 +1646,7 @@
       //  this.twoTable.pageData.total = res.data.totalRecord;
       //   this.tabList[1].number = res.data.totalRecord;
       //   this.Table = this.twoTable;
-      // //  console.log(this.Table);
+   
       // //  this.tabList[1].number = res.data.totalRecord;
       // })
        let list = {
@@ -1667,18 +1665,18 @@
               this.twoTable.data = res.data.data;
              this.twoTable.pageData.total = res.data.totalRecord;
               this.tabList[1].number = res.data.totalRecord;
-              this.Table = this.twoTable;
+              // this.Table = this.twoTable;
                 
             });
     },
     saveform(){
-      // console.log(this.$refs.infolist);
+     
        this.$refs.infolist.validate((valid) => {
-          console.log(valid);
+    
           if (valid) {
                this.$message.success("保存成功");
               let list = {}
-              list.id = this.infolist.id;
+              list.id = this.infolist.id1;
               list.businessName = this.infolist.businessName;//业务名称
               list.cycleList = [this.$util.datetimeFormat(this.infolist.cycle[0]),this.$util.datetimeFormat(this.infolist.cycle[1])];
               list.needCode = this.infolist.needCode;
@@ -1686,7 +1684,7 @@
               list.gys = this.infolist.gys;
               list.materialUrl = this.infolist.materialUrl;
               list.xcwlProProcessList = this.infomaterType;
-              list.gysCode = this.selectLetter;
+              list.gysCode = this.infolist.tabletaskName == '省公司宣传负责人' ? this.selectLetter:null;
               // list.xcwlProProcessList = this.multipleSelection;
              
               if(this.attList == null){
@@ -1703,7 +1701,7 @@
                   
                     data: list,
                   }).then((res) => {
-                  console.log(res.data);
+                
                      this.teshuhuanjie = res.data;
                      
                     // this.infomaterType = res.data;
@@ -1721,11 +1719,10 @@
    
     },
       download(u) {
-      console.log(u);
-
+  
       // if (this.ruleForm.wfFileShareAttachList.length > 1) {
         this.$http({
-          url: "/market/waf/downAllFile",
+          url: "/market/waf/downAllFileByMinio",
           method: "post",
           headers: {
             "Content-Type": "application/json",
@@ -1866,7 +1863,7 @@
                 }).then((res) => {
                     this.tableData = res.data.body.pageList.data;
                     this.total = res.data.body.pageList.totalRecord;
-                    // console.log(this.tableData);
+                  
                     this.loading = false;
 
                 });
@@ -2003,7 +2000,7 @@
             },
             //文件返回值
             uploadBack(v) {
-                console.log(v)
+            
                 this.attList = v;
             },
             //功能栏
@@ -2024,13 +2021,11 @@
         mounted() {
             // this.getList({}, 1);
             this.getUser();
-        },
-        created() {
-          // console.log(this.$route); 
-            
             this.getTodoList();
+        },
+        created() { 
             this.Table = this.firstTable;
-            // this.haveDone();
+            this.haveDone();
             this.getIssueList();
         }
     }

+ 89 - 104
src/pages/main/advertising/materialApplicationadd.vue

@@ -139,12 +139,15 @@
 
           <div style="width: 100%">
             <div>
+              <el-form-item label="附件:"  prop="wfFileShareAttachList" class="info-line online1">
               <myUpload
                 @uploadBack="uploadBack"
                 :fileInfo="fileInfo"
                 :fileList="fileInfo.fileList"
+                style="width: 100% ;height: 120px !important"
               >
               </myUpload>
+               </el-form-item>
             </div>
           </div>
         </div>
@@ -413,7 +416,7 @@
 </template>
 <script>
 import mySearch from "../../../components/search.vue";
-import myUpload from "../../../components/upload.vue";
+import myUpload from "../../../components/uploadfour.vue";
 import deptTreeOnly from "../../../components/deptTreeOnly.vue";
 import myMessage from "../../../components/myMessage.vue";
 import { MessageBox } from "element-ui";
@@ -499,7 +502,19 @@ export default {
       ruless: {
         cycle: [{type: "array",required: true,trigger: "blur",message: "下单周期不能为空"}],
         needCode: [{required: true,trigger: "blur",message: "需求编号不能为空"}],
-        businessName: [{required: true,trigger: "blur",message: "业务名称不能为空"}],},
+        businessName: [{required: true,trigger: "blur",message: "业务名称不能为空"}],
+        // wfFileShareAttachList:[
+        //                 { required: true, validator: this.validatormk, trigger: "blur"},
+        //               ],
+        },
+         rulesss: {
+        cycle: [{type: "array",required: true,trigger: "blur",message: "下单周期不能为空"}],
+        needCode: [{required: true,trigger: "blur",message: "需求编号不能为空"}],
+        businessName: [{required: true,trigger: "blur",message: "业务名称不能为空"}],
+        wfFileShareAttachList:[
+                        { required: true, validator: this.validatormk, trigger: "blur"},
+                      ],
+        },
       rules: {
         useCase: [{required: true,trigger: "change",message: "请选择使用场景"}],
         formType: [{required: true,trigger: "change",message: "请选择表单类型"}],
@@ -514,7 +529,7 @@ export default {
       tableData: [{}],
       disableStatus: false,
       infolist: {},
-      needCode: "",
+      // needCode: "",
       pickerOptions0: {
         disabledDate(time) {
           return time.getTime() < Date.now() - 8.64e7; //如果没有后面的-8.64e7就是不可以选择今天的
@@ -604,57 +619,14 @@ export default {
       fileInfo: {
         // type: "img",
         limit: 50,
-        url: "/market/waf/upload",
+        url: "/market/waf/uploadByMinio",
         fileList: [],
       },
       infotype: "01",
       // checkList: [],
-      infomaterType: [
-        // {riqi:'2023-02-08',
-        //  formType:'自有渠道',
-        //  region:'大庆市',
-        //  district:'萨尔图',
-        //  useCase:'小区',
-        //  material:'哈哈哈哈哈',
-        //  quantity:2,
-        //  channelCode:'5425658621',
-        //  channelQuartersSchool:'发到华盛顿',
-        //  materialNo:'A01',
-        //  unit:'米',
-        //  spec:'10*10',
-        //  chang:'120',
-        //  kuan:'100',
-        //  hengShu:'150',
-        //  coefficient:2,
-        //  priority:3,
-        //  gys1Price:70,
-        //  gys2Price:30,
-       
-        // },
-         {riqi:'2023-02-09',
-         formType:'自有渠道',
-         region:'齐齐哈尔市',
-         district:'萨尔图',
-         channelCode:'1212121212',
-         useCase:'小区',
-         material:'哈哈哈哈哈',
-         quantity:3,
-         channelQuartersSchool:'发动机盖艰苦奋斗',
-         materialNo:'A02',
-         unit:'厘米',
-         spec:'10*10*10',
-         chang:'130',
-         kuan:'110',
-         hengShu:'150',
-         coefficient:3,
-         priority:4,
-         gys1Price:20,
-         gys2Price:30,
-        
-        }
-      ],
+      infomaterType: [],
       multipleSelection: [],
-      centarapply:{},
+      // centarapply:{},
       centerDialogVisible: false,
       delid: "",
       uploadstatus: false,
@@ -717,6 +689,7 @@ export default {
       }).then((res) => {
        
         this.infolist.needCode = res.data;
+        console.log(this.infolist.needCode);
       });
     },
     //后台返部门
@@ -729,15 +702,24 @@ export default {
          },
         
       }).then((res) => {
-       console.log(res.data);
+   
         this.applydept = res.data;
         // this.ruleForm.applyNew = res.data;
       });
     },
     tableSelectionChange(val) {
-      console.log(val);
+   
       this.multipleSelection = val;
     },
+      validatormk(rule,value,callback){
+      // console.log(this.ruleForm.wfFileShareAttachList)
+      if(this.infolist.wfFileShareAttachList == null){
+         console.log(111);
+        callback(new Error('请上传附件'));
+      }else{
+        callback();
+      }
+    },
     //物料名称联动
     changeMing(v,ev){
       if(v == 1){
@@ -751,26 +733,22 @@ export default {
                   sceneName: ev,
               },
         }).then((res) => {
-          console.log(res.data);
+       
           this.metirialOpt = res.data;
         });
        }else{
-        console.log(ev);
+      
           let that = this;
-            // console.log(that);
+        
             let hh = that.metirialOpt.filter(function (c, i, a) {
-              // console.log(c,i,a);
+           
            if (c.metirialName == that.formlist.material) {
           return c;
            }
           });
          this.selectLetter = hh[0];
-         console.log(this.selectLetter);
-        // this.infolian.spec = ev.size;
-        // this.infolian.unit = ev.unit;
-        // this.infolian.materialNo = ev.metirialCode;
-        // this.infolian.material = ev.metirialName;
-        // this.infolian.material = ev.metirialName;
+        //  console.log(this.selectLetter);
+       
        }
     },
     //物料筛选条件
@@ -905,7 +883,7 @@ export default {
       }
     },
     verifcheck(v, ev) {
-      console.log(v,ev);
+    
       if (v == 2) {
         if (ev.length === this.countyOpt.length) {
           this.isSelAllCounty = true;
@@ -956,7 +934,7 @@ export default {
     },
     verifcheck1(v,ev){
       if(v == 1){
-        console.log(ev);
+     
          this.$http({
                 url: "/sysmgr/regionComp/queryList",
                 method: "post",
@@ -967,7 +945,7 @@ export default {
                   parentCompId: ev,
                 },
               }).then((res) => {
-                // console.log(res.data);
+              
                 this.countyOpt = res.data;
               });
         this.$http({
@@ -980,19 +958,19 @@ export default {
                   regionCode: ev,
                 },
               }).then((res) => {
-                // console.log(res.data);
-                // this.countyOpt = res.data;
+              
+              
               });
                let that = this;
-            // console.log(that);
+          
             let hh = that.regionOpt.filter(function (c, i, a) {
-              // console.log(c,i,a);
+              
            if (c.compId == that.formlist.region) {
           return c;
            }
           });
          this.selectLettercurrent = hh[0].compName;
-         console.log(this.selectLettercurrent);
+        //  console.log(this.selectLettercurrent);
       }else{
          this.$http({
                 url: "/market/cadvBusiMetirial/queryList",
@@ -1004,8 +982,8 @@ export default {
                   countyName: ev,
                 },
               }).then((res) => {
-                console.log(res.data);
-                // this.countyOpt = res.data;
+               
+              
               });
       }
     },
@@ -1015,12 +993,7 @@ export default {
       this.getRegion();
       
       
-      // let obj1 = {id:2};
-      // let obj2 = {name:'hhhhh'};
-      // let obj3 = {...obj1,...obj2};
-      // console.log(obj3);
-      // this.arrger.push({obj3})
-      // console.log(this.arrger);
+      
     },
     //下单信息, 获取地市
     getRegion() {
@@ -1039,15 +1012,15 @@ export default {
           this.shijinyong = true;
            this.formlist.region = this.userInfo.cityName;
            let that = this;
-            // console.log(that);
+          
             let hh = that.regionOpt.filter(function (c, i, a) {
-              // console.log(c,i,a);
+            
            if (c.compName == that.formlist.region) {
           return c;
            }
           });
          this.selectcurrent = hh[0].compId;
-         console.log(this.selectcurrent);
+        //  console.log(this.selectcurrent);
          this.$http({
                 url: "/sysmgr/regionComp/queryList",
                 method: "post",
@@ -1058,7 +1031,7 @@ export default {
                   parentCompId: this.selectcurrent,
                 },
               }).then((res) => {
-                // console.log(res.data);
+              
                 this.countyOpt = res.data;
               });
                this.$http({
@@ -1071,8 +1044,7 @@ export default {
                   regionCode: this.selectcurrent,
                 },
               }).then((res) => {
-                // console.log(res.data);
-                // this.countyOpt = res.data;
+                
               });
         }
        
@@ -1118,6 +1090,7 @@ export default {
   
     //选择类型 填写下单信息
     typestscheck() {
+    
       this.$refs.formlist.validate((valid) => {
         if (valid) {
           let from = {}
@@ -1132,14 +1105,16 @@ export default {
             },
             data: from,
           }).then((res) => {
-           console.log(res.data.body);
+         
+           this.centarapply = {};
             this.centarapply.useCase = this.formlist.useCase;
           this.centarapply.material = this.formlist.material;
           this.centarapply.riqi = this.$util.dateFormat(this.formlist.riqi);
           this.centarapply.quantity = this.formlist.quantity;
           this.centarapply.formType = this.formlist.formType;
           this.centarapply.channelQuartersSchool = this.formlist.channelQuartersSchool;
-          this.centarapply.region = this.formlist.region;
+          // this.centarapply.region = this.formlist.region;
+          this.centarapply.region = this.$route.query.applyType == "地市" ? this.applydept : this.selectLettercurrent;
           this.centarapply.district = this.formlist.district;
            this.centarapply.spec = this.selectLetter.size;
           this.centarapply.unit = this.selectLetter.unit;
@@ -1158,13 +1133,10 @@ export default {
           });
           this.typests = false;
           
-          console.log(this.infomaterType);
+    
         }
       });
-      // setTimeout(function () {
-      //   console.log(111111111);
-      //    let formlist = {};
-      //    }, 500);
+
     },
     shanchu(){
        this.fileInfo.fileList = [];
@@ -1174,12 +1146,12 @@ export default {
     },
     //添加
     dialogCli(v) {
-      // console.log(tianjia);
+   
       this.$refs.infolist.validate((valid) => {
         if (valid) {
-          // console.log(tianjia);
+    
           if (v === 1) {
-            // console.log(tianjia);
+         
             this.fileInfo.fileList = [];
             this.infolist = {};
             return;
@@ -1221,9 +1193,9 @@ export default {
     },
     //保存
     wuliaoadd(){
-      // console.log(this.infolist);
+   
        this.$refs.infolist.validate((valid) => {
-          console.log(valid);
+      
           if (valid) {
              
               if(this.multipleSelection.length == 0){
@@ -1232,7 +1204,7 @@ export default {
                 this.$message.success("保存成功");
                   let list = {}
               list.businessName = this.infolist.businessName;//业务名称
-              console.log(this.infolist.cycle);
+          
               list.cycleList = [this.$util.dateFormat(this.infolist.cycle[0]),this.$util.dateFormat(this.infolist.cycle[1])];
               list.needCode = this.infolist.needCode;
               // list.xcwlProProcessList = this.infomaterType;
@@ -1251,7 +1223,7 @@ export default {
                   
                     data: list,
                   }).then((res) => {
-                  console.log(res.data);
+                
                     // this.infomaterType = res.data;
                     if(res.data){
                       this.$router.go(-1); 
@@ -1405,7 +1377,8 @@ export default {
     },
     uploadBack(v) {
       this.attList = v;
-      console.log(this.attList);
+      this.infolist.wfFileShareAttachList = v;
+      console.log(this.infolist.wfFileShareAttachList);
 
     },
    
@@ -1472,11 +1445,17 @@ export default {
     this.getTermianl();
     this.getUser();
     this.getList();
-    this.getNeedCode();
+    
   },
   created() {
-   console.log(this.$route.query); 
-   console.log(this.$route.query.applyType); 
+    this.getNeedCode();
+    // console.log(this.infolist.needCode);
+  //  console.log(this.$route.query); 
+   console.log(this.$route.query.applyType);
+    if(this.$route.query.applyType == "地市"){
+      // this.ruless = { ...this.ruless, ...rulesss }
+      this.ruless = this.rulesss
+    }
     this.getDept();
   },
 };
@@ -1531,7 +1510,7 @@ export default {
     border-radius: 3px;
     background: #fff;
     position: relative;
-    height: 100px;
+    height: 150px;
 
     img {
       width: 100%;
@@ -1670,13 +1649,19 @@ export default {
   }
 }
 ::v-deep.online .el-form-item__content {
-  width: 98%;
+  width: 100%;
   margin-left: 0 !important;
+  line-height: 28px;
+}
+::v-deep.online1 .el-form-item__content {
+  width: 100%;
+  margin-left: 0 !important;
+  line-height: 28px;
 }
-
 ::v-deep.el-upload {
   width: 98% !important;
   padding: 0 !important;
+  height: 150% !important;
 }
 .el-row {
   margin: 0 !important;

+ 117 - 137
src/pages/main/advertising/materialApplicationds.vue

@@ -53,12 +53,12 @@
                             <!-- <el-table-column label="结算金额" prop="replyContent"></el-table-column> -->
                             <el-table-column label="麦穗" prop="gys1Price"></el-table-column>
                             <el-table-column label="神笔" prop="gys2Price"></el-table-column>
-                            <el-table-column label="状态" prop="taskName"></el-table-column>
+                            <el-table-column label="状态" prop="taskname"></el-table-column>
                             <el-table-column label="操作"  fixed="right" align="center">
                                 <template slot-scope="scope">
-                                    <el-button size="mini" type="text" @click="getinform(scope.row)" v-if="scope.row.taskName == null">
+                                    <el-button size="mini" type="text" @click="getinform(scope.row)" v-if="scope.row.taskname == null || scope.row.taskname == '起草'">
                                         任务下发</el-button>
-                                    <el-button size="mini" type="text" @click="chakanfaqi(scope.row)" v-if="scope.row.taskName != null">
+                                    <el-button size="mini" type="text" @click="chakanfaqi(scope.row)" v-if="scope.row.taskname != null && scope.row.taskname != '起草'">
                                         查看</el-button>
                                 </template>
                                  <!-- <template slot-scope="scope">
@@ -100,6 +100,7 @@
         <el-dialog
         title="处理操作"
         :visible.sync="dialogVisible1"
+        v-if="dialogVisible1"
         :before-close="handleCloses"
         width="100%"
         height="100vh"
@@ -137,6 +138,7 @@
         class="dialogClass"
         top="0"
         :modal="false"
+        :show-close="false"
         :modal-append-to-body="true"
       >
         <span class="dialog-body">
@@ -344,6 +346,7 @@
 
           <div style="width: 96%; margin:20px 0 0 38px">
             <div>
+              
               <myUpload
                 @uploadBack="uploadBack"
                 @clickDownload = "download"
@@ -352,6 +355,7 @@
                 :fileList="fileInfo.fileList"
               >
               </myUpload>
+              
             </div>
           </div>
         </div>
@@ -401,7 +405,7 @@
       width="50%"
       :destroy-on-close="true"
       :modal-append-to-body="false"
-      :close-on-click-modal="false"
+      :show-close="false"
       :before-close="closedia"
     >
       <el-form
@@ -418,6 +422,7 @@
               clearable
               v-model="rulelist.useCase"
               placeholder="使用场景"
+              disabled
             >
               <el-option
                 v-for="(items, index) in useCaseopt"
@@ -432,6 +437,7 @@
             <el-select
               v-model="rulelist.formType"
               placeholder="请选择表单类型"
+              disabled
             >
               <el-option
                 v-for="(item, index) in optionList"
@@ -447,6 +453,7 @@
               clearable
               v-model="rulelist.material"
               placeholder="物料名称"
+              disabled
             >
               <el-option
                 v-for="(items, index) in metirialOpt"
@@ -462,6 +469,7 @@
                         v-model="rulelist.quantity"
                         placeholder="数量"
                         type="number"
+                        oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"
                         style="width:256px"
                         >
             </el-input>
@@ -483,7 +491,7 @@
       <div class="t-footer">
         <!--  -->
         <el-button type="primary" @click="gengxinge">确 定</el-button>
-        <el-button @click="closediaform">取 消</el-button>
+        <!-- <el-button @click="closediaform">取 消</el-button> -->
       </div>
     </el-dialog>
         <el-dialog
@@ -532,9 +540,10 @@
     import mySearch from "../../../components/search.vue";
     import myMessage from "../../../components/myMessage.vue"
     import toolList from '../../../components/toolList'
-	import myUpload from '../../../components/upload'
-    import tableList from "../../../components/el-form";
+	import myUpload from '../../../components/uploadfour'
+    import tableList from "../../../components/el-formfour";
     import Workflow from "../../../components/workflowBasexcwls";
+    import getConfig from '../../../config/dev.js'
 // import Workflow from "../../../components/workflow";
     // import WorkflowEntrance from "../../../components/workflowEntrance";
    import {
@@ -570,7 +579,7 @@
             // }
             return {
                   requestForm: {
-                    fresourceId: "241efa62-a816-11ed-886f-d6cd97160e00",
+                    fresourceId: getConfig().materialApplicationdsfresourceId,
                     processDefinitionKey: "xcwl_cit_process",
                     processDefinitionKey1: "xcwl_pro_process",
                     // processDefinitionKeys: "xcwl_cit_process",
@@ -695,7 +704,7 @@
           },
            {
             label: "状态",
-            prop: "taskName",
+            prop: "taskname",
             width: 200,
           },
         ], //表格头
@@ -727,9 +736,7 @@
                             label: "任务下发", // 操作名称
                             type: "", //按钮类型
                             handleRow: function (e, r, o) {
-                                console.log(e);
-                                console.log(r);
-                                console.log(o);
+                            
                                 // getinform
                                 // this.getinform(r);
                             }, // 自定义事件
@@ -819,7 +826,7 @@
           },
            {
             label: "状态",
-            prop: "taskName",
+            prop: "taskname",
             width: 200,
           },
         ], //表格头
@@ -851,9 +858,7 @@
                             label: "任务下发", // 操作名称
                             type: "", //按钮类型
                             handleRow: function (e, r, o) {
-                                console.log(e);
-                                console.log(r);
-                                console.log(o);
+                           
                                 // getinform
                                 // this.getinform(r);
                             }, // 自定义事件
@@ -969,10 +974,6 @@
                     cycle: [{type: "array",required: true,trigger: "blur",message: "下单周期不能为空"}],
                     needCode: [{required: true,trigger: "blur",message: "需求编号不能为空"}],
                     businessName: [{required: true,trigger: "blur",message: "业务名称不能为空"}],
-                    // districtScore: [{required: true,trigger: "blur",message: "区县打分不能为空"}],
-                    // gys: [{required: true,trigger: "change",message: "请选择供应商"}],
-                    // materialUrl: [{required: true,trigger: "blur",message: "物料验证材料链接不能为空"}],
-
                 },
                 childname:"first",
                 tooltit:'物料申请管理',
@@ -998,6 +999,7 @@
                 deal: true,
                 baocun: true,
                 rulelist:[],
+                wfFileShareAttachList:[],
                 teshuhuanjie: [],
                 isWorkflowStatus:false,
                 titname: '',
@@ -1014,7 +1016,7 @@
                 updisabled:false,
 				fileInfo: {
 				    limit: 10,
-				    url: '/market/waf/upload',
+				    url: '/market/waf/uploadByMinio',
 				    fileList: []
 				},
 				infoApply:{},
@@ -1037,8 +1039,7 @@
         watch:{
           'infolist.tabletaskName':{
           handler(newVal,oldVal){
-            // console.log(this.ruleForm);
-            console.log(newVal);
+          
             let rule1 = {
              gys: [
                 { required: true, validator: this.validatorFile , trigger: "blur" },
@@ -1051,39 +1052,23 @@
                 { required: true, validator: this.validatorLianjie , trigger: "blur" },],
             }
             if(newVal === '省公司宣传负责人'){
-              console.log(121);
+           
               this.rules = { ...this.rules, ...rule1 }
-              console.log(111);
+           
               }
               else if(newVal === '区县公司负责人'){
-                console.log(1234);
+             
                this.rules = { ...this.rules, ...rule2 }
               }
           },
           deep:true,
           
           },
-          //  'infolist.tabletaskName':{
-          // handler(newVal,oldVal){
-          //   // console.log(this.ruleForm);
-          //   // console.log(newVal);
-          //   let rule2 = {
-          //    districtScore: [
-          //       { required: true, validator: this.validatorDafen , trigger: "blur" },],
-          //     materialUrl: [
-          //       { required: true, validator: this.validatorLianjie , trigger: "blur" },],
-          //   }
-          //   if(newVal === '市公司主管宣传副主任'){
-          //     this.rules = { ...this.rules, ...rule }
-          //     }
-          // },
-          // deep:true,
-          
-          // },
+        
         },
         methods: {
             clickTabs(name){
-                console.log(name);
+              
                 this.pageNo = "1";
                 this.page = "1";
                 this.childname = name;
@@ -1101,8 +1086,7 @@
               changeNum(val) {
                 this.page = val;
                 this.pageNo = val;
-                console.log(this.page);
-                console.log(this.childname);
+             
                 switch (this.childname) {
                     case "first":
                     this.getTodoList();
@@ -1120,7 +1104,7 @@
                 }
                 },
                   clickDemand(e, r) {
-      //  console.log(e,r);
+    
       if (e === "业务名称") {
         if(this.childname == "first"){
           
@@ -1166,10 +1150,10 @@
     // },
       //点击标题
          operationZuo(r){
-          console.log(r);
+        
           let list = {}
           list.id = r.id,
-          // console.log(row)
+      
           this.$http({
             url:"/market/xcwlProcess/query",
             method:"post",
@@ -1191,8 +1175,8 @@
             this.infolist.taskId = r.taskId;
             this.infolist.id = r.id;
             this.infolist.createId = r.createId;
-            this.infolist.tabletaskName = r.taskName;
-            // console.log(this.infolist.tabletaskname);
+            this.infolist.tabletaskName = r.taskname;
+        
             this.infolist.gys = res.data.xcwlProProcessList[0].selectedGys;
             this.infolist.districtScore = res.data.xcwlProProcessList[0].districtScore;
             this.infolist.materialUrl = res.data.xcwlProProcessList[0].materialUrl;
@@ -1217,37 +1201,43 @@
                     },
                     data:{},
                   }).then((res) => {
-                  // console.log(res.data);
-                  this.gysopt = res.data;
-                  // console.log( this.infolist.gysopt);
-                    // this.infomaterType = res.data;
-                    // if(res.data){
-                    //  this.typests = false;
-                    //   return;
-                    // }
+                this.gysopt = res.data;
+                
                   });
           });
         },
          uploadBack(v) {
+
           this.attList = v;
-          console.log(this.attList);
+          this.ruleForm.wfFileShareAttachList = v;
+          console.log(this.ruleForm.wfFileShareAttachList);
+          // console.log(this.attList);
 
     },
+     validatormk(rule,value,callback){
+      console.log(this.ruleForm.wfFileShareAttachList)
+      if(this.ruleForm.wfFileShareAttachList == null){
+         console.log(111);
+        callback(new Error('请上传附件'));
+      }else{
+        callback();
+      }
+    },
     gysMing(n,ev){
         let that = this;
-            // console.log(that);
+           
             let hh = that.gysopt.filter(function (c, i, a) {
-              // console.log(c,i,a);
+             
            if (c.name == that.infolist.gys) {
           return c;
            }
           });
          this.selectLetter = hh[0].code;
-         console.log(this.selectLetter);
+        //  console.log(this.selectLetter);
     },
     dealwith(){
       if(this.infolist.tabletaskName == "省公司宣传负责人" || this.infolist.tabletaskName == "区县公司负责人"){
-       console.log(this.teshuhuanjie);
+   
        if(this.teshuhuanjie.length == 0){
            this.$message.error("请先点击保存");
         }else{
@@ -1259,7 +1249,7 @@
       
     },
     updatexiuform(r){
-      console.log(r);
+    
       this.typests = true;
       this.rulelist = r;
     },
@@ -1269,26 +1259,30 @@
     //更新表格
     gengxinge(){
        this.typests = false;
-        // this.$http({
-        //             url: "/market/xcwlProcess/update",
-        //             method: "post",
-        //             headers: {
-        //               "Content-Type": "application/json",
-        //             },
+        let rulelistform = {}
+         rulelistform.metirialName = this.rulelist.material;
+         rulelistform.quantity = this.rulelist.quantity;
+         rulelistform.ratio = this.rulelist.coefficient;
+        this.$http({
+                    url: "/market/xcwlProcessImport/getPriByMetirialName",
+                    method: "post",
+                    headers: {
+                      "Content-Type": "application/json",
+                    },
                   
-        //             data: this.rulelist,
-        //           }).then((res) => {
-        //           console.log(res.data);
-        //             // this.infomaterType = res.data;
-        //             if(res.data){
-        //              this.typests = false;
-        //               return;
-        //             }
-        //           });
+                    data: rulelistform,
+                  }).then((res) => {
+              
+
+                    this.infomaterType[0].gys1Price = res.data.body.gys1Price;
+                    this.infomaterType[0].gys2Price = res.data.body.gys2Price;
+
+                   
+                  });
     },
       validatorFile(rule,value,callback){
       if(this.infolist.gys == null){
-        // console.log(this.ruleForm.addJobNumber);
+       
         callback(new Error('请选择供应商'));
       }else{
         
@@ -1297,7 +1291,7 @@
     },
       validatorDafen(rule,value,callback){
       if(this.infolist.districtScore == null || ""){
-        console.log(this.infolist.districtScore);
+       
         callback(new Error('请输入区县打分'));
       }else{
         
@@ -1306,7 +1300,7 @@
     },
      validatorLianjie(rule,value,callback){
       if(this.infolist.materialUrl == null || ""){
-        console.log(this.infolist.materialUrl);
+    
         callback(new Error('请输入物料验证材料链接'));
       }else{
         
@@ -1315,16 +1309,12 @@
     },
     //任务下发
     getinform(r){
-      console.log(r);
+  
       this.infolist = r;
       this.infolist.id = r.id;
       this.request_form.businessKey = r.id;
       this.getUserIds();
-    //   console.log(this.request_form);
-    //   this.infolist.userId = this.request_form.userId;
-    //   this.infolist.userName = this.request_form.userName;
-    //   console.log(r);
-    //   this.clickHandle(r);
+  
     },
        //获取userID
        getUserIds() {
@@ -1339,18 +1329,17 @@
           // params: JSON.parse(window.sessionStorage.userInfo).loginNo,
        },
       }).then((res) => {
-        // console.log(res.data.data.rows[0].name);
-        // console.log(res.data.data.rows[0].userCode);
-        console.log(res.data[0].children);
+       
+        // console.log(res.data[0].children);
         this.request_form.userName = res.data[0].children[0].loginNameStr;
         this.request_form.userId = res.data[0].children[0].loginNoStr;
         this.request_form.title = '[市场工作台]-'+'地市宣传物料申请及审批-'+ this.infolist.needName;
-        console.log(this.request_form);
+       
         this.clickHandle(this.infolist);
        });
      },
      async clickHandle(e) {
-        console.log(this.request_form);
+      
       let _this = this;
       let obj = {
       url: this.$url.formList.startWork, //开始工作流接口
@@ -1363,12 +1352,7 @@
       
       let res = await this.common.httpPost(obj, success);
       function success(data) {
-        console.log(data);
-//         _this.ruleForm.taskId = _this.ruleForm.taskId;
-        // a = a 
-//         _this.taskId = data.data;
-      //  console.log(data);
-      //  console.log(data.code);
+    
       _this.infolist.processId = data.data;
        let list = {
          id: e.id,
@@ -1378,15 +1362,13 @@
           
           // resourceId: _this.nextPath.currentShape[0].resourceId,
        };
-        // console.log(processDefinitionKey);
-        console.log(list);
+      
          _this.setUpdate(list);
       }
      },
     //更新工作流接口
 
     setUpdate(e) {
-      console.log(e);
       this.$http({
        url: "/market/waf/updateBase",
         method: "post",
@@ -1401,7 +1383,7 @@
     },
      //是否最后一个人
     async getLastName() {
-      console.log(this.infolist);
+  
       let list = {
         procinstid: this.infolist.processId,
         taskid: this.infolist.taskId,
@@ -1420,7 +1402,7 @@
 
       let res = await this.common.httpPost(obj, success);
       function success(data) {
-        console.log(data);
+    
         if (data.lastMan == true) {
           _this.adminResourceId = data.adminResourceId;
         }
@@ -1429,7 +1411,7 @@
         _this.isWorkflowStatus = data.lastMan == false ? false : true;
         _this.lastManList = data;
 
-        // console.log(_this.isWorkflowStatus);
+      
       }
     },
      getNextPath(e) {
@@ -1455,20 +1437,20 @@
         data: list,
       }).then((res) => {
         if (res.data.body.nextShapes[0].multi) {
-          console.log('这是mulit节点');
+          // console.log('这是mulit节点');
           if (res.data.body.nextShapes[0].multi.multi === "true") {
-             console.log('这是mulit节点');
+            //  console.log('这是mulit节点');
             this.getLastName();
           } else {
             this.adminResourceId = ''
-            console.log('这不是mulit节点');
+            // console.log('这不是mulit节点');
             this.destroy = true;
             this.dialogVisible1 = true;
             // this.getMetirialType();
           }
         } else {
           this.adminResourceId = ''
-          console.log('这不是mulit节点');
+          // console.log('这不是mulit节点');
           this.destroy = true;
           this.dialogVisible1 = true;
         //   this.getMetirialType();
@@ -1481,8 +1463,7 @@
     },
     //处理按钮,开始工作流接口
     clickHandles() {
-      //   console.log(this.infolist.resourceId);
-      // this.getNextPath(this.infolist.resourceId || "");
+    
       this.dialogVisible1 = true;
     },
       async clickForm(r) {
@@ -1539,33 +1520,33 @@
       this.dialogVisible1 = false;
       this.dialogVisible = false;
       this.getIssueList();
+      this.getTodoList();
+      this.haveDone();
     //   this.refreshbtn();
     },
-    //  changeNum(e) {
-    //         console.log(e)
-    //         this.pageNo = e;
-    //         this.page = e;
-    //         this.firstTable.pageData.pageNum = e;
-    //         this.getTodoList()
-    //     },
+  
             adminhandleSizeChange(val) {
-            console.log(`每页 ${val} 条`);
+            // console.log(`每页 ${val} 条`);
         },
          adminhandleCurrentChange(val) {
-            // console.log(e)
+           
             this.pageNo = val;
 
             this.getIssueList()
-            console.log(`当前页: ${val}`);
+            // console.log(`当前页: ${val}`);
         },
         handleCloses() {
           this.treeList = [];
           this.textarea = "";
           this.dialogVisible1 = false;
-
+          // this.getIssueList();
+          this.getTodoList();
+          this.haveDone();
+          this.getIssueList();
     },
     close(){
      this.dialogVisible = false;
+     this.tableData1 = [];
     },
     //我发起列表
        getIssueList(e) {
@@ -1632,7 +1613,7 @@
       //  this.twoTable.pageData.total = res.data.totalRecord;
       //   this.tabList[1].number = res.data.totalRecord;
       //   this.Table = this.twoTable;
-      // //  console.log(this.Table);
+     
       // //  this.tabList[1].number = res.data.totalRecord;
       // })
        let list = {
@@ -1651,13 +1632,13 @@
               this.twoTable.data = res.data.data;
              this.twoTable.pageData.total = res.data.totalRecord;
               this.tabList[1].number = res.data.totalRecord;
-              this.Table = this.twoTable;
+              // this.Table = this.twoTable;
                 
             });
     },
     saveform(){
        this.$refs.infolist.validate((valid) => {
-          console.log(valid);
+        
           if (valid) {
                this.$message.success("保存成功");
               let list = {}
@@ -1669,7 +1650,7 @@
               list.gys = this.infolist.gys;
               list.materialUrl = this.infolist.materialUrl;
               list.xcwlProProcessList = this.infomaterType;
-              list.gysCode = this.selectLetter;
+              list.gysCode = this.infolist.tabletaskName == '省公司宣传负责人' ? this.selectLetter:null;
               // list.xcwlProProcessList = this.multipleSelection;
              
               if(this.attList == null){
@@ -1686,7 +1667,7 @@
                   
                     data: list,
                   }).then((res) => {
-                  console.log(res.data);
+              
                      this.teshuhuanjie = res.data;
                      
                     // this.infomaterType = res.data;
@@ -1704,11 +1685,11 @@
    
     },
       download(u) {
-      console.log(u);
+   
 
       // if (this.ruleForm.wfFileShareAttachList.length > 1) {
         this.$http({
-          url: "/market/waf/downAllFile",
+          url: "/market/waf/downAllFileByMinio",
           method: "post",
           headers: {
             "Content-Type": "application/json",
@@ -1849,7 +1830,7 @@
                 }).then((res) => {
                     this.tableData = res.data.body.pageList.data;
                     this.total = res.data.body.pageList.totalRecord;
-                    // console.log(this.tableData);
+                  
                     this.loading = false;
 
                 });
@@ -1986,8 +1967,8 @@
             },
             //文件返回值
             uploadBack(v) {
-                console.log(v)
-                this.attList = v;
+            this.attList = v;
+            this.ruleForm.wfFileShareAttachList = v;    
             },
             //功能栏
             iconCli(v) {
@@ -2007,13 +1988,12 @@
         mounted() {
             // this.getList({}, 1);
             this.getUser();
+             
+             this.getTodoList();
         },
         created() {
-          // console.log(this.$route); 
-            
-            this.getTodoList();
             this.Table = this.firstTable;
-            // this.haveDone();
+            this.haveDone();
             this.getIssueList();
         }
     }

+ 211 - 116
src/pages/main/advertising/materiel.vue

@@ -40,13 +40,6 @@
                     </el-table-column>
                     <el-table-column prop="proviceFlagName" label="下单模式">
                     </el-table-column>
-                    <!-- <el-table-column prop="metirialType" label="细分类型">
-					</el-table-column> -->
-
-<!--                    <el-table-column prop="metirialType" label="类别">-->
-<!--                    </el-table-column>-->
-<!--                    <el-table-column prop="isAsic" label="基础数据">-->
-<!--                    </el-table-column>-->
                     <el-table-column
                         prop="metirialCode"
                         label="物料编码"
@@ -55,16 +48,7 @@
                     </el-table-column>
                     <el-table-column prop="metirialName" label="物料名称">
                     </el-table-column>
-<!--                    <el-table-column prop="supplierCode" label="供应商">-->
-<!--                    </el-table-column>-->
-<!--                    <el-table-column prop="size" label="规格尺寸">-->
-<!--                    </el-table-column>-->
-<!--                    <el-table-column prop="coefficient" label="勾选后系数">-->
-<!--                    </el-table-column>-->
-                    <!--<el-table-column prop="quality" label="材质" width="200" show-overflow-tooltip>
-					</el-table-column> -->
-                    <!-- <el-table-column prop="size" label="规格" show-overflow-tooltip>
-					</el-table-column> -->
+
                     <el-table-column prop="unit" label="物料单位">
                     </el-table-column>
                     <el-table-column prop="price" label="不含税单价(元)">
@@ -125,9 +109,10 @@
                 >
                     <div class="info-line">
                         <el-form-item prop="sceneName">
+                            <!-- :disabled="disableStatus" -->
                             <span>使用场景</span>
                             <el-select
-                                :disabled="disableStatus"
+                                
                                 :popper-append-to-body="false"
                                 multiple
                                 v-model="infolist.sceneName"
@@ -143,19 +128,20 @@
                                 </el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item prop="proviceFlag">
+                         <!-- :disabled="disableStatus" -->
+                        <el-form-item prop="proviceFlagName">
                             <span>下单模式</span>
                             <el-select
-                                :disabled="disableStatus"
+                               
                                 :popper-append-to-body="false"
-                                v-model="infolist.proviceFlag"
+                                v-model="infolist.proviceFlagName"
                                 placeholder="下单模式"
                             >
                                 <el-option
                                     v-for="item in proviceopt"
                                     :key="item.id"
                                     :label="item.name"
-                                    :value="item.id"
+                                    :value="item.name"
                                 >
                                 </el-option>
                             </el-select>
@@ -200,13 +186,13 @@
 							<el-input v-model="infolist.metirialType" placeholder="细分类型" :disabled="disableStatus">
 							</el-input>
 						</el-form-item> -->
-
+                        <!-- :disabled="metirialCodeDisableStatus" -->
                         <el-form-item prop="metirialCode">
                             <span>物料编码</span>
                             <el-input
                                 v-model="infolist.metirialCode"
                                 placeholder="物料编码"
-                                :disabled="metirialCodeDisableStatus"
+                                
                             >
                             </el-input>
                         </el-form-item>
@@ -218,10 +204,11 @@
 									:value="item.dataName">
 								</el-option>
 							</el-select> -->
+                            <!-- :disabled="disableStatus" -->
                             <el-input
                                 v-model="infolist.metirialName"
                                 placeholder="物料名称"
-                                :disabled="disableStatus"
+                                
                             >
                             </el-input>
                         </el-form-item>
@@ -268,11 +255,12 @@
 <!--                                </el-option>-->
 <!--                            </el-select>-->
 <!--                        </el-form-item>-->
+<!-- :disabled="disableStatus" -->
                         <el-form-item prop="unit">
                             <span>物料单位</span>
                             <!-- <el-input v-model="infolist.unit" placeholder="单位" :disabled="disableStatus"></el-input> -->
                             <el-select
-                                :disabled="disableStatus"
+                                
                                 :popper-append-to-body="false"
                                 v-model="infolist.unit"
                                 placeholder="物料单位"
@@ -286,13 +274,16 @@
                                 </el-option>
                             </el-select>
                         </el-form-item>
+                        <!-- :disabled="disableStatus" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" -->
                         <el-form-item prop="price">
                             <span>不含税单价(元)</span>
                             <el-input
+                                 
+                                oninput="value = value.replace(/^(-)(\d+).(\d\d).$/,’$1$2.$3’)"
                                 type="number"
                                 v-model="infolist.price"
                                 placeholder="不含税单价(元)"
-                                :disabled="disableStatus"
+                                
                             ></el-input>
                         </el-form-item>
                         <!-- <el-form-item>
@@ -315,7 +306,13 @@
                     <el-button
                         type="primary"
                         @click="dialogCli(2)"
-                        v-if="titname !== '查看'"
+                        v-if="titname === '修改'"
+                        >确 定</el-button
+                    >
+                    <el-button
+                        type="primary"
+                        @click="xintianjia()"
+                        v-if="titname === '添加'"
                         >确 定</el-button
                     >
                     <el-button @click="dialogCli(1)" v-if="titname === '查看'"
@@ -348,11 +345,30 @@ export default {
         myUpload
     },
     data() {
-        const sceneName = (rule, value, callback) => {
-            if (!this.infolist.sceneName) {
-                callback(new Error("不能为空"));
+        // const sceneName = (rule, value, callback) => {
+        //     if (!this.infolist.sceneName) {
+                
+        //             callback(new Error("使用场景不能为空"));
+                
+                
+        //     } else {
+        //         callback();
+        //     }
+        // };
+         let sceneName = (rule, value, callback) => {
+            if (!this.isFirstLoad) {
+                // console.log(value);
+                if(value == ''|| value == undefined){
+                    callback(new Error("使用场景不能为空"));
+                }else{
+                    callback();
+                }
+                    
+                
+                
             } else {
-                callback();
+                this.isFirstLoad = false;
+                
             }
         };
         const metirialName = (rule, value, callback) => {
@@ -429,10 +445,12 @@ export default {
 
         const price = (rule, value, callback) => {
             if (!this.infolist.price) {
-                callback(new Error("不能为空"));
+                callback(new Error("单价不能为空"));
             } else if (parseFloat(this.infolist.price) > 999999.99) {
                 callback(new Error("数量过大"));
-            } else {
+            } else if (parseFloat(this.infolist.price) <= 0){
+                callback(new Error("请输入正数"));
+            }else {
                 callback();
             }
         };
@@ -444,101 +462,109 @@ export default {
             }
         };
         return {
+            isFirstLoad : true,
             rules: {
-                sceneName: [
-                    {
-                        required: true,
-                        trigger: "change",
-                        validator: sceneName
-                    }
-                ],
+             
                 metirialName: [
                     {
                         required: true,
-                        trigger: "change",
-                        validator: metirialName
-                    }
-                ],
-                metirialType: [
-                    {
-                        required: true,
                         trigger: "blur",
-                        validator: metirialType
+                        message: "物料名称不能为空"
                     }
                 ],
-                isAsic: [
+                 sceneName: [
                     {
                         required: true,
-                        trigger: "blur",
-                        validator: isAsic
+                        trigger: "change",
+                        type: 'array',
+                        validator: sceneName
+                        // message: "使用场景不能为空"
                     }
                 ],
+                //  sceneName: [
+                //     {
+                //         required: true,
+                //         trigger: "change",
+                //         validator: function (rule, value, callback) {
+                //         if (value.length === 0) {
+                //             callback(new Error('请选择高风险问题1'))
+                //         } else {
+                //             callback()
+                //         }
+                //         },
+                //         // validator: sceneName
+                //         // message: "使用场景不能为空"
+                //     }
+                // ],
+                
+               
 
                 metirialCode: [
                     {
                         required: true,
                         trigger: "blur",
-                        validator: metirialCode
-                    }
-                ],
-                proviceFlag: [
-                    {
-                        required: true,
-                        trigger: "change",
-                        validator: proviceFlag
+                        message: "物料编码不能为空"
                     }
                 ],
                 proviceFlagName: [
                     {
                         required: true,
                         trigger: "change",
-                        validator: proviceFlagName
+                        message: "下单模式不能为空"
                     }
                 ],
+                // proviceFlagName: [
+                //     {
+                //         required: true,
+                //         trigger: "change",
+                //         validator: proviceFlagName
+                //     }
+                // ],
 
-                supplierCode: [
-                    {
-                        required: true,
-                        trigger: "change",
-                        validator: supplierCode
-                    }
-                ],
-                size: [
-                    {
-                        required: true,
-                        trigger: "blur",
-                        validator: size
-                    }
-                ],
-                coefficient: [
-                    {
-                        required: true,
-                        trigger: "blur",
-                        validator: coefficient
-                    }
-                ],
+                // supplierCode: [
+                //     {
+                //         required: true,
+                //         trigger: "change",
+                //         validator: supplierCode
+                //     }
+                // ],
+                // size: [
+                //     {
+                //         required: true,
+                //         trigger: "blur",
+                //         validator: size
+                //     }
+                // ],
+                // coefficient: [
+                //     {
+                //         required: true,
+                //         trigger: "blur",
+                //         validator: coefficient
+                //     }
+                // ],
 
                 unit: [
                     {
                         required: true,
-                        trigger: "blur",
-                        validator: unit
+                        trigger: "change",
+                        message: "物料单位不能为空"
                     }
                 ],
-                price: [
+                // price: [
+                //     {
+                //         required: true,
+                //         trigger: "blur",
+                //         message: "物料单价不能为空"
+                //     }
+                // ],
+                 price: [
                     {
                         required: true,
                         trigger: "change",
                         validator: price
                     }
                 ],
-                quality: [
-                    {
-                        required: true,
-                        trigger: "change",
-                        validator: quality
-                    }
-                ]
+           
             },
             searchList: [
                 {
@@ -622,7 +648,9 @@ export default {
             dialogStatus: false,
             disableStatus: false,//是否禁用弹窗
             titname: "",
-            infolist: {},
+            infolist: {
+                'infolist.sceneName':[]
+            },
             userInfo: {},
             params: {},
             centerDialogVisible: false,
@@ -644,7 +672,7 @@ export default {
                     id: "2",
                     name: "省+地市"
                 },{
-                    id: "",
+                    id: "3",
                     name: "省+市"
                 }
             ],
@@ -750,7 +778,7 @@ export default {
         },
         exportTempletelist() {
             let data = this.params;
-            console.log(data);
+            // console.log(data);
             // return
             this.$http({
                 url: "/market/cadvSecbuyMetirial/excelExportTemplete",
@@ -821,14 +849,14 @@ export default {
         },
         uploadBack(v) {
             let that = this;
-            console.log(v);
-            console.log(v.data.desc);
-            if(v.data.desc != "导入成功"){
-                let timer = setTimeout(() => {
-                   this.$message.error("物料编码已存在,请更改物料编码"); 
-                },800)
+            // console.log(v);
+            // console.log(v.data.desc);
+            // if(v.data.desc != "导入成功"){
+            //     let timer = setTimeout(() => {
+            //        this.$message.error("物料编码已存在,请更改物料编码"); 
+            //     },800)
                 
-            }
+            // }
             if(v.data.result==0){
                 that.getList({}, 1);
                 that.getUser();
@@ -900,6 +928,8 @@ export default {
         //申请
         dialogCheck(v, n) {
             this.dialogStatus = true;
+            this.infolist.sceneName = [],
+            this.isFirstLoad = true;
             this.infolist = Object.assign({}, n);
             if (v === 1) {
                 this.titname = "查看";
@@ -920,6 +950,68 @@ export default {
             this.infolist.opNo = this.userInfo.loginNo;
             this.infolist.opName = this.userInfo.loginName;
         },
+        
+        // 添加1
+         xintianjia(e) {
+            this.$refs.infolist.validate((valid) => {
+         
+          if (valid) {
+            this.infolist.price = parseFloat(this.infolist.price).toFixed(2);
+            let scene = "";
+                    this.infolist.sceneName.forEach((item, index) => {
+                        scene += item;
+                        if (index != this.infolist.sceneName.length - 1) {
+                            scene += "/";
+                        }
+            });
+            this.infolist.sceneName = scene;
+            this.$http({
+                url: "/market/cadvSecbuyMetirial/add",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                    
+                },
+               data: this.infolist,
+            }).then((res) => {
+        
+                // if(res.data.desc == "添加成功"){
+                //     this.infolist = {};
+                //      this.$message.success("成功");
+                //      this.dialogStatus = false;
+                //      this.getList({}, this.pageSize);
+                // }
+                if (res.data.result === 1) {
+                            this.infolist.sceneName = this.infolist.sceneName.split(
+                                "/"
+                            );
+                            this.$message({
+                                message: res.data.desc,
+                                type: "error"
+                            });
+                        } else if (res.data.result === -1) {
+                            this.infolist.sceneName = this.infolist.sceneName.split(
+                                "/"
+                            );
+                            this.$message({
+                                message: res.data.desc,
+                                type: "fail"
+                            });
+                        } else {
+                            this.$message({
+                                message: "成功",
+                                type: "success"
+                            });
+                            this.infolist = {};
+                            this.dialogStatus = false;
+                            this.getList({}, this.pageSize);
+                        }
+            });
+        
+         
+        }
+        })
+        },
         //添加
         dialogCli(v) {
             if (v === 1) {
@@ -1074,21 +1166,24 @@ export default {
         this.getList({}, 1);
         this.getUser();
 
-        this.$http({
-            url: "/sysmgr/cfgDataDicts/queryMap",
-            method: "post",
-            headers: {
-                "Content-Type": "application/json"
-            },
-            data: {
-                dictCodePks: "metirialType"
-            }
-        }).then(res => {
-            this.metirialTypeopt = res.data.body.metirialType;
-            // this.stypeList = res.data.body.materType;
-        });
+        // this.$http({
+        //     url: "/sysmgr/cfgDataDicts/queryMap",
+        //     method: "post",
+        //     headers: {
+        //         "Content-Type": "application/json"
+        //     },
+        //     data: {
+        //         dictCodePks: "metirialType"
+        //     }
+        // }).then(res => {
+        //     this.metirialTypeopt = res.data.body.metirialType;
+        //     // this.stypeList = res.data.body.materType;
+        // });
     },
-    created() {}
+    created() {
+        // if (this.multiples) this.infolist.sceneName = []
+        this.$set(this.infolist, 'this.infolist.sceneName', [])
+    }
 };
 </script>
 <style scoped lang="scss">