qymljy 4 ay önce
ebeveyn
işleme
aed37e2207

+ 116 - 0
src/Form/codeManage/add.vue

@@ -0,0 +1,116 @@
+<template>
+  <div>
+    <el-button
+        size="small"
+        type="primary"
+        @click="addBtn"
+    >{{ $t("新 建") }}</el-button>
+    <el-drawer
+        :title="$t('新建二维码')"
+        :visible.sync="dialogFormVisible"
+        :wrapperClosable="false"
+        size="700px"
+        direction="rtl"
+        append-to-body
+        :show-close="false"
+        @close="onClose"
+    >
+      <div class="drawer__panel">
+        <el-row :gutter="10">
+          <el-form
+              :model="form"
+              :rules="rules"
+              ref="form"
+              :label-width="tool.onlyZh('90px')"
+              label-position="right"
+              size="mini"
+          >
+            <el-col :span="24">
+              <el-form-item :label="$t('标题') + ':'" prop="title">
+                <el-input
+                    v-model="form.title"
+                    :placeholder="$t('请填写标题')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t('备注') + ':'">
+                <el-input
+                    type="textarea"
+                    :rows="5"
+                    v-model="form.remarks"
+                    :placeholder="$t('请填写备注')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button
+            size="small"
+            @click="onClose"
+            class="normal-btn-width inline-16"
+        >{{ $t("取 消") }}</el-button>
+        <el-button
+            size="small"
+            type="primary"
+            :loading="loading"
+            @click="onSubmit"
+            class="normal-btn-width"
+        >{{ $t("确 定") }}</el-button>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "add",
+  data(){
+    return {
+      dialogFormVisible:false,
+      loading:false,
+      form:{
+        "plm_technicalinfo_codeid": 0,
+        "title": "",
+        "remarks": ""
+      },
+      rules:{
+        title: [
+          {
+            required: true,
+            message: this.$t("请填写标题"),
+            trigger: "blur",
+          },
+        ],
+      }
+    }
+  },
+  methods:{
+    addBtn(){
+      this.dialogFormVisible = true
+    },
+    onSubmit(){
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": 2025082513204302,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          this.dialogFormVisible = false
+        })
+      })
+    },
+    onClose(){
+      this.dialogFormVisible = false
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 122 - 0
src/Form/codeManage/edit.vue

@@ -0,0 +1,122 @@
+<template>
+  <div>
+    <el-button
+        size="small"
+        type="text"
+        @click="editBtn"
+    >{{ $t("编辑") }}</el-button>
+    <el-drawer
+        :title="$t('编辑二维码')"
+        :visible.sync="dialogFormVisible"
+        :wrapperClosable="false"
+        size="700px"
+        direction="rtl"
+        append-to-body
+        :show-close="false"
+        @close="onClose"
+    >
+      <div class="drawer__panel">
+        <el-row :gutter="10">
+          <el-form
+              :model="form"
+              :rules="rules"
+              ref="form"
+              :label-width="tool.onlyZh('90px')"
+              label-position="right"
+              size="mini"
+          >
+            <el-col :span="24">
+              <el-form-item :label="$t('标题') + ':'" prop="title">
+                <el-input
+                    v-model="form.title"
+                    :placeholder="$t('请填写标题')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t('备注') + ':'">
+                <el-input
+                    type="textarea"
+                    :rows="5"
+                    v-model="form.remarks"
+                    :placeholder="$t('请填写备注')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button
+            size="small"
+            @click="onClose"
+            class="normal-btn-width inline-16"
+        >{{ $t("取 消") }}</el-button>
+        <el-button
+            size="small"
+            type="primary"
+            :loading="loading"
+            @click="onSubmit"
+            class="normal-btn-width"
+        >{{ $t("确 定") }}</el-button>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+<script>
+export default {
+  name: "edit",
+  props:['data'],
+  data(){
+    return {
+      dialogFormVisible:false,
+      loading:false,
+      form:{
+        "plm_technicalinfo_codeid": 0,
+        "title": "",
+        "remarks": ""
+      },
+      rules:{
+        title: [
+          {
+            required: true,
+            message: this.$t("请填写标题"),
+            trigger: "blur",
+          },
+        ],
+      }
+    }
+  },
+  methods:{
+    editBtn(){
+      this.dialogFormVisible = true
+      console.log(this.data)
+      this.form = {
+        "plm_technicalinfo_codeid": this.data.plm_technicalinfo_codeid,
+        "title": this.data.title,
+        "remarks": this.data.remarks
+      }
+    },
+    onSubmit(){
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": 2025082513204302,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          this.dialogFormVisible = false
+        })
+      })
+    },
+    onClose(){
+      this.dialogFormVisible = false
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 42 - 0
src/HDrpManagement/codeManage/index.vue

@@ -0,0 +1,42 @@
+<template>
+  <div>
+    <basicLayout
+        style="padding-top:0 !important"
+        ref="basicLayout"
+        formPath="codeManage"
+        tableName="codesTable"
+        idName="plm_technicalinfo_codeids"
+        :apiId="{query:2025082513210302,del:2025082513211502}">
+      <template v-slot:tbList="scope">
+        <div>
+          {{scope.data.column.data[scope.data.column.columnname]}}
+        </div>
+      </template>
+      <template v-slot:tbOpreation="scope">
+        <edit :data="scope.data.data" @onSuccess="onSuccess" class="inline-16"></edit>
+        <darwerPanel :id="scope.data.data.plm_technicalinfo_codeid" :title="$t(`关联商品`)" :detailPath="{path:'/relationCode'}" class="inline-16"/>
+        <btnDelete class="inline-16" paramID="2025082513211502" nameKey="plm_technicalinfo_codeids" :id="scope.data.data.plm_technicalinfo_codeid"
+                   message="确认是否删除,确定删除则删除该二维码id及其所有关联商品信息" @onSuccess="onSuccess" btnTitle="删除"></btnDelete>
+      </template>
+    </basicLayout>
+  </div>
+</template>
+
+<script>
+import edit from '@/Form/codeManage/edit'
+import darwerPanel from '@/HManagement/archives_sc/components/Rpanel'
+import btnDelete from '@/components/btn-popconfirm/index'
+export default {
+  name: "index",
+  components:{edit,darwerPanel,btnDelete},
+  methods:{
+    onSuccess(){
+      this.$refs.basicLayout.listData()
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/HDrpManagement/prodectFileData/components/add.vue

@@ -25,7 +25,7 @@
             <div v-if="scope.column.columnname === 'province'">
               <span>{{scope.column.data.province}} - {{scope.column.data.city}} - {{scope.column.data.county}}</span>
             </div>
-            <div v-else-if="scope.column.columnname === 'isonsale'" :style="{color:scope.column.data[scope.column.columnname] === 1?tool.getStatusColor('上架',true):tool.getStatusColor('下架',true)}">>
+            <div v-else-if="scope.column.columnname === 'isonsale'" :style="{color:scope.column.data[scope.column.columnname] === 1?tool.getStatusColor('上架',true):tool.getStatusColor('下架',true)}">
               <span>{{scope.column.data.isonsale ? $t('上架') : $t('下架')}}</span>
             </div>
             <p v-else-if="scope.column.columnname === 'status'">

+ 47 - 0
src/components/btn-popconfirm/index.vue

@@ -0,0 +1,47 @@
+<template>
+  <div>
+    <el-popconfirm
+        :title="$t(message)"
+        @confirm="onClick"
+    >
+      <el-button slot="reference" type="text" size="small">{{$t(btnTitle)}}</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index",
+  props:{
+    message:String,
+    btnTitle:String,
+    nameKey:String,
+    id:String,
+    paramID:String,
+    isNumber:Boolean
+  },
+  data(){
+    return {
+      param:{
+        id:this.paramID,
+        content:{
+          [this.nameKey]: [this.id]
+        }
+      }
+    }
+  },
+  methods:{
+    async onClick(){
+      this.param.content[this.nameKey] = this.isNumber ? this.id : [this.id];
+      const res = await this.$api.requested(this.param)
+      this.tool.showMessage(res, () => {
+        this.$emit("onSuccess");
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 21 - 0
src/router/HDrpManagement.js

@@ -230,6 +230,27 @@ const HDrpManagement = [
         component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/prodectFileData/modules/relation')
       }
     ]
+  },{
+    path: '/codeManage',
+    name: 'codeManage',
+    meta: {
+      title: '资料二维码管理',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/codeManage/index'),
+    children: [
+      {
+        path: '/relationCode',
+        name:'codeManage',
+        meta: {
+          title: '资料二维码管理关联商品',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/prodectFileData/modules/relation')
+      }
+    ]
   },{
     path: '/accountclass',
     name: 'accountclass',