Explorar o código

修改销售政策列表详情

lichao %!s(int64=3) %!d(string=hai) anos
pai
achega
1384c91708

+ 2 - 2
src/views/maintenance/salesPolicy/configuration/BuyFree.json

@@ -124,10 +124,10 @@
       ]
     },{
       "label": "操作员",
-      "prop": "updateUser",
+      "prop": "updateUserName",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
       "rules": [
         {
           "required": false,

+ 2 - 2
src/views/maintenance/salesPolicy/configuration/customerContact.json

@@ -111,10 +111,10 @@
       ]
     },{
       "label": "操作员",
-      "prop": "updateUser",
+      "prop": "updateUserName",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
       "rules": [
         {
           "required": false,

+ 110 - 78
src/views/maintenance/salesPolicy/configuration/mainList.json

@@ -1,84 +1,116 @@
 {
-    "lazy": true,
-    "tip": false,
-    "simplePage": true,
-    "searchShow": true,
-    "searchMenuSpan": 6,
-    "dialogWidth": "60%",
-    "tree": true,
-    "border": true,
-    "index": true,
-    "selection": true,
-    "viewBtn": false,
-    "editBtn": false,
-    "delBtn": false,
-    "menuWidth": 300,
-    "dialogClickModal": false,
-    "searchLabelWidth": 100,
-    "column":[
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "searchSpan": 8,
+  "searchMenuPosition": "right",
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 300,
+  "dialogClickModal": false,
+  "searchLabelWidth": 120,
+  "column": [
+    {
+      "label": "政策名称",
+      "prop": "cname",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "代理商",
+      "prop": "corps",
+      "search": true,
+      "index": 2,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "品牌",
+      "prop": "brand",
+      "search": true,
+      "index": 3,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "状态",
+      "prop": "status",
+      "type": "select",
+      "dicData": [
         {
-            "label": "编码",
-            "prop": "code",
-            "search": true,
-            "index": 1,
-            "width":100
+          "label": "正常",
+          "value": 0
         },
         {
-            "label": "品牌",
-            "prop": "brand",
-            "search": true,
-            "index": 2,
-            "width":100
-        },{
-            "label": "产品分类",
-            "prop": "productCategory",
-            "search": true,
-            "index": 3,
-            "width":100
-        },{
-            "label": "政策名称",
-            "prop": "cname",
-            "search": true,
-            "index": 4,
-            "width":100
-        },{
-            "label": "创建时间",
-            "prop": "createTime",
-            "search": true,
-            "index": 5,
-            "width":100
-        },{
-            "label": "有效期开始时间",
-            "prop": "startTime",
-            "search": true,
-            "index": 6,
-            "width":100
-        },{
-            "label": "有效期结束时间",
-            "prop": "endTime",
-            "search": true,
-            "index": 7,
-            "width":100
-        },{
-            "label": "状态",
-            "prop": "status",
-            "type":"select",
-            "dicData":[{
-                "label":"正常",
-                "value":0
-            },{
-                "label":"停用",
-                "value":1
-            }],
-            "search": true,
-            "index": 8,
-            "width":100
-        },{
-            "label": "最后更新时间",
-            "prop": "updateTime",
-            "search": true,
-            "index": 9,
-            "width":100
+          "label": "停用",
+          "value": 1
         }
-    ]
+      ],
+      "search": true,
+      "index": 4,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "创建时间",
+      "prop": "createTime",
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "search": true,
+      "index": 5,
+      "width": 100,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "overHidden": true,
+      "pickerOptions": {}
+    },
+    {
+      "label": "有效期开始时间",
+      "prop": "startTime",
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "search": true,
+      "index": 6,
+      "width": 100,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "overHidden": true,
+      "pickerOptions": {}
+    },
+    {
+      "label": "有效期结束时间",
+      "prop": "endTime",
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "search": false,
+      "index": 7,
+      "width": 100,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "overHidden": true,
+      "pickerOptions": {}
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "search": false,
+      "index": 8,
+      "width": 100,
+      "overHidden": true
+    }
+  ]
 }

+ 32 - 0
src/views/maintenance/salesPolicy/detailsPageEdit.vue

@@ -29,6 +29,9 @@
                     <el-option v-for="item in item.dicData" :label="item.label" :value="item.value"></el-option>
                   </el-select>
                 </span>
+                <selectComponent v-else-if="item.prop === 'corps'" v-model="form[item.prop]"
+                                 :configuration="configuration" style="width: 100%"/>
+                <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled"></el-input>
                 <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled?item.disabled:false"></el-input>
               </el-form-item>
             </el-col>
@@ -98,6 +101,13 @@ export default {
   name: "detailsPage",
   data() {
     return {
+      configuration: {
+        multipleChoices: true,
+        multiple: true,
+        collapseTags: false,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
+      },
       form: {},
       disabled: false,
       customerContact: customerContact,
@@ -183,6 +193,7 @@ export default {
           //多选
             label: '代理商',
             prop: 'corps',
+            span: 16,
             rules: [
               {
                 required: true,
@@ -190,6 +201,15 @@ export default {
                 trigger: 'blur'
               }
             ]
+          },
+          {
+            label: "备注",
+            type: 'textarea',
+            span: 24,
+            prop: "remarks",
+            mock: {
+              type: 'county'
+            }
           }
         ]
       }
@@ -200,6 +220,10 @@ export default {
     if (this.$route.query.id) {
       detail(JSON.parse(this.$route.query.id)).then(res =>{
         this.form = res.data.data
+        if (this.form.corpNameList) {
+          this.configuration.dicData = this.form.corpNameList
+        }
+        this.form.corps = this.form.corps.split(',')
         if (res.data.data.specialItemList) this.contactsData = res.data.data.specialItemList
         if (res.data.data.presentItemList) this.contactsDataBuyFree = res.data.data.presentItemList
         delete this.form.specialItemList
@@ -316,6 +340,7 @@ export default {
       console.log(this.form)
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          this.form.corps = this.form.corps.join(',')
           this.form.specialItemList = this.contactsData
           this.form.presentItemList = this.contactsDataBuyFree
           typeSave(this.form).then(res=>{
@@ -391,4 +416,11 @@ export default {
     }
   }
 }
+::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+::v-deep .el-form-item__content{
+  line-height: 32px;
+}
 </style>

+ 41 - 3
src/views/maintenance/salesPolicy/index.vue

@@ -5,6 +5,7 @@
                ref="crud"
                v-model="form"
                :page.sync="page"
+               :search.sync="search"
                @row-del="rowDel"
                @row-update="rowUpdate"
                :before-open="beforeOpen"
@@ -18,6 +19,18 @@
                @refresh-change="refreshChange"
                @on-load="onLoad"
                @tree-load="treeLoad">
+      <template slot-scope="{}" slot="startTimeSearchLabel">
+        <span>有效日期:</span>
+      </template>
+      <template slot="corpsSearch">
+        <select-component
+          v-model="search.corps"
+          :configuration="configuration"
+        ></select-component>
+      </template>
+      <template slot-scope="scope" slot="corps">
+        {{ scope.row.corps }}
+      </template>
       <template slot-scope="scope" slot="menu">
         <el-button
             type="text"
@@ -55,6 +68,15 @@ export default {
     return {
       form: {},
       option: option,
+      search: {},
+      configuration: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+        clearable: true
+      },
       parentId: 0,
       dataList: [],
       page: {
@@ -65,8 +87,15 @@ export default {
     }
   },
   created() {
-    console.log('wangbadan')
-    // this.onLoad()
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0){
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
@@ -154,7 +183,16 @@ export default {
     },
     //点击搜索按钮触发
     searchChange(params, done) {
-      console.log(params)
+      if (params.createTime) {
+        params.createTimeStart = params.createTime[0]+ " " + "00:00:00"
+        params.createTimeEnd = params.createTime[1]+ " " + "23:59:59"
+        delete params.createTime;
+      }
+      if (params.startTime) {
+        params.dateValidityStart = params.startTime[0]+ " " + "00:00:00"
+        params.dateValidityEnd = params.startTime[1]+ " " + "23:59:59"
+        delete params.startTime;
+      }
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done()