Selaa lähdekoodia

Merge branch 'dev_info' into 'master'

Dev info

See merge request spfm/spfm-market-front!119
徐兴安 3 vuotta sitten
vanhempi
commit
da9ef89a53

+ 148 - 9
src/pages/main/performance/components/form.vue

@@ -2,11 +2,16 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:03:02
  * @LastEditors: daiqisheng
- * @LastEditTime: 2022-04-22 15:32:04
+ * @LastEditTime: 2022-04-25 12:16:31
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\form.vue
 -->
 <template>
-  <el-form :inline="true" :model="object">
+  <el-form
+    :inline="true"
+    :model="object"
+    label-position="left"
+    label-width="80px"
+  >
     <!-- <el-row :gutter="24" v-if="form.length < 5">
       <el-col
         v-for="({ props, label, type, dictionary }, index) in form"
@@ -74,9 +79,134 @@
         </el-button>
       </el-col>
     </el-row> -->
-    <div v-if="form.length < 5" class="template-input">
+
+    <div v-if="form.length < 5" class="margin-bottom-10">
+      <div class="template-input width-100">
+        <div class="template-input width-80">
+          <div
+            class="margin-right-10"
+            v-for="({ props, label, type, dictionary }, index) in form.slice(
+              0,
+              2
+            )"
+            :key="index"
+          >
+            <el-form-item :label="label">
+              <template v-if="type === 'select'">
+                <el-select
+                  v-model="object[props]"
+                  :placeholder="label"
+                  filterable
+                  clearable
+                >
+                  <el-option
+                    :label="label"
+                    :value="value"
+                    v-for="({ label, value }, index) in dictionary"
+                    :key="index"
+                  ></el-option>
+                </el-select>
+              </template>
+              <template
+                v-else-if="['datetime', 'date', 'month'].includes(type)"
+              >
+                <el-date-picker
+                  v-model="object[props]"
+                  :type="type"
+                  :placeholder="label"
+                >
+                </el-date-picker>
+              </template>
+              <template v-else-if="type === 'dateRange'">
+                <el-date-picker
+                  v-model="object[props]"
+                  type="datetimerange"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                >
+                </el-date-picker>
+              </template>
+              <template v-else>
+                <el-input
+                  v-model="object[props]"
+                  :placeholder="label"
+                  clearable
+                ></el-input>
+              </template>
+            </el-form-item>
+          </div>
+        </div>
+        <div class="width-20 flex-justify-align-end">
+          <el-form-item>
+            <el-button type="primary" @click="handleSearch">搜索</el-button>
+          </el-form-item>
+        </div>
+      </div>
+      <div class="template-input width-100 margin-top-10 margin-bottom-10">
+        <div
+          class="margin-right-10"
+          v-for="({ props, label, type, dictionary }, index) in form.slice(2)"
+          :key="index"
+          :span="6"
+        >
+          <el-form-item :label="label">
+            <template v-if="type === 'select'">
+              <el-select
+                v-model="object[props]"
+                :placeholder="label"
+                filterable
+                clearable
+              >
+                <el-option
+                  :label="label"
+                  :value="value"
+                  v-for="({ label, value }, index) in dictionary"
+                  :key="index"
+                ></el-option>
+              </el-select>
+            </template>
+            <template v-else-if="['datetime', 'date', 'month'].includes(type)">
+              <el-date-picker
+                v-model="object[props]"
+                :type="type"
+                :placeholder="label"
+              >
+              </el-date-picker>
+            </template>
+            <template v-else-if="type === 'dateRange'">
+              <el-date-picker
+                v-model="object[props]"
+                type="datetimerange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+              >
+              </el-date-picker>
+            </template>
+            <template v-else>
+              <el-input
+                v-model="object[props]"
+                :placeholder="label"
+                clearable
+              ></el-input>
+            </template>
+          </el-form-item>
+        </div>
+      </div>
+      <p class="width-100 flex-justify-align-end margin-top-10">
+        <el-button
+          v-for="({ label, props, unlogo }, index) in handle"
+          :key="index"
+          @click="handleSubmit(props)"
+        >
+          <i v-if="!unlogo" class="el-icon-document-add font-weight-bold" />{{
+            label
+          }}
+        </el-button>
+      </p>
       <!-- 输入框 -->
-      <div class="template-input">
+      <!-- <div class="template-input">
         <div
           class="flex-1 margin-right-10"
           v-for="({ props, label, type, dictionary }, index) in form"
@@ -126,9 +256,9 @@
             </template>
           </el-form-item>
         </div>
-      </div>
+      </div> -->
       <!-- 按钮 -->
-      <div class="template-input">
+      <!-- <div class="template-input">
         <el-form-item>
           <el-button type="primary" @click="handleSearch">搜索</el-button>
         </el-form-item>
@@ -143,7 +273,7 @@
             label
           }}
         </el-button>
-      </p>
+      </p> -->
     </div>
     <div v-else>
       <div class="template-content">
@@ -330,6 +460,15 @@ export default {
 .width-100 {
   width: 100%;
 }
+.width-80 {
+  width: 80%;
+}
+.width-20 {
+  width: 20%;
+}
+.border {
+  border: 1px solid red;
+}
 .template {
   &-head {
     display: flex;
@@ -340,8 +479,8 @@ export default {
   }
   &-input {
     display: flex;
-    flex-wrap: wrap;
-    margin-bottom: 10px;
+    // flex-wrap: wrap;
+    // margin-bottom: 10px;
   }
   &-content {
     display: flex;

+ 10 - 2
src/pages/main/performance/components/sheet.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-12-04 14:23:58
  * @LastEditors: daiqisheng
- * @LastEditTime: 2022-04-18 18:09:32
+ * @LastEditTime: 2022-04-25 19:11:41
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 <template>
@@ -692,6 +692,7 @@ export default {
           //   that.rowList.push(row);
           // },
           cellUpdateBefore: function (row, column) {
+            console.log(row, column);
             if (!that.handleAllow({ row, column })) {
               return false;
             }
@@ -707,13 +708,20 @@ export default {
               }
             }
           },
+          rangePasteBefore: function ([
+            { row_focus: row, column_focus: column },
+          ]) {
+            if (!that.handleAllow({ row, column })) {
+              that.$message.error("您没有编辑权限");
+              return false
+            }
+          },
           updated: function ({ range }) {
             const middle = range.map((el) => {
               return that.paramsArr(el.row[0], el.row[1]);
             });
             let changedList = middle.join(",").split(",");
             that.rowList.push(...changedList);
-            console.log(that.rowList, "that.rowList");
           },
         },
       };

+ 4 - 2
src/pages/main/performance/components/table.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-02-10 18:31:51
+ * @LastEditors: daiqisheng
+ * @LastEditTime: 2022-04-25 12:11:10
  * @FilePath     : /spfm-market-front/src/pages/main/performance/components/table.vue
 -->
 <template>
@@ -10,6 +10,7 @@
     class="simple-table"
     :data="computed_list"
     v-loading="loading"
+    style="width: 100%"
     @selection-change="handleSelectionChange"
   >
     <el-table-column
@@ -121,6 +122,7 @@
     </el-table-column>
     <el-table-column
       v-if="handleRow.length"
+      fixed="right"
       label="操作"
       :align="'center'"
       :width="handleRow.length * 50"

+ 3 - 1
src/pages/main/performance/department.vue

@@ -52,7 +52,9 @@
               <el-button
                 type="primary"
                 v-if="
-                  edit_form.status === '2' &&
+                  (edit_form.status === '2' ||
+                    edit_form.status === '6' ||
+                    edit_form.status === '7') &&
                   (duty === '7' || duty === '3' || duty === '4') &&
                   reviewType === duty
                 "

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 191 - 192
src/pages/main/performance/index.vue