xw 1 napja
szülő
commit
6d709ea2ff
2 módosított fájl, 58 hozzáadás és 1 törlés
  1. 57 0
      src/views/qw/sop/sop.vue
  2. 1 1
      src/views/qw/user/index.vue

+ 57 - 0
src/views/qw/sop/sop.vue

@@ -296,6 +296,13 @@
       <el-table-column label="修改操作" align="center" class-name="small-padding fixed-width" width="100px"
                        fixed="right">
         <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            v-hasPermi="['qw:sop:edit']"
+            @click="handleUpdateSopName(scope.row)"
+          >修改名称
+          </el-button>
           <el-button
             size="mini"
             type="text"
@@ -984,6 +991,19 @@
       </div>
     </el-dialog>
 
+    <!-- 修改规则名称对话框 -->
+    <el-dialog :title="updateSopNameDialog.title" :visible.sync="updateSopNameDialog.open" width="500px" append-to-body>
+      <el-form ref="updateSopNameForm" label-width="100px">
+        <el-form-item label="规则名称">
+          <el-input v-model="updateSopNameDialog.name" placeholder="请输入规则名称" maxlength="50" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitUpdateSopName">确 定</el-button>
+        <el-button @click="updateSopNameDialog.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -1132,6 +1152,12 @@ export default {
         isRating: null,
         isSampSend:null,
       },
+      updateSopNameDialog: {
+        title: '修改规则名称',
+        open: false,
+        id: null,
+        name: ''
+      },
       voiceForm: {
         list: [],
         open: false,
@@ -1810,6 +1836,37 @@ export default {
       this.$router.push('/qw/sop/updateSop/' + row.id + '/' + type)
     },
 
+    /** 修改规则名称 */
+    handleUpdateSopName(row) {
+      this.updateSopNameDialog.id = row.id;
+      this.updateSopNameDialog.name = row.name;
+      this.updateSopNameDialog.open = true;
+    },
+
+    /** 提交修改规则名称 */
+    submitUpdateSopName() {
+      if (!this.updateSopNameDialog.name || this.updateSopNameDialog.name.trim() === '') {
+        this.$message.error('规则名称不能为空');
+        return;
+      }
+      const data = {
+        id: this.updateSopNameDialog.id,
+        name: this.updateSopNameDialog.name
+      };
+      this.$confirm('是否确认修改规则名称为"' + data.name + '"?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        return updateSop(data);
+      }).then(response => {
+        this.msgSuccess("修改规则名称成功");
+        this.updateSopNameDialog.open = false;
+        this.getList();
+      }).catch(() => {
+      });
+    },
+
 
     /**
      * 查看SOP任务内营期

+ 1 - 1
src/views/qw/user/index.vue

@@ -66,7 +66,7 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索1</el-button>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>