车间管理 修改完成之后,再次打开 爆红的问题修改+新建薪资方案的前端开发+
2个文件已添加
6个文件已修改
422 ■■■■■ 已修改文件
src/api/data.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/style/index.scss 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/employeeSalary/salaryPlan/components/ConstantSetDialog.vue 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/employeeSalary/salaryPlan/components/SilkSetDialog.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/employeeSalary/salaryPlan/components/addDialog.vue 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/employeeSalary/salaryPlan/components/bomDialog.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/silkStandardSetting/components/silkTableList.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/workshopManage/components/addDialog.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/data.js
@@ -12,10 +12,17 @@
  { id: 3, value: "休假" },
  { id: 4, value: "异常" },
]
const silkSet=[
  { id: 1, value: "野纤" },
  { id: 2, value: "大野" },
  { id: 3, value: "特野" },
]
export const getDataByType = (type) => {
  if (type == "projectOptions") {
    return projectOptions
  }else if(type=='attendanceStatus'){
    return attendanceStatus
  }else if(type=='silkSet'){
    return silkSet;
  }
}
src/assets/style/index.scss
@@ -123,6 +123,9 @@
.font_size_40 {
  font-size: 40px !important;
}
.color_fff {
  color: #fff;
}
.color_333 {
  color: #333;
}
@@ -144,6 +147,17 @@
.background_blue{
  background: #2a78fb;
}
.background_e3e3e3{
  background: #e3e3e3;
}
.background_red{
  background: red;
}
.formula-input-item{
  padding:3px 8px;
  font-size:12px;
  margin-right:3px;
}
.cursor_pointer {
  cursor: pointer;
}
src/views/employeeSalary/salaryPlan/components/ConstantSetDialog.vue
New file
@@ -0,0 +1,149 @@
<template>
  <el-dialog :close-on-click-modal="false" :visible.sync="islook" width="35rem" class="add-rule-set-dialog"
    @close="shutdown">
    <div slot="title" class="tac drawerHeader">{{ title }}</div>
    <div class="dialog-content-box">
      <el-form ref="form" class="form-box" :rules="rules"
       :model="form"
       label-width="150px"
        label-position="right">
              <el-form-item v-if="constType==2" label="缺勤超过" label-width="100px" prop="cycle">
                <el-input
                  style="width:calc(100% - 150px)"
                  class="margin_left_5px margin_right_5px"
                  v-model="form.cycle"
                  placeholder="请输入"></el-input>
                  天则满勤奖全额扣除
              </el-form-item>
              <el-form-item v-if="constType==3" label="请输入常量数值" label-width="150px" prop="number">
                <el-input
                 v-model="form.number"
                 class="margin_left_5px"
                  placeholder="请输入"></el-input>
              </el-form-item>
      </el-form>
    </div>
    <div slot="footer" class="dialog-footer tac">
      <el-button @click="shutdown">取消</el-button>
      <el-button type="primary" @click="onSubmit(form)">确定</el-button>
    </div>
  </el-dialog>
</template>
<script>
export default {
  props: {
    constType:{
      type:[Number,String],
      default:''
    },
    title:{
      type:[String,Number],
      default:''
    },
    editRow:{
      type:[Object],
    }
  },
  data() {
    return {
      islook: false,
      form: {
        cycle:1,
        number:'',
      },
      rules: {
        cycle: [
          {
            required: true,
            message: "请输入",
            trigger: "blur",
          },
          {
            validator: this.validatorNum,
            trigger: "blur",
          },
        ],
        number: [
          {
            required: true,
            message: "请输入",
            trigger: "blur",
          },
          {
            validator: this.validatorNum,
            trigger: "blur",
          },
        ],
      },
      procedureIdsList: [],
    };
  },
  mounted() {
  },
  watch: {
    islook(newVal) {
      if (newVal) {
        this.$nextTick(() => {
          this.$refs["form"].resetFields();
        });
        this.form.cycle=this.editRow.cycle
        this.form.number=null
      }
    },
  },
  methods: {
    validatorNum(rule, value, callback) {
      if (value) {
        if (value == undefined || value == null) {
          callback(new Error("请输入有效数字"));
        } else {
          let reg2 =
            /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
          if (!reg2.test(value)) {
            callback(new Error("请填写2位小数的数字"));
          } else {
            callback();
          }
        }
      } else {
        callback();
      }
    },
    onSubmit() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$emit('confirmValueSave',this.form,this.constType)
          this.shutdown()
        }
      });
    },
    shutdown() {
      this.islook = false;
    },
  },
};
</script>
<style lang="scss" scoped>
.add-rule-set-dialog {
  .form-box {
    width:94%;
    .el-form-item {
      width: 100%;
      .el-radio{
        height:40px;
        line-height:40px;
      }
    }
  }
}
::v-deep .el-input__inner {
  font-size: 13px !important;
  color: rgba(0, 0, 0, 0.9);
  text-align: left;
}
</style>
src/views/employeeSalary/salaryPlan/components/SilkSetDialog.vue
New file
@@ -0,0 +1,106 @@
<template>
  <el-dialog :close-on-click-modal="false" :visible.sync="islook" width="35rem" class="add-rule-set-dialog"
    @close="shutdown">
    <div slot="title" class="tac drawerHeader">{{ title }}</div>
    <div class="dialog-content-box">
      <el-form ref="form" class="form-box" :rules="rules"
       :model="form"
       label-width="300px"
        label-position="top">
        <el-form-item label="请选择野纤包含那几个生丝标准:" prop="purchaseTypeList">
              <el-checkbox-group v-model="form.purchaseTypeList">
                <el-checkbox
                  v-for="item in silkSetList"
                  :label="item.id"
                  :key=item.id
                  >{{ item.value }}</el-checkbox
                >
              </el-checkbox-group>
        </el-form-item>
      </el-form>
    </div>
    <div slot="footer" class="dialog-footer tac">
      <el-button @click="shutdown">取消</el-button>
      <el-button type="primary" @click="onSubmit(form)">确定</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { getDataByType } from "@/api/data"
export default {
  props: {
    title:{
      type:[String,Number],
      default:''
    },
    editRow:{
      type:[Object],
    }
  },
  data() {
    return {
      islook: false,
      silkSetList:getDataByType('silkSet'),
      form: {
        purchaseTypeList:[1],
      },
      rules: {
        // 采购类型
        purchaseTypeList: [
          { required: true, message: "请选择", trigger: ["blur",'change'] },
        ],
      },
      procedureIdsList: [],
    };
  },
  mounted() {
  },
  watch: {
    islook(newVal) {
      if (newVal) {
        this.$nextTick(() => {
          this.$refs["form"].resetFields();
        });
        this.form=this.editRow
      }
    },
  },
  methods: {
    onSubmit() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$emit('confirmValueSave',this.form,1)
          this.shutdown()
        }
      });
    },
    shutdown() {
      this.islook = false;
    },
  },
};
</script>
<style lang="scss" scoped>
.add-rule-set-dialog {
  .form-box {
    width:93%;
    margin: 0 auto;
    .el-form-item {
      width: 100%;
      .el-radio{
        height:40px;
        line-height:40px;
      }
    }
  }
}
::v-deep .el-input__inner {
  font-size: 13px !important;
  color: rgba(0, 0, 0, 0.9);
  text-align: left;
}
</style>
src/views/employeeSalary/salaryPlan/components/addDialog.vue
@@ -56,15 +56,21 @@
          ></i>
        </el-form-item>
        <el-form-item prop="salaryFormula" label="计费公式定义">
          <el-input
          <!-- <el-input
            type="textarea"
            :autosize="{ minRows: 4, maxRows: 6}"
            disabled
            placeholder="请输入内容"
            v-model="form.salaryFormula"
          >
          </el-input>
          </el-input> -->
          <div class="formula-input" v-html="form.salaryFormula"></div>
          <el-button class='formula-btn' type="text" @click="checkFormula()">检查公式</el-button>
        </el-form-item>
        <div class="formula-error" >
         <span v-if="form.error==1"> 无错误,可放心使用 ! </span>
         <span v-if="form.error==2"> 公式有错误,请检查 ! </span>
        </div>
        <div class="formula-box">
          <div class="table-bottom-tabs">
            <div
@@ -93,12 +99,24 @@
              <div class="formula-p">可选数据</div>
              <div class="formula-bottom" v-if="activeName==1">
                <div  :class="item.width==2?'formula-item-100':'formula-item'" v-for='item in formulaName' :key="item.name">
                 <span @click="formulaClick(item)"> {{ item.name }}</span>
                  <span @click="formulaClick(item)"> {{ item.name }}</span>
                    <i
                      v-if="item.type==1"
                      class="el-icon-setting margin_left_5px  cursor_pointer"
                      style="font-size: 18px; color: gray"
                      @click="handleSlikSetShow"
                    ></i>
                </div>
              </div>
              <div class="formula-bottom" v-if="activeName==2">
                <div  :class="item.width==2?'formula-item-100':'formula-item'" v-for='item in formulaNameTwo' :key="item.name">
                 <span @click="formulaClick(item)"> {{ item.name }}</span>
                 <i
                      v-if="item.type==2"
                      class="el-icon-setting margin_left_5px  cursor_pointer"
                      style="font-size: 18px; color: gray"
                      @click="handleConstSetShow(2)"
                    ></i>
                </div>
              </div>
            </div>
@@ -106,7 +124,8 @@
              <div class="formula-p">常用符号/产量</div>
              <div class="formula-bottom">
                <div  :class="item.width==2?'formula-item-100':'formula-item'" v-for='item in formulaSymbol' :key="item.name">
                  <span @click="formulaClick(item)"> {{ item.name }}</span>
                  <span v-if="item.type==3" @click="handleConstSetShow(3)"> {{ item.name }}</span>
                  <span v-else @click="formulaClick(item)"> {{ item.name }}</span>
                </div>
              </div>
            </div>
@@ -124,6 +143,19 @@
      :workList="unitList"
      title="计量单位"
    ></BomDialog>
    <SilkSetDialog
      ref="silkSetDialog"
      @confirmValueSave="confirmValueSave"
      :editRow="form"
      title="配置"
    ></SilkSetDialog>
    <ConstantSetDialog
      ref="constantSetDialog"
      @confirmValueSave="confirmValueSave"
      :constType="constType"
      :editRow="form"
      :title="constType==2?'配置':'输入'"
    ></ConstantSetDialog>
  </div>
</template>
@@ -135,8 +167,14 @@
} from "@/api/employeeSalary/salaryPlan.js";
import { getWorkTypeList } from "@/api/employeeManage/employeeInfo.js";
import BomDialog from "@/views/employeeSalary/salaryPlan/components/bomDialog.vue";
import SilkSetDialog from "@/views/employeeSalary/salaryPlan/components/SilkSetDialog.vue";
import ConstantSetDialog from "@/views/employeeSalary/salaryPlan/components/ConstantSetDialog.vue";
export default {
  components: { BomDialog },
  components: {
    BomDialog,
    SilkSetDialog,
    ConstantSetDialog
   },
  props: {
    editRow: {
      type: Object,
@@ -144,12 +182,15 @@
  },
  data() {
    return {
      islook: true,
      islook: false,
      form: {
        name: "",
        workTypes: [],
        salaryType: "",
        salaryFormula: "",
        error:'',
        purchaseTypeList:[1],
        cycle:1,
      },
      activeName: 1,
      formulaName:[
@@ -187,7 +228,7 @@
        },
        {
          name:'满勤奖',
          type:1,
          type:2,
        },
        {
          name:'休息日加班时长',
@@ -208,15 +249,19 @@
      formulaSymbol:[
        {
          name:'+',
          background:'background_red',
        },
        {
          name:'-',
          background:'background_red',
        },
        {
          name:'/',
          background:'background_red',
        },
        {
          name:'*',
          background:'background_red',
        },
        {
          name:'(',
@@ -226,7 +271,7 @@
        },
        {
          name:'常量数字',
          type:1,
          type:3,
          width:2
        },
      ],
@@ -250,6 +295,7 @@
        ],
      },
      unitList: [],
      constType:'',
    };
  },
  computed: {},
@@ -271,6 +317,43 @@
  methods: {
    tabClickBottom(activeName) {
      this.activeName = activeName;
    },
    // 点击生产数据和考勤及补贴数据 赋值计费公式定义
    formulaClick(item,value){
      let string=''
      let name=(item.type==3&&item.name=='常量数字')?value:item.name
      if(item.background){
        string="<span class='formula-input-item background_red color_fff'>"+ name +"</span>"
      }else{
        string="<span class='formula-input-item background_e3e3e3'>"+ name +"</span>"
      }
      this.form.salaryFormula= this.form.salaryFormula+string;
      this.$forceUpdate()
    },
    checkFormula(){
    },
    confirmValueSave(form,type){
      if(type==1){
        this.form.purchaseTypeList=form.purchaseTypeList;
      }else if(type==2){
        this.form.cycle=form.cycle
      }else if(type==3){
        this.formulaClick({
          name:'常量数字',
          type:3,
          width:2
        },form.number)
      }
    },
    // 野纤数量
    handleSlikSetShow(){
      this.$refs.silkSetDialog.islook = true;
    },
    // 满勤奖
    handleConstSetShow(val){
      this.constType=val;
      this.$refs.constantSetDialog.islook = true;
    },
    // 单位
    handleUnitShow() {
@@ -304,15 +387,14 @@
          workTypes: [],
          salaryType: "",
          salaryFormula: "",
          error:'',
          purchaseTypeList:[1],
          cycle:1,
        };
        this.$nextTick(() => {
          this.$refs["form"].resetFields();
          if (this.editRow.id) {
            this.form = JSON.parse(JSON.stringify(this.editRow));
            this.form.groupNumber = this.form.groupNumber
              ? this.form.groupNumber
              : null;
            this.getGroupNumber(true);
          }
        });
      }
@@ -339,6 +421,10 @@
      this.$refs[formName].validate((valid) => {
        if (valid) {
          let form = JSON.parse(JSON.stringify(this.form));
          if(form.purchaseTypeList.length==0){
            this.$message.error('请点击野纤数量配置生丝标准!')
            return true;
          }
          saveSalaryPlan(form).then((res) => {
            if (res.code == 200) {
              this.$message({
@@ -372,6 +458,7 @@
      width:100%;
      height:auto;
      overflow:hidden;
      margin-bottom:30px;
      .formula-p{
        line-height:40px;
      }
@@ -412,8 +499,27 @@
        overflow:hidden;
      }
    }
  }
  .formula-input{
      width:calc(100% - 100px);
      height:100px;
      padding:10px 10px;
      overflow-y:auto;
      background:#F5F7FA;
      border:1px solid #E4E7ED;
      cursor:not-allowed;
      float:left;
      margin-right:20px;
    }
    .formula-btn{
      float:left;
      margin-top:80px;
    }
    .formula-error{
      width:100%;
      line-height:28px;
      font-size:12px;
    }
}
::v-deep {
src/views/employeeSalary/salaryPlan/components/bomDialog.vue
@@ -38,7 +38,7 @@
            <i
              class="el-icon-delete cursor_pointer"
              id="iconStyle"
              @click="handleDelete(scope.row.id, scope)"
              @click="handleDelete(scope)"
            ></i>
          </template>
        </el-table-column>
@@ -102,7 +102,7 @@
        }, 500);
      });
    },
    handleDelete(id, scope) {
    handleDelete(scope) {
      if (this.BomTableData.length === 1) {
        this.$message.warning("至少保留一条数据");
        return;
src/views/systemSetting/silkStandardSetting/components/silkTableList.vue
@@ -47,7 +47,6 @@
                      }
                    "
                  ></el-input>
                  {{item.prop}}
                  <div class="common-select-btn" @click="clearupColumn(item.prop,i)">
                    <i class="el-icon-remove" title="删除"></i>
                  </div>
src/views/systemSetting/workshopManage/components/addDialog.vue
@@ -138,7 +138,14 @@
  },
  watch: {
    'editConfig.visible'(newVal) {
      if (newVal) {
        this.$nextTick(()=>{
          this.$refs["ruleForm"].resetFields();
          this.editConfig=this.editDiaConfig
        })
      }
    },
  },
  methods: {
    handleClose(done) {