1
Surpriseplus
2022-10-09 604cf458b39451a82b4bd7a64f0dd578dc2bd644
src/views/datamanage/styleManage.vue
@@ -266,7 +266,7 @@
    </div>
    <el-dialog
      title="修改详情"
      top="5vh"
      top="2vh"
      style="overflow: hidden"
      :before-close="removeUpdate"
      :visible.sync="dialogFormVisible"
@@ -376,8 +376,8 @@
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="removeUpdate">取 消</el-button>
        <el-button type="primary" @click="updateForm">确 定</el-button>
        <el-button @click="removeUpdate">{{$t('common.close')}}</el-button>
        <el-button type="primary" @click="updateForm">{{$t('common.confirm')}}</el-button>
      </div>
    </el-dialog>
    <el-dialog
@@ -491,8 +491,8 @@
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="insertFromDataClose">取 消</el-button>
        <el-button type="primary" @click="insertFromData">确 定</el-button>
        <el-button @click="insertFromDataClose">{{$t('common.close')}}</el-button>
        <el-button type="primary" @click="insertFromData">{{$t('common.confirm')}}</el-button>
      </div>
    </el-dialog>
    <div class="leftTree" v-if="showDirCata">
@@ -549,7 +549,6 @@
      showinfoBox: false,
      itemdetail: {},
      ruleForm: {
        name: '',
      },
      backupData: [],
@@ -567,7 +566,6 @@
      count: 0,
      listData: {
        name: null,
        depName: null,
        pageIndex: 1,
        pageSize: 10,
      },
@@ -618,10 +616,8 @@
    },
    selectDepCataName() {
      this.showDepCata = false;
      console.log(this.depFlag)
      switch (this.depFlag) {
        case 0:
          // var data = this.$store.state.styleDirCateNodes;
          this.insertform.depValue = this.$store.state.styleDepCateNodes.name;
          this.insertform.depid = this.$store.state.styleDepCateNodes.id;
          break;
@@ -677,6 +673,7 @@
      if (this.listData.tab == '') {
        delete this.listData.tab;
      }
      this.listData.name = this.ruleForm.name;
      const data = await select_Style_ByPageAndCount(this.listData);
      if (data.code != 200) {
        this.$message.error('列表调用失败');
@@ -696,8 +693,11 @@
    },
    formatStatus(row, column) {
      let date = row[column.property];
      return this.forMontStatus(date);
    },
    forMontStatus(date) {
      if (date === undefined || date === null) {
        return '';
        return;
      }
      switch (date) {
        case 1:
@@ -805,15 +805,34 @@
    addstyle() {
      this.$router.push('/addstyle');
    },
   async updateForm() {
  if (this.upform.dirid == null || this.upform.depid == null) {
    statusFormat(res){
      switch(res){
        case "启用":
          return 1;
          break;
           case "停用":
             return 0;
          break;
           case "Start Using":
          return 1;
          break;
           case "Stop Using":
             return 0;
          break;
      }
    },
    async updateForm() {
      if (this.upform.dirid == null || this.upform.depid == null) {
        this.$message({
          message: '请选择样式所属的目录或单位',
          type: 'warning',
        });
        return;
      }
      const data = await updateStyle(this.upform);
    if(Number.isInteger(this.upform.status) == false){
      this.upform.status = this.statusFormat(this.upform.status)
    }
     const data = await updateStyle(this.upform);
      if (data.code == 200) {
        this.dialogFormVisible = false;
        this.upform = {};
@@ -835,26 +854,30 @@
    removeUpdate() {
      this.upflag = false;
      this.dialogFormVisible = false;
      this.upform={}
      this.upform = {}
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.searchName = this.ruleForm.name.trim();
          this.startFromData();
        } else {
          console.log('error submit!!');
          return false;
        }
      });
      this.getRoleTabelData()
      // this.$refs[formName].validate((valid) => {
      //   if (valid) {
      //     this.searchName = this.ruleForm.name.trim();
      //     this.startFromData();
      //   } else {
      //     console.log('error submit!!');
      //     return false;
      //   }
      // });
    },
    resetForm(formName) {
      this.ruleForm ={}
      this.getRoleTabelData();
    },
    showDetail(index, row) {
      this.showinfoBox = true;
      this.itemdetail = row;
      this.itemdetail.createTime = this.formomentTime(this.itemdetail.createTime);
      this.itemdetail.updateTime = this.formomentTime(this.itemdetail.updateTime);
    },
    closeDetial() {
      this.showinfoBox = false;
@@ -868,6 +891,7 @@
      this.upform = row;
      this.upform.depValue = row.depName;
      this.upform.dirValue = row.dirName;
      this.upform.status = this.forMontStatus(row.status)
    },
    handleDelete(index, row) {
      this.$confirm('确定是否删除?', '提示', {