970319330@qq.com пре 1 дан
родитељ
комит
7483834117


BIN
src/WebsiteManagement/.DS_Store


BIN
src/WebsiteManagement/marketproductMag/.DS_Store


+ 102 - 0
src/bgj/ServiceMaterialClass/component/saleclass/components/addTop.vue

@@ -0,0 +1,102 @@
+<template>
+  <div class="add">
+    <el-button size="mini" type="primary" @click="dialogVisible=true">{{$t(`新增一级分类`)}}</el-button>
+    <el-dialog
+      :title="$t(`新增一级分类`)"
+      :visible.sync="dialogVisible"
+      width="500px"
+      append-to-body
+      :before-close="handleClose">
+      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-width="tool.onlyZh('130px')" class="demo-ruleForm">
+        <el-form-item :label="$t(`类别名称`)" prop="itemclassname">
+          <div class="flex-align-center">
+            <el-input v-model="ruleForm.itemclassname" size="small" class="inline-16" :placeholder="$t(`请输入类别名称`)">
+            </el-input>
+            <el-input v-model="ruleForm.num" size="small" style="width:90px" :placeholder="$t(`排序`)">
+            </el-input>
+          </div>
+        </el-form-item>
+        <el-form-item :label="$t(`类别编号`)" prop="itemclassnum">
+          <el-input v-model="ruleForm.itemclassnum"  size="small" :placeholder="$t(`请输入类别编号`)"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-checkbox v-model="ruleForm.istool" :true-label="1" :false-label="0">{{$t(`是否工具`)}}</el-checkbox>
+          <el-checkbox v-model="ruleForm.ishide" :true-label="1" :false-label="0">{{$t(`是否隐藏`)}}</el-checkbox>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogVisible = false" size="small">{{$t('取 消')}}</el-button>
+          <el-button type="primary" @click="submit" size="small">{{$t('确 定')}}</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+export default {
+  name: 'addTop',
+  data() {
+    return {
+      currentData:'',
+      dialogVisible:false,
+      ruleForm: {
+        "itemclassnum":'',
+        "itemclassname":'',
+        "istool":0,
+        "ishide":0,
+        "num":''
+      },
+      rules:{
+        itemclassname: [
+          { required: true, message: this.$t('请输入类别名称'), trigger: 'blur' },
+        ],
+        itemclassnum: [
+          { required: true, message: this.$t('请输入类别编号'), trigger: 'blur' },
+        ],
+      }
+    }
+  },
+  props:['type','sa_brandid'],
+  computed:{
+  },
+  methods: {
+    handleClose() {
+      this.dialogVisible = false
+    },
+    submit() {
+      this.$refs.ruleForm.validate(async val => {
+        if(val) {
+          let res = await this.$api.requested({
+            "id": "20220922110306",
+            "version":1,
+            "content": {
+                "itemclassid":0,
+                "sc_brandid":this.sa_brandid,
+                "parentid":0,
+                "itemclassnum":this.ruleForm.itemclassnum,
+                "itemclassname":this.ruleForm.itemclassname,
+                "classtype":"营销",
+                "num":this.ruleForm.num || "1",
+                "ishide":this.ruleForm.ishide,
+                "istool":this.ruleForm.istool
+            }
+          })
+          this.tool.showMessage(res,() => {
+            this.$emit('addSuccess')
+            this.$refs.ruleForm.resetFields()
+            this.ruleForm.istool = 0
+            this.ruleForm.ishide = 0
+            this.dialogVisible = false
+          })
+        }
+      })
+    }
+  },
+};
+</script>
+
+<style scoped>
+</style>

+ 30 - 0
src/bgj/ServiceMaterialClass/component/saleclass/components/delete.vue

@@ -0,0 +1,30 @@
+<template>
+  <div class="padding-left:10px">
+    <el-popconfirm :confirm-button-text="$t('确定')" :cancel-button-text="$t('取消')" :title="$t('确定删除当前数据吗')+'?'" @confirm="deleteRow()">
+      <el-button size="mini" type="text"  slot="reference" icon="el-icon-delete">{{$t('删 除')}}</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ['id'],
+  methods: {
+    async deleteRow() {
+      let res = await this.$api.requested({
+          "id": "20220922110506",
+          "version":1,
+          "content": {
+              "itemclassid":this.id
+          }
+      })
+
+      this.tool.showMessage(res,() => {
+        this.$emit('deleteSuccess')
+      })
+    },
+  }
+}
+
+</script>
+</style>

+ 107 - 0
src/bgj/ServiceMaterialClass/component/saleclass/components/edit.vue

@@ -0,0 +1,107 @@
+<template>
+  <div class="add">
+    <el-button size="mini" type="text"  @click="dialogVisible=true" v-if="type === 'add'" icon="el-icon-plus">{{$t(`新增下级`)}}</el-button>
+    <el-button size="mini" type="text" @click="editBtn" icon="el-icon-edit"  v-else>{{$t('编 辑')}}</el-button>
+    <el-dialog
+      :title="type == 'add' ? $t('新增类别') : $t('编辑类别')"
+      :visible.sync="dialogVisible"
+      width="500px"
+      append-to-body
+      :before-close="handleClose">
+      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-width="tool.onlyZh('130px')" class="demo-ruleForm">
+        <el-form-item :label="$t(`类别名称`)" prop="itemclassname">
+          <div class="flex-align-center">
+            <el-input v-model="ruleForm.itemclassname" size="small" class="inline-16" :placeholder="$t(`请输入类别名称`)">
+            </el-input>
+            <el-input v-model="ruleForm.num" size="small" style="width:90px" :placeholder="$t(`排序`)">
+            </el-input>
+          </div>
+        </el-form-item>
+        <el-form-item :label="$t(`类别编号`)" prop="itemclassnum">
+          <el-input v-model="ruleForm.itemclassnum" :disabled="type!='add'" size="small" :placeholder="$t(`请输入类别编号`)"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-checkbox :disabled="type == 'add'" v-model="ruleForm.istool" :true-label="1" :false-label="0">{{$t(`是否工具`)}}</el-checkbox>
+          <el-checkbox v-model="ruleForm.ishide" :true-label="1" :false-label="0">{{$t(`是否隐藏`)}}</el-checkbox>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogVisible = false" size="small">{{$t('取 消')}}</el-button>
+          <el-button type="primary" @click="submit" size="small">{{$t('确 定')}}</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+export default {
+  name: 'edit',
+  data() {
+    return {
+      currentData:'',
+      dialogVisible:false,
+      ruleForm: {
+        "itemclassnum":'',
+        "itemclassname":'',
+        "istool":0,
+        "ishide":0,
+        "num":''
+      },
+      rules:{
+        itemclassname: [
+          { required: true, message: this.$t('请输入类别名称'), trigger: 'blur' },
+        ],
+        itemclassnum: [
+          { required: true, message: this.$t('请输入类别编号'), trigger: 'blur' },
+        ],
+      }
+    };
+  },
+  props:['type','rowData'],
+  computed:{
+  },
+  methods: {
+    editBtn() {
+      this.dialogVisible = true
+      this.ruleForm = Object.assign({},this.ruleForm,this.rowData)
+    },
+    handleClose() {
+      this.dialogVisible = false
+    },
+    submit() {
+      this.$refs.ruleForm.validate(async val => {
+        if(val) {
+          let res = await this.$api.requested({
+            "id": "20220922110306",
+            "version":1,
+            "content": {
+                "itemclassid":this.type == 'add' ? 0 : this.rowData.itemclassid,
+                "sc_brandid":this.rowData.sa_brandid,
+                "parentid":this.type == 'add' ? this.rowData.itemclassid : 0,
+                "itemclassnum":this.ruleForm.itemclassnum,
+                "itemclassname":this.ruleForm.itemclassname,
+                "classtype":"营销",
+                "num":this.ruleForm.num || "1",
+                "ishide":this.ruleForm.ishide,
+                "istool":this.ruleForm.istool
+            }
+          })
+          this.tool.showMessage(res,() => {
+            this.$emit('addSuccess')
+            this.$refs.ruleForm.resetFields()
+            this.ruleForm.istool = 0
+            this.ruleForm.ishide = 0
+            this.dialogVisible = false
+          })
+        }
+      })
+    }
+  },
+};
+</script>
+
+<style scoped>
+</style>

+ 157 - 0
src/bgj/ServiceMaterialClass/component/saleclass/index.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="brand">
+    <addTop class="mt-10" :sa_brandid="data.sa_brandid" @addSuccess="department"></addTop>
+    <el-table
+      :data="tableData"
+      stripe
+      row-key="itemclassid"
+      size="small"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
+      <el-table-column
+        width="120">
+      </el-table-column>
+      <el-table-column
+        prop="num"
+        :label="$t(`序号`)"
+        width="80">
+      </el-table-column>
+      <el-table-column
+        prop="itemclassfullname"
+        show-overflow-tooltip
+        :label="$t(`类别名称`)"
+        width="200">
+        <template slot-scope="scope">
+          <span style="color:#3874f6"><b>{{scope.row.itemclassfullname}}</b></span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="itemclassnum"
+        :label="$t(`类别编码`)">
+      </el-table-column>
+      <el-table-column
+        prop="itemclassname"
+        :label="$t(`类别简称`)">
+        <template slot-scope="scope">
+          <span style="color:#3874f6"><b>{{scope.row.itemclassname}}</b></span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="isdeep"
+        :label="$t(`是否末级`)">
+        <template slot-scope="scope">
+          {{scope.row.isdeep === 1?$t('是'):$t('否')}}
+        </template>
+      </el-table-column>
+       <el-table-column
+        prop="istool"
+        :label="$t(`是否工具`)">
+        <template slot-scope="scope">
+          {{scope.row.istool === 1?$t('是'):$t('否')}}
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="ishide"
+        :label="$t(`是否隐藏`)">
+         <template slot-scope="scope">
+          {{scope.row.ishide === 1?$t('是'):$t('否')}}
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('操作')"
+        width="250"
+        fixed="right">
+        <template slot-scope="scope">
+          <Edit class="inline-16" type="add" @addSuccess="addSuccess" :rowData="scope.row"/>
+          <Edit class="inline-16" type="edit" @addSuccess="addSuccess" :rowData="scope.row"/>
+          <Del  class="inline-16" :id="scope.row.itemclassid" @deleteSuccess="deleteSuccess"/>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import addTop from './components/addTop.vue'
+import Edit from './components/edit.vue'
+import Del from './components/delete.vue'
+export default {
+  props:['data'],
+  components:{
+    addTop,
+    Edit,
+    Del
+  },
+  data() {
+    return {
+      tableData:[]
+    }
+  },
+  created() {
+  },
+  methods: {
+    async department (callback) {
+      // ID20230325141106
+      const res = await this.$api.requested({
+        "id": "20230325141106",
+        "content": {
+          "sc_brandid":this.data.sa_brandid
+        }
+      })
+      this.tableData = this.createTreeData(res.data[0].ttemclass)
+      console.log(this.tableData);
+    },
+    createTreeData (array) {
+      var that = this
+      let arr = []
+      function convertToElementTree(node) {
+        var id = node.itemclassid || node.sc_itemclassid
+        if (!id) {
+          return null
+        }
+        var elNode = {
+          num:node['num'],
+          itemclassfullname:node['itemclassfullname'],
+          itemclassname: node["itemclassname"],
+          parentid:node['parentid'],
+          itemclassid:id,
+          itemclassnum:node['itemclassnum'],
+          sa_brandid:that.data.sa_brandid,
+          ishide:node['ishide'],
+          isdeep:node['isdeep'],
+          istool:node['istool'],
+          children: []
+        }
+
+        if (node.subdep && node.subdep.length > 0) {
+          for (var index = 0; index < node.subdep.length; index++) {
+            var child = convertToElementTree(node.subdep[index]);
+            if (child) {
+              elNode.children.push(child);
+            }
+          }
+        }
+        return elNode;
+      }
+      array.forEach((element) => {
+        var result = convertToElementTree(element)
+        if (result) {
+          arr.push(result)
+        }
+      });
+      return arr
+    },
+    addSuccess() {
+      this.department()
+    },
+    deleteSuccess() {
+      this.department()
+    }
+  },
+  mounted () {
+    this.department()
+  }
+};
+</script>
+
+<style scoped>
+</style>

+ 60 - 0
src/bgj/ServiceMaterialClass/index.vue

@@ -0,0 +1,60 @@
+<template>
+  <div>
+    <basicLayout
+      ref="basicLayout"
+      :oldFormPath="{
+        add:'bgj/ServiceMaterialClass/modules',
+      }"
+      tableName="brandTable"
+      idName="sa_brandid"
+      :apiId="{query:20220922110406,del:20220922085203}"
+      :options="options"
+    >
+      <div slot="custom">
+      </div>
+      <div slot="titleRight" style="display:flex;margin-left:10px">
+      </div>
+      <template v-slot:tbList="scope">
+        <div v-if="scope.data.column.columnname === 'brandLoge'">
+          <previewImage v-if="scope.data.column.data.attinfos && scope.data.column.data.attinfos[0]" style="height:40px;width:40px;" :image="scope.data.column.data.attinfos[0]" :list="scope.data.column.data.attinfos" :deletebtn="false"></previewImage>
+        </div>
+        <div v-else>
+          {{$t(scope.data.column.data[[scope.data.column.columnname]])}}
+        </div>
+      </template>
+      <template v-slot:tbOpreation="scope">
+        <edit v-if="tool.checkAuth($route.name,'update')" :data="scope.data.data" @onSuccess="$refs.basicLayout.listData()" :type="'text'"></edit>
+        <brand_del v-if="tool.checkAuth($route.name,'onDelete')" :data="scope.data.data" @onSuccess="$refs.basicLayout.listData()" :type="'text'"></brand_del>
+      </template>
+    </basicLayout>
+  </div>
+</template>
+
+<script>
+import edit from './modules/edit'
+import brand_del from './modules/delete'
+import previewImage from '@/components/previewImage/index'
+
+export default {
+  components:{
+    edit,
+    brand_del,
+    previewImage
+  },
+  data () {
+    return {
+      options:[
+      ],
+      search: {}
+
+    }
+  },
+  computed:{
+  },
+  methods:{
+  }
+}
+
+</script>
+<style>
+</style>

+ 87 - 0
src/bgj/ServiceMaterialClass/modules/add.vue

@@ -0,0 +1,87 @@
+<template>
+  <div>
+    <!-- <el-button size="small" type="primary" @click="onShow" >{{$t('新 建')}}</el-button> -->
+    <el-drawer
+      :title="$t(`新增品牌`)"
+      :visible.sync="drawer"
+      :wrapperClosable="false"
+      size="800px"
+      direction="rtl"
+      :show-close="false"
+      append-to-body
+      @close="drawer = false;form.brandName = ''">
+      <div class="drawer__panel">
+      <div>
+        <el-row :gutter="50">
+          <el-form :model="form" :rules="rules"  ref="form"  size="mini" label-position="right" :label-width="tool.onlyZh('80px')">
+            <el-col :span="20">
+              <el-form-item prop="brandName" :label="$t(`品牌名称`)">
+                <el-input v-model="form.brandName" :placeholder="$t(`输入品牌名称`)"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="drawer = false;form.brandName = ''" class="normal-btn-width">{{$t('取 消')}}</el-button>
+        <el-button size="small" type="primary" @click="onSubmit"  class="normal-btn-width">{{$t('确 定')}}</el-button>
+      </div>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "add",
+  data(){
+    return {
+      drawer:false,
+      url:null,
+      rules:{
+        brandName: [
+          { required: true, message: this.$t('品牌名称不可为空'), trigger: 'blur' },
+        ],
+      },
+      form:{
+        brandName:''
+      },
+    }
+  },
+  components:{
+  },
+  methods:{
+    onShow (){
+      this.drawer = true
+    },
+    onClose () {
+      this.form = {
+         brandName:''
+      }
+    },
+    onSubmit () {
+      this.$refs['form'].validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": "20220922085003",
+          "version": 1,
+          "content": {
+            "sa_brandid": 0,
+            "brandname": this.form.brandName
+          }
+        })
+        this.tool.showMessage(res, () => {
+          this.ownerid = res.data
+          this.drawer = false
+          this.form.brandName = ''
+          this.$emit('onSuccess')
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 35 - 0
src/bgj/ServiceMaterialClass/modules/delete.vue

@@ -0,0 +1,35 @@
+<template>
+  <div class="inline-16">
+    <el-popconfirm :confirm-button-text="$t('确定')" :cancel-button-text="$t('取消')"
+        :title="$t(`确定删除当前选中品牌吗`)+'?'"
+        @confirm="deleteRow()">
+      <el-button slot="reference" size="small" type="text">{{$t('删 除')}}</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "delete",
+  props:['data'],
+  methods: {
+    async deleteRow(){
+      const res = await this.$api.requested({
+        "id": "20220922085203",
+        "version":1,
+        "content": {
+          "sa_brandid": this.data.sa_brandid
+        }
+      })
+      this.tool.showMessage(res, () => {
+        console.log(res)
+        this.$emit('onSuccess')
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 99 - 0
src/bgj/ServiceMaterialClass/modules/edit.vue

@@ -0,0 +1,99 @@
+<template>
+  <div class="inline-16">
+    <el-button size="small" type="text" @click="onShow">{{$t('编 辑')}}</el-button>
+    <el-drawer
+      :title="$t(`编辑品牌`)"
+      :visible.sync="drawer"
+      :wrapperClosable="false"
+      size="90%"
+      direction="rtl"
+      :show-close="false"
+      append-to-body>
+      <div class="drawer__panel">
+        <el-form  :model="form" :rules="rules"  ref="form"  size="mini" label-position="right" :label-width="tool.onlyZh('80px')">
+          <el-form-item  prop="brandname" :label="$t(`品牌名称`)">
+            <el-input v-model="form.brandname"  :placeholder="$t(`输入品牌名称`)" style="width:300px"></el-input>
+          </el-form-item>
+          <el-form-item  :label="$t(`品牌logo`)">
+            <uploadFile ref="upload" v-if="!form.attinfos || form.attinfos.length === 0" style="margin-top:10px" :folderid="folderid" accept=".JPG,.PNG,.jpg,.png" btntype="image" :bindData="{ownertable:'sa_brand',ownerid:form.sa_brandid,usetype:'default'}" @onSuccess="uploadSuccess"></uploadFile>
+            <previewImage v-else  :image="form.attinfos[0]" :deletebtn="true"
+              @onSuccess="clearCover"></previewImage>
+            <small style="display:block;margin-top:20px" class="info">{{$t(`注:建议上传图片大小`)}}1024x1024px,{{$t('大小不超过')}}2M,{{$t('格式为')}}JPG/PNG</small>
+          </el-form-item>
+        </el-form>
+        <saleclass :data="data"></saleclass>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="drawer = false" class="normal-btn-width">{{$t('取 消')}}</el-button>
+        <el-button size="small" type="primary" @click="onSubmit"   class="normal-btn-width">{{$t('确 定')}}</el-button>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import uploadFile from '../../../components/upload/hw_obs_upload.vue'
+import previewImage from '@/components/previewImage/index.vue'
+import saleclass from '../component/saleclass/index'
+export default {
+name: "edit",
+  props:['data'],
+  data(){
+    return {
+      drawer:false,
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      rules:{
+        brandname: [
+          { required: true, message: this.$t('品牌名称不可为空'), trigger: 'blur' },
+        ],
+      },
+      form:{
+        brandname:'',
+        attinfos:[]
+      },
+    }
+  },
+  components:{
+    uploadFile,
+    previewImage,
+    saleclass
+  },
+  created() {
+  },
+  methods:{
+    onShow(){
+      this.drawer = true
+      this.form = Object.assign({},this.form,this.data)
+    },
+    onSubmit () {
+      this.$refs['form'].validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": "20220922085003",
+          "version": 1,
+          "content": {
+            "sa_brandid": this.form.sa_brandid,
+            "brandname": this.form.brandname
+          }
+        })
+        this.tool.showMessage(res, () => {
+          this.ownerid = res.data
+          this.drawer = false
+          this.$emit('onSuccess')
+        })
+      })
+    },
+    uploadSuccess(res){
+      this.form.attinfos = JSON.parse(res.attinfos).data
+      this.$refs['upload'].dialogUploadVisible = false
+    },
+    clearCover () {
+      this.form.attinfos = []
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 80 - 0
src/bgj/ServiceMaterialClass/modules/list.vue

@@ -0,0 +1,80 @@
+<template>
+  <div>
+    <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght">
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname === 'brandLoge'">
+          <img width="70" height="70" style="margin-top:10px;border-radius:4px" :src="scope.column.data.attinfos && scope.column.data.attinfos[0]?scope.column.data.attinfos[0].url:''" alt="">
+        </div>
+        <p v-else>{{$t(scope.column.data[scope.column.columnname])}}</p>
+      </template>
+      <template v-slot:opreation="scope">
+        <slot name="edit" :data="scope.data"></slot>
+        <slot name="del" :data="scope.data"></slot>
+      </template>
+    </tableLayout>
+    <div style="margin-top:16px;text-align:right">
+      <el-pagination
+          background
+          small
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-size="params.content.pageSize"
+          layout="total, prev, pager, next, jumper"
+          :total="total">
+      </el-pagination>
+    </div>
+  </div>
+
+</template>
+
+<script>
+export default {
+name: "list",
+  data(){
+    return {
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      params:{
+        "id": "20220922110406",
+        "version":1,
+        "content": {
+          pageSize:10,
+          pageNumber:1,
+          "sc_brandid": 0,
+          "sys_enterpriseid": 0
+        }
+      }
+
+    }
+  },
+  mounted() {
+    this.listData()
+  },
+  methods:{
+    async listData(){
+      const res=await this.$api.requested(this.params)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      this.params.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      this.params.content.pageNumber = val
+      this.listData()
+    },
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).serviceMaterialClassTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 61 - 6
src/bgj/integralgoverning/index.vue

@@ -1,13 +1,68 @@
 <template>
-    <div>
-        积分调整
-    </div>
+    <basicLayout
+        ref="list"
+        tableName="integralAdjustTable"
+        idName="id"
+        :apiId="{ query: 2026052510111106 }"
+        :detailPath="{
+            path: '/integralAdjustDetail',
+        }"
+    >
+        <template #custom>
+            <div class="mt-10">
+                <label class="search__label">{{ $t("调整类型") }}:</label>
+                <el-select
+                    class="inline-24"
+                    v-model="where.adjusttype"
+                    :placeholder="$t(`请选择调整类型`)"
+                    @change="selectChange"
+                    size="small"
+                    clearable
+                >
+                    <el-option :label="$t(`增加`)" value="1"></el-option>
+                    <el-option :label="$t(`减少`)" value="0"></el-option>
+                </el-select>
+            </div>
+        </template>
+        <template v-slot:tbList="scope">
+            <div v-if="scope.data.column.columnname === 'adjusttype'">
+                <span :style="scope.data.column.data.adjusttype == '1' ? 'color:#52C41A' : 'color:#F5222D'">
+                    {{ $t(scope.data.column.data.adjusttype == '1'?'增加':'扣减') }}
+                </span>
+            </div>
+            <div v-else-if="scope.data.column.columnname === 'A'">
+                {{ scope.data.column.data.type =='A' ? scope.data.column.data.points : 0 }}
+            </div>
+            <div v-else-if="scope.data.column.columnname === 'C'">
+                {{ scope.data.column.data.type =='C' ? scope.data.column.data.points : 0 }}
+            </div>
+            <div v-else-if="scope.data.column.columnname === 'createTime'">
+                {{ scope.data.column.data.createTime }}
+            </div>
+            <div v-else>{{ scope.data.column.data[scope.data.column.columnname] }}</div>
+        </template>
+    </basicLayout>
 </template>
 
 <script>
 export default {
-
-}
+    data() {
+        return {
+            where: {
+                adjusttype: "",
+                condition: ""
+            }
+        };
+    },
+    methods: {
+        selectChange() {
+            this.$refs.list.param.content.where = this.where;
+            this.$refs.list.param.content.pageNumber = 1;
+            this.$refs.list.listData();
+        }
+    }
+};
 </script>
 
-<style></style>
+<style scoped>
+</style>

+ 494 - 5
src/bgj/integrationrule/index.vue

@@ -1,13 +1,502 @@
 <template>
-    <div>
-        积分规则
+    <div class="integration-rule-page">
+        <div class="section-box">
+            <div class="section-title">积分生成规则</div>
+            <el-table :data="ruleData" border style="width: 100%">
+                <el-table-column prop="remarks" label="规则名称" min-width="200" show-overflow-tooltip />
+                <el-table-column prop="value" label="积分" width="200" align="center" />
+                <!-- <el-table-column label="操作" width="120" align="center">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
+                    </template>
+                </el-table-column> -->
+            </el-table>
+        </div>
+
+        <div class="section-box mt-16">
+            <div class="section-title">积分规则编辑器</div>
+            <el-table :data="editorData" border>
+                <el-table-column label="工单模版" width="180" align="center">
+                    <template slot-scope="scope">
+                        <el-select
+                            v-model="scope.row.sc_workorder_templateid"
+                            placeholder="请选择"
+                            size="small"
+                            :disabled="!scope.row.isNew"
+                            @change="handleWorkOrderTypeChange(scope.$index, scope.row)"
+                        >
+                            <el-option
+                                v-for="item in workOrderTypeList"
+                                :key="item.sc_workorder_templateid"
+                                :label="item.name"
+                                :value="item.sc_workorder_templateid"
+                            ></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column label="A积分规则" align="center">
+                    <el-table-column label="团队定位" width="120" align="center">
+                        <template slot-scope="scope">
+                            <el-select v-model="scope.row.a_team" placeholder="请选择" size="small">
+                                <el-option label="组长" value="组长"></el-option>
+                                <el-option label="技师" value="技师"></el-option>
+                            </el-select>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="符号" width="80" align="center">
+                        <template slot-scope="scope">
+                            <el-select v-model="scope.row.a_symbol" size="small">
+                                <el-option label="=" value="="></el-option>
+                                <el-option label=">" value=">"></el-option>
+                                <el-option label="≥" value="≥"></el-option>
+                                <el-option label="<" value="<"></el-option>
+                                <el-option label="≤" value="≤"></el-option>
+                                <el-option label="≠" value="≠"></el-option>
+                            </el-select>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="人数" width="160" align="center">
+                        <template slot-scope="scope">
+                            <el-input v-model="scope.row.a_count" size="small" placeholder="请输入" oninput="value = value.replace(/[^\d]/g, '')"></el-input>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="积分占比(%)" width="160" align="center">
+                        <template slot-scope="scope">
+                            <el-input v-model="scope.row.a_ratio" size="small" placeholder="0-100" oninput="value = value.replace(/[^\d]/g, ''); if(value>100)value=100"></el-input>
+                        </template>
+                    </el-table-column>
+                </el-table-column>
+                <el-table-column label="C积分规则" align="center">
+                    <el-table-column label="团队定位" width="160" align="center">
+                        <template slot-scope="scope">
+                            <el-select v-model="scope.row.c_team" placeholder="请选择" size="small">
+                                <el-option label="组长" value="组长"></el-option>
+                                <el-option label="技师" value="技师"></el-option>
+                            </el-select>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="符号" width="80" align="center">
+                        <template slot-scope="scope">
+                            <el-select v-model="scope.row.c_symbol" size="small">
+                                <el-option label="=" value="="></el-option>
+                                <el-option label=">" value=">"></el-option>
+                                <el-option label="≥" value="≥"></el-option>
+                                <el-option label="<" value="<"></el-option>
+                                <el-option label="≤" value="≤"></el-option>
+                                <el-option label="≠" value="≠"></el-option>
+                            </el-select>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="人数" width="160" align="center">
+                        <template slot-scope="scope">
+                            <el-input v-model="scope.row.c_count" size="small" placeholder="请输入" oninput="value = value.replace(/[^\d]/g, '')"></el-input>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="积分占比(%)" width="160" align="center">
+                        <template slot-scope="scope">
+                            <el-input v-model="scope.row.c_ratio" size="small" placeholder="0-100" oninput="value = value.replace(/[^\d]/g, ''); if(value>100)value=100"></el-input>
+                        </template>
+                    </el-table-column>
+                </el-table-column>
+                <el-table-column label="操作" align="center">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="handleEditorSave(scope.$index)">保存</el-button>
+                        <!-- <el-button type="text" size="small" @click="handleEditorDelete(scope.$index)">删除</el-button> -->
+                    </template>
+                </el-table-column>
+            </el-table>
+            <div class="editor-footer">
+                <el-button type="primary" size="small" @click="handleAddRow">新增行</el-button>
+                <el-button size="small" @click="fetchEditorData">刷新</el-button>
+            </div>
+        </div>
+
+        <div class="section-box mt-16">
+            <div class="section-title">积分规则结果列表</div>
+            <el-table :data="mergedRuleData" border style="width: 100%" :span-method="objectSpanMethod">
+                <el-table-column prop="rowindex" width="80" label="序号" show-overflow-tooltip />
+                <el-table-column prop="workOrderTypeName" width="150" label="工单模版" show-overflow-tooltip />
+                <el-table-column label="A积分规则" align="center">
+                    <template slot-scope="scope">
+                        <span>{{ scope.row.aRuleText }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="C积分规则" align="center">
+                    <template slot-scope="scope">
+                        <span>{{ scope.row.cRuleText }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" width="120" align="center">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="handleResultEdit(scope.row)">编辑</el-button>
+                        <el-button type="text" size="small" @click="handleResultDelete(scope.row)">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+
+        <el-dialog :visible.sync="dialogVisible" title="编辑积分规则" width="400px">
+            <el-form label-width="100px">
+                <el-form-item label="规则名称">
+                    <el-input v-model="editForm.remarks" disabled></el-input>
+                </el-form-item>
+                <el-form-item label="积分">
+                    <el-input-number v-model="editForm.value" :min="0" controls-position="right"></el-input-number>
+                </el-form-item>
+            </el-form>
+            <div slot="footer">
+                <el-button @click="dialogVisible = false">取消</el-button>
+                <el-button type="primary" @click="handleSave">保存</el-button>
+            </div>
+        </el-dialog>
     </div>
 </template>
 
 <script>
 export default {
-
-}
+    data() {
+        return {
+            ruleData: [],
+            dialogVisible: false,
+            editForm: {
+                remarks: "",
+                value: 0
+            },
+            editorData: [],
+            workOrderTypeList: [],
+            isLoading: false,
+            resultListData: []
+        };
+    },
+    computed: {
+        mergedRuleData() {
+            const map = {};
+            this.resultListData.forEach((item) => {
+                if (!item.sc_workorder_templateid) return;
+                const key = `${item.sc_workorder_templateid}_${item.rowindex || item.sc_points_rulesmxid}`;
+                if (!map[key]) {
+                    map[key] = {
+                        rowindex: item.rowindex,
+                        sc_points_rulesmxid: item.sc_points_rulesmxid,
+                        sc_workorder_templateid: item.sc_workorder_templateid,
+                        workOrderTypeName: item.templatename || "",
+                        a_team: item.a_position || "",
+                        a_symbol: item.a_symbol || "",
+                        a_count: item.a_count || 0,
+                        a_ratio: item.a_ratio || 0,
+                        c_team: item.c_position || "",
+                        c_symbol: item.c_symbol || "",
+                        c_count: item.c_count || 0,
+                        c_ratio: item.c_ratio || 0
+                    };
+                }
+            });
+            return Object.values(map).map((item) => {
+                const aText = `${item.a_team}${item.a_symbol}${item.a_count}人,积分占比:${item.a_ratio}%`;
+                const cText = `${item.c_team}${item.c_symbol}${item.c_count}人,积分占比:${item.c_ratio}%`;
+                return {
+                    ...item,
+                    aRuleText: item.a_count > 1 ? `${aText}(均摊)` : aText,
+                    cRuleText: item.c_count > 1 ? `${cText}(均摊)` : cText
+                };
+            });
+        }
+    },
+    created() {
+        this.fetchRuleData();
+        this.getWorkOrderTypeList();
+        this.fetchResultListData();
+    },
+    methods: {
+        async fetchRuleData() {
+            const res = await this.$store.dispatch("optiontypeselect", "bathroomprepoints");
+            if (res && res.data) {
+                this.ruleData = res.data;
+            }
+        },
+        handleEdit(row) {
+            this.editForm = {
+                remarks: row.remarks,
+                value: row.value ? Number(row.value) : 0
+            };
+            this.dialogVisible = true;
+        },
+        async handleSave() {
+            const res = await this.$api.requested({
+                classname: "sysmanage.develop.optiontype.optiontype",
+                method: "optiontypeupdate",
+                content: {
+                    typename: "bathroomprepoints",
+                    value: this.editForm.value,
+                    remarks: this.editForm.remarks
+                }
+            });
+            this.tool.showMessage(res, () => {
+                this.dialogVisible = false;
+                this.fetchRuleData();
+            });
+        },
+        async getWorkOrderTypeList() {
+            const res = await this.$api.requested({
+                id: 2026051511261302,
+                content: {
+                    pageNumber: 1,
+                    pageSize: 100,
+                    where: {
+                        condition: ""
+                    }
+                }
+            });
+            if (res && res.data) {
+                this.workOrderTypeList = res.data;
+            }
+        },
+        async fetchEditorData() {
+            if (this.isLoading) return;
+            this.isLoading = true;
+            try {
+                const res = await this.$api.requested({
+                    id: 2026052510103006,
+                    content: {
+                        rules: []
+                    }
+                });
+                if (res && res.data && res.data.rules) {
+                    this.editorData = res.data.rules.map((item) => ({
+                        sc_workorder_templateid: item.sc_workorder_templateid,
+                        a_symbol: item.a_symbol || "≥",
+                        a_count: item.a_count || 0,
+                        a_ratio: item.a_ratio || 0,
+                        a_team: item.a_team || "",
+                        c_symbol: item.c_symbol || "=",
+                        c_count: item.c_count || 0,
+                        c_ratio: item.c_ratio || 0,
+                        c_team: item.c_team || "",
+                        isNew: false
+                    }));
+                } else {
+                    this.editorData = [];
+                }
+            } catch (e) {
+                console.error("fetchEditorData error:", e);
+            } finally {
+                this.isLoading = false;
+            }
+        },
+        async fetchResultListData() {
+            try {
+                const res = await this.$api.requested({
+                    id: 2026052510102006,
+                    content: {
+                        pageSize: 20,
+                        pageNumber: 1,
+                        pageSorting: "t1.sc_workorder_templateid, t1.sc_points_rulesmxid"
+                    }
+                });
+                if (res && res.data) {
+                    this.resultListData = Array.isArray(res.data) ? res.data : [];
+                } else {
+                    this.resultListData = [];
+                }
+            } catch (e) {
+                console.error("fetchResultListData error:", e);
+            }
+        },
+        handleAddRow() {
+            const newRow = {
+                sc_workorder_templateid: "",
+                a_symbol: "≥",
+                a_count: 1,
+                a_ratio: 100,
+                a_team: "",
+                c_symbol: "=",
+                c_count: 1,
+                c_ratio: 0,
+                c_team: "",
+                isNew: true
+            };
+            this.editorData.push(newRow);
+        },
+        handleWorkOrderTypeChange(index, row) {
+            const item = this.workOrderTypeList.find((w) => w.sc_workorder_templateid === row.sc_workorder_templateid);
+            if (item) {
+                this.editorData[index].workOrderTypeName = item.name;
+            }
+        },
+        async handleEditorSave(index) {
+            const row = this.editorData[index];
+            if (!row.sc_workorder_templateid) {
+                this.$message.warning("请选择工单模版");
+                return;
+            }
+            if (!row.a_team) {
+                this.$message.warning("请选择A积分团队定位");
+                return;
+            }
+            if (!row.c_team) {
+                this.$message.warning("请选择C积分团队定位");
+                return;
+            }
+            if (!row.a_count && row.a_count !== 0) {
+                this.$message.warning("请填写A积分人数");
+                return;
+            }
+            if (!row.c_count && row.c_count !== 0) {
+                this.$message.warning("请填写C积分人数");
+                return;
+            }
+            if (!row.a_ratio && row.a_ratio !== 0) {
+                this.$message.warning("请填写A积分占比");
+                return;
+            }
+            if (!row.c_ratio && row.c_ratio !== 0) {
+                this.$message.warning("请填写C积分占比");
+                return;
+            }
+            const aRatio = Number(row.a_ratio) || 0;
+            const cRatio = Number(row.c_ratio) || 0;
+            if (aRatio + cRatio !== 100) {
+                this.$message.warning("A积分占比 + C积分占比必须等于100%");
+                return;
+            }
+            const res = await this.$api.requested({
+                id: "ID2026052710100006",
+                content: {
+                    sc_points_rulesmxid: row.sc_points_rulesmxid,
+                    sc_workorder_templateid: row.sc_workorder_templateid,
+                    a_symbol: row.a_symbol,
+                    a_count: Number(row.a_count) || 0,
+                    a_ratio: Number(row.a_ratio) || 0,
+                    c_symbol: row.c_symbol,
+                    c_count: Number(row.c_count) || 0,
+                    c_ratio: Number(row.c_ratio) || 0
+                }
+            });
+            if (res && res.msg === "成功") {
+                this.$message.success("保存成功");
+                this.fetchResultListData();
+            } else {
+                this.$message.error(res.msg || "保存失败");
+            }
+        },
+        async handleEditorDelete(index) {
+            const deleteId = this.editorData[index].sc_workorder_templateid;
+            const tempData = this.editorData.filter((_, i) => i !== index);
+            const validRows = tempData.filter((item) => item.sc_workorder_templateid);
+            const rules = validRows.map((item) => ({
+                sc_workorder_templateid: item.sc_workorder_templateid,
+                a_symbol: item.a_symbol,
+                a_count: item.a_count,
+                a_ratio: item.a_ratio,
+                c_symbol: item.c_symbol,
+                c_count: item.c_count,
+                c_ratio: item.c_ratio
+            }));
+            const res = await this.$api.requested({
+                id: 2026052510103006,
+                content: {
+                    rules: rules
+                }
+            });
+            if (res && res.msg === "成功") {
+                this.$message.success("删除成功");
+                this.editorData = tempData;
+                this.fetchResultListData();
+            } else {
+                this.$message.error(res.msg || "删除失败");
+            }
+        },
+        objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+            if (columnIndex === 1) {
+                const currentRow = this.mergedRuleData[rowIndex];
+                const prevRow = this.mergedRuleData[rowIndex - 1];
+                if (prevRow && prevRow.workOrderTypeName === currentRow.workOrderTypeName) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                }
+                let rowspan = 1;
+                for (let i = rowIndex + 1; i < this.mergedRuleData.length; i++) {
+                    if (this.mergedRuleData[i].workOrderTypeName === currentRow.workOrderTypeName) {
+                        rowspan++;
+                    } else {
+                        break;
+                    }
+                }
+                return {
+                    rowspan,
+                    colspan: 1
+                };
+            }
+        },
+        handleResultEdit(row) {
+            const editRow = {
+                sc_points_rulesmxid: row.sc_points_rulesmxid,
+                sc_workorder_templateid: row.sc_workorder_templateid,
+                a_symbol: row.a_symbol || "≥",
+                a_count: row.a_count || 0,
+                a_ratio: row.a_ratio || 0,
+                a_team: row.a_team || "",
+                c_symbol: row.c_symbol || "=",
+                c_count: row.c_count || 0,
+                c_ratio: row.c_ratio || 0,
+                c_team: row.c_team || "",
+                isNew: false
+            };
+            this.editorData = [editRow];
+            this.$nextTick(() => {
+                const container = document.querySelector(".integration-rule-page");
+                if (container) {
+                    container.scrollTo({
+                        top: 300,
+                        behavior: "smooth"
+                    });
+                }
+            });
+        },
+        async handleResultDelete(row) {
+            try {
+                const res = await this.$api.requested({
+                    id: 2026052510104006,
+                    content: {
+                        sc_points_rulesmxid: row.sc_points_rulesmxid
+                    }
+                });
+                if (res && res.msg === "成功") {
+                    this.$message.success("删除成功");
+                    this.fetchResultListData();
+                } else {
+                    this.$message.error(res.msg || "删除失败");
+                }
+            } catch (e) {
+                console.error("handleResultDelete error:", e);
+                this.$message.error("删除失败");
+            }
+        }
+    }
+};
 </script>
 
-<style></style>
+<style scoped>
+.integration-rule-page {
+    padding: 20px;
+}
+.section-box {
+    background: #fff;
+    padding: 20px;
+    border-radius: 4px;
+}
+.section-title {
+    font-size: 16px;
+    font-weight: bold;
+    margin-bottom: 16px;
+}
+.mt-16 {
+    margin-top: 16px;
+}
+.editor-footer {
+    margin-top: 16px;
+    text-align: left;
+}
+</style>

+ 11 - 1
src/router/bgj.js

@@ -173,6 +173,16 @@ const bgj = [
           import(/* webpackChunkName: "about" */ '@/bgj/pointsbasedorder/modules/detail'),
       },
     ],
-  }
+  },
+  {
+    path: '/ServiceMaterialClass',
+    name: 'ServiceMaterialClass',
+    meta: {
+      title: '服务物料分类',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/bgj/ServiceMaterialClass/index')
+  },
 ];
 export default bgj;