970319330@qq.com 4 дней назад
Родитель
Сommit
84b143fbbb

+ 1 - 1
.gitignore

@@ -2,4 +2,4 @@ node_modules
 yos
 package-lock.json
 .claude/settings.local.json
-yos.zip
+yos.zip.DS_Store

+ 380 - 0
src/Form/pointsbasedproducts/add.vue

@@ -0,0 +1,380 @@
+<template>
+    <div>
+        <el-button
+            :size="btn_size ? btn_size : 'small'"
+            type="primary"
+            @click="show"
+        >
+            {{ title_btn ? $t(title_btn) : $t("新 建") }}
+        </el-button>
+        <el-drawer
+            :title="title_drawer ? $t(title_drawer) : $t(`新建积分商品`)"
+            :visible.sync="dialogFormVisible"
+            direction="rtl"
+            append-to-body
+            :show-close="false"
+            size="700px"
+            @close="onCancel"
+        >
+            <div class="drawer__panel">
+                <el-row :gutter="20">
+                    <el-form
+                        :model="form"
+                        :rules="rules"
+                        ref="form"
+                        :label-width="tool.onlyZh('100px')"
+                        label-position="right"
+                        size="mini"
+                    >
+                        <el-col :span="24">
+                            <el-form-item :label="$t('商品名称:')" prop="itemname">
+                                <el-input
+                                    v-model="form.itemname"
+                                    :placeholder="$t('请填写商品名称')"
+                                ></el-input>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('商品编号:')" prop="itemno">
+                                <el-input
+                                    v-model="form.itemno"
+                                    :placeholder="$t('请填写商品编号')"
+                                ></el-input>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('积分:')" prop="points">
+                                <el-input-number
+                                    v-model="form.points"
+                                    :min="0"
+                                    :placeholder="$t('请填写积分')"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('价格:')" prop="price">
+                                <el-input-number
+                                    v-model="form.price"
+                                    :min="0"
+                                    :precision="2"
+                                    :placeholder="$t('请填写价格')"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('辅助单位:')" prop="isauxunit">
+                                <el-checkbox
+                                    v-model="form.isauxunit"
+                                    :true-label="1"
+                                    :false-label="0"
+                                >
+                                    {{ $t("是否需要辅助单位") }}
+                                </el-checkbox>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t(`单位`)" prop="unitid">
+                                <el-select
+                                    style="width: 100%"
+                                    v-model="form.unitid"
+                                    :placeholder="$t('请选择')"
+                                    clearable
+                                >
+                                    <el-option
+                                        v-for="item in unitData"
+                                        :key="item.unitid"
+                                        :label="$t(item.unitname)"
+                                        :value="item.unitid"
+                                    >
+                                    </el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t(`单位组`)" :prop="form.isauxunit === 1 ? 'unitgroupid' : ''">
+                                <el-select
+                                    style="width: 100%"
+                                    v-model="form.unitgroupid"
+                                    :disabled="form.isauxunit === 0"
+                                    :placeholder="$t('请选择')"
+                                    clearable
+                                >
+                                    <el-option
+                                        v-for="item in unitGroupData"
+                                        :key="item.unitgroupid"
+                                        :label="$t(item.unitgroupname)"
+                                        :value="item.unitgroupid"
+                                    >
+                                        <p style="float: left">
+                                            {{ item.unitgroupname }}
+                                        </p>
+                                        <p
+                                            style="
+                                                float: right;
+                                                color: #8492a6;
+                                                font-size: 13px;
+                                            "
+                                        >
+                                            {{ item.conversionrate
+                                            }}{{ item.unitname }}/{{
+                                                item.auxunitname
+                                            }},{{ $t(`换算率`) }}:{{
+                                                "1:" + item.conversionrate
+                                            }}
+                                        </p>
+                                    </el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('最小订购量:')" prop="orderminqty">
+                                <el-input-number
+                                    v-model="form.orderminqty"
+                                    :min="1"
+                                    :placeholder="$t('请填写最小订购量')"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('订购增量:')" prop="orderaddqty">
+                                <el-input-number
+                                    v-model="form.orderaddqty"
+                                    :min="1"
+                                    :placeholder="$t('请填写订购增量')"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('备注:')" prop="remarks">
+                                <el-input
+                                    type="textarea"
+                                    v-model="form.remarks"
+                                    :placeholder="$t('请填写备注')"
+                                ></el-input>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="20">
+                            <el-form-item :label="$t('商品图:')">
+                                <div
+                                    class="flex-align-center"
+                                    style="flex-wrap: wrap"
+                                >
+                                    <uploadFile
+                                        ref="upload"
+                                        style="margin: 10px 10px 10px 0"
+                                        :folderid="folderid"
+                                        accept=".JPG,.PNG,.jpg,.png"
+                                        type="image"
+                                        :bindData="bindData"
+                                        @onSuccess="uploadSuccess"
+                                    >
+                                    </uploadFile>
+                                    <template v-if="title_btn == '编辑'">
+                                        <previewImage
+                                            style="
+                                                margin: 10px 10px 10px 0;
+                                            "
+                                            v-for="image in form.attinfos"
+                                            :key="image.index"
+                                            :image="image"
+                                            :deletebtn="true"
+                                            @onSuccess="clearCover"
+                                        ></previewImage>
+                                    </template>
+                                </div>
+
+                                <small
+                                    style="display: block; margin-top: 18px"
+                                    class="info"
+                                    >{{
+                                        $t(`注:建议上传图片大小`)
+                                    }}1024x1024px,{{ $t("大小不超过") }}2M,{{
+                                        $t("格式为")
+                                    }}JPG/PNG</small
+                                >
+                            </el-form-item>
+                        </el-col>
+                    </el-form>
+                </el-row>
+            </div>
+            <div class="fixed__btn__panel">
+                <el-button
+                    size="small"
+                    @click="onCancel"
+                    class="normal-btn-width"
+                    >{{ $t("取 消") }}</el-button
+                >
+                <el-button
+                    :loading="loading"
+                    class="normal-btn-width"
+                    size="small"
+                    :type="title_btn == '编辑' ? 'warning' : 'primary'"
+                    @click="onSubmit"
+                    >{{ title_btn == "编辑" ? $t("保 存") : $t("确 定") }}
+                </el-button>
+            </div>
+        </el-drawer>
+    </div>
+</template>
+<script>
+import uploadFile from "@/components/upload/preview_upload.vue";
+import previewImage from "@/components/previewImage/index.vue";
+export default {
+    name: "add",
+    components: { uploadFile, previewImage },
+    props: {
+        btn_size: String,
+        title_btn: String,
+        title_drawer: String,
+        data: Object,
+    },
+    data() {
+        return {
+            folderid: JSON.parse(sessionStorage.getItem("folderid"))
+                .appfolderid,
+            bindData: {},
+            unitData: [],
+            unitGroupData: [],
+            loading: false,
+            dialogFormVisible: false,
+            currentData: {},
+            form: {
+                sc_points_productid: 0,
+                itemno: "",
+                itemname: "",
+                price: 0,
+                points: 0,
+                isauxunit: 0,
+                orderminqty: 1,
+                orderaddqty: 1,
+                unitid: "",
+                unitgroupid: "",
+                remarks: "",
+                attinfos: [],
+            },
+            rules: {
+                itemname: [
+                    {
+                        required: true,
+                        message: this.$t("请填写商品名称"),
+                        trigger: "blur",
+                    },
+                ],
+                itemno: [
+                    {
+                        required: true,
+                        message: this.$t("请填写商品编号"),
+                        trigger: "blur",
+                    },
+                ],
+                points: [
+                    {
+                        required: true,
+                        message: this.$t("请填写积分"),
+                        trigger: "blur",
+                    },
+                ],
+                price: [
+                    {
+                        required: true,
+                        message: this.$t("请填写价格"),
+                        trigger: "blur",
+                    },
+                ],
+            },
+        };
+    },
+    methods: {
+        show() {
+            this.unitlist();
+            this.dialogFormVisible = true;
+            if (this.title_btn == "编辑") {
+                this.form = Object.assign({}, this.form, this.data);
+            }
+        },
+        async unitlist() {
+            const res = await this.$api.requested({
+                id: "20220922084803",
+                version: 1,
+                nocache: true,
+                content: {
+                    pageSize: 1000,
+                    where: {
+                        condition: "",
+                    },
+                },
+            });
+            this.unitData = res.data;
+        },
+        onSubmit() {
+            this.$refs["form"].validate(async (valid) => {
+                if (!valid) return false;
+                if (this.form.isauxunit === 1 && !this.form.unitgroupid) {
+                    this.$message.error(this.$t("请选择单位组"));
+                    return false;
+                }
+                this.loading = true;
+                const res = await this.$api.requested({
+                    id: 2026052209110806,
+                    content: this.form,
+                });
+                if (res.code === 0) {
+                    this.loading = false;
+                    this.$message.error(
+                        res.msg ||
+                            (this.title_btn == "编辑" ? this.$t("编辑失败") : this.$t("新建失败"))
+                    );
+                    return;
+                }
+                this.loading = false;
+                this.$message.success(
+                    this.title_btn == "编辑" ? this.$t("编辑成功") : this.$t("新建成功")
+                );
+                this.bindData = {
+                    ownertable: "sc_points_product",
+                    ownerid: res.data.sc_points_productid,
+                    usetype: "default",
+                };
+                this.$refs["upload"].toUpload();
+                this.$emit("onSuccess");
+                this.dialogFormVisible = false;
+                this.$refs["form"].resetFields();
+                setTimeout(() => {
+                    if (this.form.sc_points_productid && this.form.sc_points_productid !== 0) {
+                        this.$router.push({
+                            path: "/pointsbasedproductsDetail",
+                            query: {
+                                id: this.form.sc_points_productid,
+                                rowindex: res.data.rowindex,
+                            },
+                        });
+                        this.$store.dispatch("changeDetailDrawer", true);
+                    } else {
+                        this.$emit("onSuccess");
+                    }
+                }, 500);
+            });
+        },
+        onCancel() {
+            this.dialogFormVisible = false;
+            this.$refs["form"].resetFields();
+        },
+        uploadSuccess(res) {
+            this.$emit("onSuccess");
+        },
+        clearCover() {
+            this.queryMain();
+        },
+        async queryMain() {
+            const res = await this.$api.requested({
+                id: 2026052209105106,
+                content: {
+                    nocache: true,
+                    sc_points_productid: this.$route.query.id,
+                },
+            });
+            this.form = Object.assign({}, this.form, res.data);
+        },
+    },
+};
+</script>

+ 4 - 4
src/bgj/ServiceMaterialClass/index.vue

@@ -6,8 +6,8 @@
         add:'bgj/ServiceMaterialClass/modules',
       }"
       tableName="brandTable"
-      idName="sa_brandid"
-      :apiId="{query:20220922085104,del:20220922085203}"
+      idName="sa_brand_bgjid"
+      :apiId="{query:20220922085104,del:20220922085204}"
       :options="options"
     >
       <div slot="custom">
@@ -17,7 +17,7 @@
       </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>
+          <previewImage v-if="scope.data.column.data.attinfos && scope.data.column.data.attinfos[0]" style="height:40px;width:40px;margin-bottom:10px" :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]])}}
@@ -25,7 +25,7 @@
       </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>
+        <brand_del v-if="tool.checkAuth($route.name,'delete')" :data="scope.data.data" @onSuccess="$refs.basicLayout.listData()" :type="'text'"></brand_del>
       </template>
     </basicLayout>
   </div>

+ 1 - 1
src/bgj/ServiceMaterialClass/modules/add.vue

@@ -15,7 +15,7 @@
             <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>
+            <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_bgj',ownerid:form.sa_brand_bgjid,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>

+ 2 - 2
src/bgj/ServiceMaterialClass/modules/delete.vue

@@ -15,10 +15,10 @@ export default {
   methods: {
     async deleteRow(){
       const res = await this.$api.requested({
-        "id": "20220922085203",
+        "id": "20220922085204",
         "version":1,
         "content": {
-          "sa_brandid": this.data.sa_brandid
+          "sa_brand_bgjid": this.data.sa_brand_bgjid
         }
       })
       this.tool.showMessage(res, () => {

+ 1 - 1
src/bgj/ServiceMaterialClass/modules/edit.vue

@@ -15,7 +15,7 @@
             <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>
+            <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_bgj',ownerid:form.sa_brand_bgjid,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>

+ 25 - 20
src/bgj/integrationrule/index.vue

@@ -5,18 +5,18 @@
             <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">
+                <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-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">
+                <el-table-column label="工单模版" align="center">
                     <template slot-scope="scope">
                         <el-select
                             v-model="scope.row.sc_workorder_templateid"
@@ -34,7 +34,7 @@
                     </template>
                 </el-table-column>
                 <el-table-column label="A积分规则" align="center">
-                    <el-table-column label="团队定位" width="120" align="center">
+                    <el-table-column label="团队定位" align="center">
                         <template slot-scope="scope">
                             <el-select v-model="scope.row.a_team" placeholder="请选择" disabled size="small">
                                 <el-option label="组长" value="组长"></el-option>
@@ -42,7 +42,7 @@
                             </el-select>
                         </template>
                     </el-table-column>
-                    <el-table-column label="符号" width="80" align="center">
+                    <el-table-column label="符号" align="center">
                         <template slot-scope="scope">
                             <el-select v-model="scope.row.a_symbol" size="small">
                                 <el-option label="=" value="="></el-option>
@@ -54,19 +54,19 @@
                             </el-select>
                         </template>
                     </el-table-column>
-                    <el-table-column label="人数" width="160" align="center">
+                    <el-table-column label="人数" 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">
+                    <el-table-column label="积分占比(%)" 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">
+                    <el-table-column label="团队定位" align="center">
                         <template slot-scope="scope">
                             <el-select v-model="scope.row.c_team" placeholder="请选择" disabled size="small">
                                 <el-option label="组长" value="组长"></el-option>
@@ -74,7 +74,7 @@
                             </el-select>
                         </template>
                     </el-table-column>
-                    <el-table-column label="符号" width="80" align="center">
+                    <el-table-column label="符号" align="center">
                         <template slot-scope="scope">
                             <el-select v-model="scope.row.c_symbol" size="small">
                                 <el-option label="=" value="="></el-option>
@@ -86,12 +86,12 @@
                             </el-select>
                         </template>
                     </el-table-column>
-                    <el-table-column label="人数" width="160" align="center">
+                    <el-table-column label="人数"  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">
+                    <el-table-column label="积分占比(%)" 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>
@@ -133,7 +133,7 @@
             </el-table>
         </div>
 
-        <el-dialog :visible.sync="dialogVisible" title="编辑积分规则" width="400px">
+        <el-dialog :visible.sync="dialogVisible" title="编辑积分规则" width="400px" append-to-body>
             <el-form label-width="100px">
                 <el-form-item label="规则名称">
                     <el-input v-model="editForm.remarks" disabled></el-input>
@@ -207,9 +207,16 @@ export default {
     },
     methods: {
         async fetchRuleData() {
-            const res = await this.$store.dispatch("optiontypeselect", "bathroomprepoints");
+            const res = await this.$api.requested({
+                "classname": "webmanage.site.site",
+                "method": "querySite_Parameter",
+                "content": {}
+            });
             if (res && res.data) {
-                this.ruleData = res.data;
+                this.ruleData = [{
+                    remarks: "卫生间每间积分",
+                    value: res.data.bathroomprepoints
+                }];
             }
         },
         handleEdit(row) {
@@ -221,12 +228,10 @@ export default {
         },
         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
+                "classname": "webmanage.site.site",
+                "method": "updateSite_Parameter",
+                "content": {
+                    "bathroomprepoints": this.editForm.value
                 }
             });
             this.tool.showMessage(res, () => {

+ 4 - 1
src/bgj/pointsbasedproducts/index.vue

@@ -74,6 +74,9 @@
         </div>
       </template>
       <template v-slot:tbList="scope">
+        <div v-if="scope.data.column.columnname === 'image'">
+          <previewImage v-if="scope.data.column.data.attinfos && scope.data.column.data.attinfos[0]" style="height:40px;width:40px;margin-bottom:10px" :image="scope.data.column.data.attinfos[0]" :list="scope.data.column.data.attinfos" :deletebtn="false"></previewImage>
+        </div>
         <div>
         <p :style="{color:scope.data.column.data.isonsale === 1?tool.getStatusColor('上架',true):tool.getStatusColor('下架',true)}" v-if="scope.data.column.columnname === 'isonsale'">
           {{ scope.data.column.data.isonsale ? $t('上架') : $t('下架') }}
@@ -81,7 +84,7 @@
         <p v-else-if="scope.data.column.columnname === 'status'">
           <span :style="tool.getStatusColor(scope.data.column.data[[scope.data.column.columnname]])" >{{$t(scope.data.column.data[[scope.data.column.columnname]])}}</span>
         </p>
-        <div v-else>{{scope.data.column.columnname === 'operation' || scope.data.column.data[scope.data.column.columnname]?scope.data.column.data[scope.data.column.columnname] : '--'}}</div>
+        <div v-else>{{ scope.data.column.data[scope.data.column.columnname]?scope.data.column.data[scope.data.column.columnname] : ''}}</div>
         </div>
       </template>
     </basicLayout>

+ 380 - 0
src/bgj/pointsbasedproducts/modules/add.vue

@@ -0,0 +1,380 @@
+<template>
+    <div>
+        <el-button
+            :size="btn_size ? btn_size : 'small'"
+            type="primary"
+            @click="show"
+        >
+            {{ title_btn ? $t(title_btn) : $t("新 建") }}
+        </el-button>
+        <el-drawer
+            :title="title_drawer ? $t(title_drawer) : $t(`新建积分商品`)"
+            :visible.sync="dialogFormVisible"
+            direction="rtl"
+            append-to-body
+            :show-close="false"
+            size="700px"
+            @close="onCancel"
+        >
+            <div class="drawer__panel">
+                <el-row :gutter="20">
+                    <el-form
+                        :model="form"
+                        :rules="rules"
+                        ref="form"
+                        :label-width="tool.onlyZh('100px')"
+                        label-position="right"
+                        size="mini"
+                    >
+                        <el-col :span="24">
+                            <el-form-item :label="$t('商品名称:')" prop="itemname">
+                                <el-input
+                                    v-model="form.itemname"
+                                    :placeholder="$t('请填写商品名称')"
+                                ></el-input>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('商品编号:')" prop="itemno">
+                                <el-input
+                                    v-model="form.itemno"
+                                    :placeholder="$t('请填写商品编号')"
+                                ></el-input>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('积分:')" prop="points">
+                                <el-input-number
+                                    v-model="form.points"
+                                    :min="0"
+                                    :placeholder="$t('请填写积分')"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('价格:')" prop="price">
+                                <el-input-number
+                                    v-model="form.price"
+                                    :min="0"
+                                    :precision="2"
+                                    :placeholder="$t('请填写价格')"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('辅助单位:')" prop="isauxunit">
+                                <el-checkbox
+                                    v-model="form.isauxunit"
+                                    :true-label="1"
+                                    :false-label="0"
+                                >
+                                    {{ $t("是否需要辅助单位") }}
+                                </el-checkbox>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t(`单位`)" prop="unitid">
+                                <el-select
+                                    style="width: 100%"
+                                    v-model="form.unitid"
+                                    :placeholder="$t('请选择')"
+                                    clearable
+                                >
+                                    <el-option
+                                        v-for="item in unitData"
+                                        :key="item.unitid"
+                                        :label="$t(item.unitname)"
+                                        :value="item.unitid"
+                                    >
+                                    </el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t(`单位组`)" :prop="form.isauxunit === 1 ? 'unitgroupid' : ''">
+                                <el-select
+                                    style="width: 100%"
+                                    v-model="form.unitgroupid"
+                                    :disabled="form.isauxunit === 0"
+                                    :placeholder="$t('请选择')"
+                                    clearable
+                                >
+                                    <el-option
+                                        v-for="item in unitGroupData"
+                                        :key="item.unitgroupid"
+                                        :label="$t(item.unitgroupname)"
+                                        :value="item.unitgroupid"
+                                    >
+                                        <p style="float: left">
+                                            {{ item.unitgroupname }}
+                                        </p>
+                                        <p
+                                            style="
+                                                float: right;
+                                                color: #8492a6;
+                                                font-size: 13px;
+                                            "
+                                        >
+                                            {{ item.conversionrate
+                                            }}{{ item.unitname }}/{{
+                                                item.auxunitname
+                                            }},{{ $t(`换算率`) }}:{{
+                                                "1:" + item.conversionrate
+                                            }}
+                                        </p>
+                                    </el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('最小订购量:')" prop="orderminqty">
+                                <el-input-number
+                                    v-model="form.orderminqty"
+                                    :min="1"
+                                    :placeholder="$t('请填写最小订购量')"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('订购增量:')" prop="orderaddqty">
+                                <el-input-number
+                                    v-model="form.orderaddqty"
+                                    :min="1"
+                                    :placeholder="$t('请填写订购增量')"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('备注:')" prop="remarks">
+                                <el-input
+                                    type="textarea"
+                                    v-model="form.remarks"
+                                    :placeholder="$t('请填写备注')"
+                                ></el-input>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="20">
+                            <el-form-item :label="$t('商品图:')">
+                                <div
+                                    class="flex-align-center"
+                                    style="flex-wrap: wrap"
+                                >
+                                    <uploadFile
+                                        ref="upload"
+                                        style="margin: 10px 10px 10px 0"
+                                        :folderid="folderid"
+                                        accept=".JPG,.PNG,.jpg,.png"
+                                        type="image"
+                                        :bindData="bindData"
+                                        @onSuccess="uploadSuccess"
+                                    >
+                                    </uploadFile>
+                                    <template v-if="title_btn == '编辑'">
+                                        <previewImage
+                                            style="
+                                                margin: 10px 10px 10px 0;
+                                            "
+                                            v-for="image in form.attinfos"
+                                            :key="image.index"
+                                            :image="image"
+                                            :deletebtn="true"
+                                            @onSuccess="clearCover"
+                                        ></previewImage>
+                                    </template>
+                                </div>
+
+                                <small
+                                    style="display: block; margin-top: 18px"
+                                    class="info"
+                                    >{{
+                                        $t(`注:建议上传图片大小`)
+                                    }}1024x1024px,{{ $t("大小不超过") }}2M,{{
+                                        $t("格式为")
+                                    }}JPG/PNG</small
+                                >
+                            </el-form-item>
+                        </el-col>
+                    </el-form>
+                </el-row>
+            </div>
+            <div class="fixed__btn__panel">
+                <el-button
+                    size="small"
+                    @click="onCancel"
+                    class="normal-btn-width"
+                    >{{ $t("取 消") }}</el-button
+                >
+                <el-button
+                    :loading="loading"
+                    class="normal-btn-width"
+                    size="small"
+                    :type="title_btn == '编辑' ? 'warning' : 'primary'"
+                    @click="onSubmit"
+                    >{{ title_btn == "编辑" ? $t("保 存") : $t("确 定") }}
+                </el-button>
+            </div>
+        </el-drawer>
+    </div>
+</template>
+<script>
+import uploadFile from "@/components/upload/preview_upload.vue";
+import previewImage from "@/components/previewImage/index.vue";
+export default {
+    name: "add",
+    components: { uploadFile, previewImage },
+    props: {
+        btn_size: String,
+        title_btn: String,
+        title_drawer: String,
+        data: Object,
+    },
+    data() {
+        return {
+            folderid: JSON.parse(sessionStorage.getItem("folderid"))
+                .appfolderid,
+            bindData: {},
+            unitData: [],
+            unitGroupData: [],
+            loading: false,
+            dialogFormVisible: false,
+            currentData: {},
+            form: {
+                sc_points_productid: 0,
+                itemno: "",
+                itemname: "",
+                price: 0,
+                points: 0,
+                isauxunit: 0,
+                orderminqty: 1,
+                orderaddqty: 1,
+                unitid: "",
+                unitgroupid: "",
+                remarks: "",
+                attinfos: [],
+            },
+            rules: {
+                itemname: [
+                    {
+                        required: true,
+                        message: this.$t("请填写商品名称"),
+                        trigger: "blur",
+                    },
+                ],
+                itemno: [
+                    {
+                        required: true,
+                        message: this.$t("请填写商品编号"),
+                        trigger: "blur",
+                    },
+                ],
+                points: [
+                    {
+                        required: true,
+                        message: this.$t("请填写积分"),
+                        trigger: "blur",
+                    },
+                ],
+                price: [
+                    {
+                        required: true,
+                        message: this.$t("请填写价格"),
+                        trigger: "blur",
+                    },
+                ],
+            },
+        };
+    },
+    methods: {
+        show() {
+            this.unitlist();
+            this.dialogFormVisible = true;
+            if (this.title_btn == "编辑") {
+                this.form = Object.assign({}, this.form, this.data);
+            }
+        },
+        async unitlist() {
+            const res = await this.$api.requested({
+                id: "20220922084803",
+                version: 1,
+                nocache: true,
+                content: {
+                    pageSize: 1000,
+                    where: {
+                        condition: "",
+                    },
+                },
+            });
+            this.unitData = res.data;
+        },
+        onSubmit() {
+            this.$refs["form"].validate(async (valid) => {
+                if (!valid) return false;
+                if (this.form.isauxunit === 1 && !this.form.unitgroupid) {
+                    this.$message.error(this.$t("请选择单位组"));
+                    return false;
+                }
+                this.loading = true;
+                const res = await this.$api.requested({
+                    id: 2026052209110806,
+                    content: this.form,
+                });
+                if (res.code === 0) {
+                    this.loading = false;
+                    this.$message.error(
+                        res.msg ||
+                            (this.title_btn == "编辑" ? this.$t("编辑失败") : this.$t("新建失败"))
+                    );
+                    return;
+                }
+                this.loading = false;
+                this.$message.success(
+                    this.title_btn == "编辑" ? this.$t("编辑成功") : this.$t("新建成功")
+                );
+                this.bindData = {
+                    ownertable: "sc_points_product",
+                    ownerid: res.data.sc_points_productid,
+                    usetype: "default",
+                };
+                this.$refs["upload"].toUpload();
+                this.$emit("onSuccess");
+                this.dialogFormVisible = false;
+                this.$refs["form"].resetFields();
+                setTimeout(() => {
+                    if (this.form.sc_points_productid && this.form.sc_points_productid !== 0) {
+                        this.$router.push({
+                            path: "/pointsbasedproductsDetail",
+                            query: {
+                                id: this.form.sc_points_productid,
+                                rowindex: res.data.rowindex,
+                            },
+                        });
+                        this.$store.dispatch("changeDetailDrawer", true);
+                    } else {
+                        this.$emit("onSuccess");
+                    }
+                }, 500);
+            });
+        },
+        onCancel() {
+            this.dialogFormVisible = false;
+            this.$refs["form"].resetFields();
+        },
+        uploadSuccess(res) {
+            this.$emit("onSuccess");
+        },
+        clearCover() {
+            this.queryMain();
+        },
+        async queryMain() {
+            const res = await this.$api.requested({
+                id: 2026052209105106,
+                content: {
+                    nocache: true,
+                    sc_points_productid: this.$route.query.id,
+                },
+            });
+            this.form = Object.assign({}, this.form, res.data);
+        },
+    },
+};
+</script>

+ 62 - 0
src/bgj/pointsbasedproducts/modules/baseInfo.vue

@@ -0,0 +1,62 @@
+<template>
+    <div>
+        <div class="normal-margin">
+            <el-descriptions
+                :column="3"
+                :title="$t('基本信息')"
+                labelClassName="my-label"
+                contentClassName="my-content"
+                border
+            >
+                <el-descriptions-item
+                    v-for="(item, index) in detailInfo.baseInfo"
+                    :key="index"
+                    :label="$t(item.label)"
+                >
+                    <span :style="item.style ? item.style() : ''">{{
+                        item.value ? $t(item.value) : "--"
+                    }}</span>
+                </el-descriptions-item>
+            </el-descriptions>
+        </div>
+
+        <div class="normal-margin">
+            <el-descriptions
+                :column="3"
+                :title="$t('系统信息')"
+                labelClassName="my-label"
+                contentClassName="my-content"
+                border
+            >
+                <el-descriptions-item
+                    v-for="(item, index) in detailInfo.systemInfo"
+                    :key="index"
+                    :label="$t(item.label)"
+                    >{{
+                        item.value ? $t(item.value) : "--"
+                    }}</el-descriptions-item
+                >
+            </el-descriptions>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: "baseInfo",
+    props: ["detailInfo"],
+    detailInfo() {
+        return {};
+    },
+    mounted() {},
+    methods: {},
+};
+</script>
+
+<style scoped>
+/deep/.el-descriptions-item__label {
+    font-size: 14px;
+    color: rgb(163, 163, 163) !important;
+    white-space: nowrap;
+}
+</style>

+ 2 - 2
src/bgj/pointsbasedproducts/modules/batchDown.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
-    <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">{{$t(`批量下架`)}}</el-button>
+    <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">{{ btnName ? $t(btnName) : $t('批量下架') }}</el-button>
   </div>
 </template>
 
 <script>
 export default {
   name: "batchDown",
-  props:["rowData","disabled"],
+  props:["rowData","disabled","btnName"],
   methods:{
     onshow(){
       this.onBatchDown()

+ 2 - 2
src/bgj/pointsbasedproducts/modules/batchUp.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
-    <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">{{$t(`批量上架`)}}</el-button>
+    <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">{{ btnName ? $t(btnName) : $t('批量上架') }}</el-button>
   </div>
 </template>
 
 <script>
 export default {
   name: "batchUp",
-  props:["rowData","disabled"],
+  props:["rowData","disabled","btnName"],
   methods:{
     onshow(){
       this.onBatchUp()

+ 304 - 0
src/bgj/pointsbasedproducts/modules/detail.vue

@@ -0,0 +1,304 @@
+<template>
+    <div>
+        <basicDetails
+            ref="details"
+            :titleText="mainData.itemname"
+            :editData="mainData"
+            :mainAreaData="mainAreaData"
+            turnPageId="2026052209105106"
+            idname="sc_points_productid"
+            ownertable="sc_points_product"
+            tags=""
+            :tabs="['详细信息']"
+            :column="5"
+            @pageChange="pageChange"
+            @onEditSuccess="queryMainData($route.query.id)"
+        >
+            <div slot="tags"></div>
+            <template slot="customOperation">
+                <Edit
+                    v-if="mainData.status === '新建'"
+                    class="inline-16"
+                    title_btn="编辑"
+                    title_drawer="编辑积分商品"
+                    btn_size="mini"
+                    :data="mainData"
+                    @onSuccess="queryMainData"
+                ></Edit>
+                <batchUp
+                    v-if="
+                        mainData.status === '新建' &&
+                        mainData.isonsale === 0 &&
+                        tool.checkAuth($route.name, 'batchUp')
+                    "
+                    class="inline-16"
+                    :rowData="[mainData]"
+                    btnName="上架"
+                    btn_size="mini"
+                    @batchUpSuccess="queryMainData"
+                ></batchUp>
+                <batchDown
+                    v-if="
+                        mainData.status === '新建' &&
+                        mainData.isonsale === 1 &&
+                        tool.checkAuth($route.name, 'batchDown')
+                    "
+                    class="inline-16"
+                    :rowData="[mainData]"
+                    btnName="下架"
+                    btn_size="mini"
+                    @batchUpSuccess="queryMainData"
+                ></batchDown>
+                <toExamine
+                    v-if="
+                        mainData.status === '新建' &&
+                        tool.checkAuth($route.name, 'toExamine')
+                    "
+                    class="inline-16"
+                    :rowData="[mainData]"
+                    btnName="审核"
+                    btn_size="mini"
+                    @examineSuccess="queryMainData"
+                ></toExamine>
+                <counterExamine
+                    v-if="
+                        mainData.status === '审核' &&
+                        tool.checkAuth($route.name, 'reverseReview')
+                    "
+                    class="inline-16"
+                    :rowData="[mainData]"
+                    btnName="反审"
+                    btn_size="mini"
+                    @examineSuccess="queryMainData"
+                ></counterExamine>
+                <el-button
+                    type="danger"
+                    @click="onDelete"
+                    size="mini"
+                    :loading="deleteLoading"
+                    v-if="mainData.status === '新建'"
+                    >{{ $t(`删 除`) }}</el-button>
+            </template>
+            <div slot="slot0">
+                <baseInfo
+                    v-if="detailInfo"
+                    :detailInfo="detailInfo"
+                ></baseInfo>
+            </div>
+        </basicDetails>
+    </div>
+</template>
+
+<script>
+import Edit from "./add";
+import BaseInfo from "./baseInfo";
+import batchUp from "./batchUp";
+import batchDown from "./batchDown";
+import toExamine from "./toExamine";
+import counterExamine from "./counterExamine";
+export default {
+    name: "detail",
+    data() {
+        return {
+            mainData: {},
+            mainAreaData: {},
+            detailInfo: "",
+            deleteLoading: false,
+        };
+    },
+    components: {
+        Edit,
+        BaseInfo,
+        batchUp,
+        batchDown,
+        toExamine,
+        counterExamine,
+    },
+    methods: {
+        async queryMainData() {
+            const res = await this.$api.requested({
+                id: 2026052209105106,
+                content: {
+                    nocache: true,
+                    sc_points_productid: this.$route.query.id,
+                },
+            });
+            this.mainData = res.data;
+            this.changeDataStructure();
+            console.log("this.mainData", this.mainData);
+        },
+        changeDataStructure() {
+            this.mainAreaData = [
+                {
+                    label: "商品名称",
+                    value: this.mainData.itemname,
+                },
+                {
+                    label: "商品编号",
+                    value: this.mainData.itemno,
+                },
+                {
+                    label: "价格",
+                    value: this.mainData.price,
+                },
+                {
+                    label: "积分",
+                    value: this.mainData.points,
+                },
+                
+                {
+                    label: "最小订购量",
+                    value: this.mainData.orderminqty,
+                },
+                {
+                    label: "订购增量",
+                    value: this.mainData.orderaddqty,
+                },
+                {
+                    label: "单位",
+                    value: this.mainData.unitname,
+                },
+                {
+                    label: "上架状态",
+                    value: this.mainData.isonsale == 1 ? "上架" : "下架",
+                    style: () => {
+                        let color =
+                            this.mainData.isonsale == 1
+                                ? this.tool.getStatusColor("上架", true)
+                                : this.tool.getStatusColor("下架", true);
+                        return { color: color };
+                    },
+                },
+                {
+                    label: "状态",
+                    value: this.mainData.status,
+                    style: () => {
+                        let color = this.tool.getStatusColor(
+                            this.mainData.status,
+                            true
+                        );
+                        return { color: color };
+                    },
+                },
+            ];
+            this.detailInfo = {
+                baseInfo: [
+                    {
+                        label: "商品名称",
+                        value: this.mainData.itemname,
+                    },
+                    {
+                        label: "商品编号",
+                        value: this.mainData.itemno,
+                    },
+                    {
+                        label: "积分",
+                        value: this.mainData.points,
+                    },
+                    {
+                        label: "价格",
+                        value: this.mainData.price,
+                    },
+                    {
+                        label: "最小订购量",
+                        value: this.mainData.orderminqty,
+                    },
+                    {
+                        label: "订购增量",
+                        value: this.mainData.orderaddqty,
+                    },
+                    {
+                        label: "单位",
+                        value: this.mainData.unitname,
+                    },
+                    {
+                        label: "上架状态",
+                        value: this.mainData.isonsale == 1 ? "上架" : "下架",
+                        style: () => {
+                            let color =
+                                this.mainData.isonsale == 1
+                                    ? this.tool.getStatusColor("上架", true)
+                                    : this.tool.getStatusColor("下架", true);
+                            return { color: color };
+                        },
+                    },
+                    {
+                        label: "状态",
+                        value: this.mainData.status,
+                        style: () => {
+                            let color = this.tool.getStatusColor(
+                                this.mainData.status,
+                                true
+                            );
+                            return { color: color };
+                        },
+                    },
+                    {
+                        label: "备注",
+                        value: this.mainData.remarks,
+                    },
+                ],
+                systemInfo: [
+                    { label: "创建人", value: this.mainData.createby },
+                    { label: "创建时间", value: this.mainData.createdate },
+                    { label: "最近编辑人", value: this.mainData.changeby },
+                    { label: "最近编辑时间", value: this.mainData.changedate },
+                    { label: "上架人", value: this.mainData.onsaleby },
+                    { label: "上架时间", value: this.mainData.onsaledate },
+                ],
+            };
+        },
+        pageChange(id, rowindex, tabIndex) {
+            this.flag = false;
+            tabIndex = this.$route.query.tabIndex;
+            this.$router.replace({
+                path: "/pointsbasedproductsDetail",
+                query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
+            });
+            this.queryMainData(id);
+        },
+        onDelete() {
+            this.$confirm(
+                this.$t("是否确认删除此积分商品") + "?",
+                this.$t("提示"),
+                {
+                    confirmButtonText: this.$t("确定"),
+                    cancelButtonText: this.$t("取消"),
+                    type: "warning",
+                }
+            )
+                .then(async () => {
+                    this.deleteLoading = true;
+                    const res = await this.$api.requested({
+                        id: "2026052209112406",
+                        content: {
+                            sc_points_productid: this.$route.query.id,
+                        },
+                    });
+                    this.deleteLoading = false;
+                    if (res.code === 0) {
+                        this.$message.error(res.data[0].errmsg);
+                    } else {
+                        this.$message({
+                            message: this.$t("删除成功"),
+                            type: "success",
+                        });
+                        this.$store.dispatch("changeDetailDrawer", false);
+                    }
+                })
+                .catch(() => {
+                    this.$message({
+                        type: "info",
+                        message: this.$t("已取消删除"),
+                    });
+                });
+        },
+    },
+    mounted() {
+        this.queryMainData(this.$route.query.id);
+    },
+    created() {},
+};
+</script>
+
+<style scoped></style>

+ 14 - 1
src/router/bgj.js

@@ -162,7 +162,20 @@ const bgj = [
       ast_nav: true,
       keeproute: true,
     },
-    component: () => import(/* webpackChunkName: "about" */ '@/bgj/pointsbasedproducts/index')
+    component: () => import(/* webpackChunkName: "about" */ '@/bgj/pointsbasedproducts/index'),
+    children: [
+      {
+        path: '/pointsbasedproductsDetail',
+        name: 'pointsbasedproducts',
+        meta: {
+          title: '积分商品详情',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () =>
+          import(/* webpackChunkName: "about" */ '@/bgj/pointsbasedproducts/modules/detail'),
+      },
+    ],
   },
   {
     path: '/pointsbasedorder',