Selaa lähdekoodia

总部服务物料 详情

NULL1222 3 viikkoa sitten
vanhempi
commit
0441660067

+ 1 - 1
src/Form/headquartersServiceMaterial/add.vue

@@ -351,7 +351,7 @@ export default {
                         trigger: "blur",
                     },
                 ],
-                unit: [
+                unitid: [
                     {
                         required: true,
                         message: this.$t("请选择主单位"),

+ 158 - 15
src/bgj/headquartersServiceMaterial/index.vue

@@ -45,7 +45,7 @@
                     class="inline-16"
                     ref="importImage"
                     :bindData="{
-                        ownertable: 'plm_item',
+                        ownertable: 'hsm_item',
                         ownerid: $route.query.id,
                         usetype: 'default',
                     }"
@@ -55,6 +55,99 @@
                 ></importImage>
                 <!-- v-if="tool.checkAuth($route.name, 'exportImage')" -->
             </template>
+            <template #custom>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t(`是否上下架`) }}:</label>
+                    <el-select
+                        class="inline-24"
+                        v-model="selectParam.shelf"
+                        :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>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t(`状态`) }}:</label>
+                    <el-select
+                        class="inline-24"
+                        v-model="selectParam.status"
+                        :placeholder="$t(`请选择`)"
+                        @change="selectChange"
+                        size="small"
+                        clearable
+                    >
+                        <el-option :label="$t('新建')" value="1"></el-option>
+                        <el-option :label="$t('审核')" value="2"></el-option>
+                    </el-select>
+                </div>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t(`领域`) }}:</label>
+                    <el-select
+                        class="inline-24"
+                        v-model="selectParam.domain"
+                        :placeholder="$t('请选择领域')"
+                        @change="selectChange"
+                        size="small"
+                        clearable
+                    >
+                        <el-option
+                            v-for="item in tradefield"
+                            :key="item.value"
+                            :label="$t(item.value)"
+                            :value="item.value"
+                        >
+                        </el-option>
+                    </el-select>
+                </div>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t(`上架时间`) }}:</label>
+                    <el-date-picker
+                        style="margin-right: 24px !important"
+                        size="small"
+                        @change="selectChange"
+                        value-format="yyyy-MM-dd"
+                        v-model="dateSelect"
+                        type="daterange"
+                        :range-separator="$t(`至`)"
+                        :start-placeholder="$t(`开始日期`)"
+                        :end-placeholder="$t(`结束日期`)"
+                        clearable
+                    >
+                    </el-date-picker>
+                </div>
+                <div class="mt-10">
+                    <el-input
+                        style="width: 200px"
+                        :placeholder="$t(`型号`)"
+                        suffix-icon="el-icon-search"
+                        v-model="selectParam.type"
+                        @keyup.native.enter="selectChange"
+                        @clear="selectChange"
+                        size="small"
+                        class="input-with-select inline-16 layout_search__panel"
+                        clearable
+                    >
+                    </el-input>
+                </div>
+                <div class="mt-10">
+                    <el-input
+                        style="width: 200px"
+                        :placeholder="$t(`规格`)"
+                        suffix-icon="el-icon-search"
+                        v-model="selectParam.spec"
+                        @keyup.native.enter="selectChange"
+                        @clear="selectChange"
+                        size="small"
+                        class="input-with-select inline-16 layout_search__panel"
+                        clearable
+                    >
+                    </el-input>
+                </div>
+            </template>
             <template v-slot:tbList="scope">
                 <p
                     :style="{
@@ -65,7 +158,26 @@
                     }"
                     v-if="scope.data.column.columnname === 'shelf'"
                 >
-                    {{ scope.data.column.data.shelf ? $t("上架") : $t("下架") }}
+                    {{
+                        scope.data.column.data.shelf === 1
+                            ? $t("上架")
+                            : $t("下架")
+                    }}
+                </p>
+                <p
+                    :style="{
+                        color:
+                            scope.data.column.data.status === 1
+                                ? tool.getStatusColor('新建', true)
+                                : tool.getStatusColor('审核', true),
+                    }"
+                    v-else-if="scope.data.column.columnname === 'status'"
+                >
+                    {{
+                        scope.data.column.data.status === 1
+                            ? $t("新建")
+                            : $t("审核")
+                    }}
                 </p>
                 <p v-else-if="scope.data.column.columnname === 'domain'">
                     <span
@@ -154,6 +266,9 @@ export default {
         return {
             rowData: [],
             errorUrl: null,
+            tradefield: [], // 领域
+            selectParam: {},
+            dateSelect: "",
         };
     },
     components: {
@@ -165,6 +280,13 @@ export default {
         previewImage,
     },
     methods: {
+        async fieldData() {
+            const res = await this.$store.dispatch(
+                "optiontypeselect",
+                "tradefield"
+            );
+            this.tradefield = res.data;
+        },
         rows(val) {
             this.rowData = val;
         },
@@ -172,20 +294,41 @@ export default {
             this.$refs.list.listData();
         },
         async bindImportImage(id) {
-            // const res = await this.$api.requested({
-            //     id: "20230407164104",
-            //     content: {
-            //         attachmentid: id,
-            //     },
-            // });
-            // if (res.msg !== "成功") {
-            //     this.errorUrl = res.msg;
-            //     res.msg = this.$t("失败");
-            // }
-            // this.tool.showMessage(res, () => {
-            //     this.$refs.list.listData();
-            // });
+            const res = await this.$api.requested({
+                id: "20250519130506",
+                content: {
+                    attachmentid: id,
+                },
+            });
+            if (res.msg !== "成功") {
+                this.errorUrl = res.msg;
+                res.msg = this.$t("失败");
+            }
+            this.tool.showMessage(res, () => {
+                this.$refs.list.listData();
+            });
+        },
+
+        selectChange() {
+            if (this.dateSelect !== "" && this.dateSelect !== null) {
+                this.selectParam.begindate = this.dateSelect[0];
+                this.selectParam.enddate = this.dateSelect[1];
+            } else {
+                this.selectParam.begindate = "";
+                this.selectParam.enddate = "";
+            }
+            this.$refs.list.param.content.pageNumber = 1;
+            this.$refs.list.param.content.where = this.selectParam;
+            this.$refs.list.listData();
         },
+        listData() {
+            this.$refs.list.param.content.where = this.selectParam;
+            this.$refs.list.listData();
+        },
+    },
+    mounted() {
+        this.fieldData();
+        this.listData();
     },
 };
 </script>

+ 145 - 164
src/bgj/headquartersServiceMaterial/modules/addClass.vue

@@ -1,178 +1,159 @@
 <template>
-  <div>
-    <el-button type="primary" size="small" @click="dialogFormVisible=true" >{{$t(`设置分类`)}}</el-button>
-    <el-dialog append-to-body :title="$t(`设置分类`)" :visible.sync="dialogFormVisible" width="900px">
-      <el-input style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="condition?condition.length > 0?'':'':'el-icon-search'" v-model="condition" @keyup.native.enter="getClassList()" @clear="getClassList" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
-      </el-input>
-      <el-table
-        :data="classList"
-        stripe
-        row-key="itemclassid"
-        size="small"
-        height="500px"
-        default-expand-all
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
-        <el-table-column width="100">
-        </el-table-column>
-        <el-table-column
-            prop="itemclassnum"
-            :label="$t(`分类编号`)">
-        </el-table-column>
-        <el-table-column
-          prop="itemclassname"
-          :label="$t(`分类名称`)">
-        </el-table-column>
-        <el-table-column
-          :label="$t('操作')"
-          width="50">
-          <template slot-scope="scope">
-            <el-button type="text" size="mini" v-if="scope.row.disabled" @click="onSubmit(scope.row)">{{$t('添 加')}}</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-        <!-- <el-tree
-          ref="tree"
-          :data="classList"
-          show-checkbox
-          node-key="itemclassid"
-          :default-expand-all="true"
-          :default-checked-keys="data.checkArr">
-        </el-tree> -->
-      <!-- <div slot="footer" class="dialog-footer">
-        <el-button size="small" @click="dialogFormVisible=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-dialog>
-  </div>
+    <div>
+        <el-button
+            type="primary"
+            size="small"
+            @click="dialogFormVisible = true"
+            >{{ $t(`设置分类`) }}</el-button
+        >
+        <el-dialog
+            append-to-body
+            :title="$t(`设置分类`)"
+            :visible.sync="dialogFormVisible"
+            width="900px"
+        >
+            <el-input
+                style="width: 200px"
+                :placeholder="$t('搜索')"
+                :suffix-icon="
+                    condition
+                        ? condition.length > 0
+                            ? ''
+                            : ''
+                        : 'el-icon-search'
+                "
+                v-model="condition"
+                @keyup.native.enter="getClassList()"
+                @clear="getClassList"
+                size="small"
+                class="input-with-select inline-16 layout_search__panel"
+                clearable
+            >
+            </el-input>
+            <el-table
+                :data="classList"
+                stripe
+                row-key="itemclassid"
+                size="small"
+                height="500px"
+                default-expand-all
+                :tree-props="{
+                    children: 'children',
+                    hasChildren: 'hasChildren',
+                }"
+            >
+                <el-table-column width="100"> </el-table-column>
+                <el-table-column prop="itemclassnum" :label="$t(`分类编号`)">
+                </el-table-column>
+                <el-table-column prop="itemclassname" :label="$t(`分类名称`)">
+                </el-table-column>
+                <el-table-column :label="$t('操作')" width="50">
+                    <template slot-scope="scope">
+                        <el-button
+                            type="text"
+                            size="mini"
+                            v-if="scope.row.disabled"
+                            @click="onSubmit(scope.row)"
+                            >{{ $t("添 加") }}</el-button
+                        >
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-import selectTable from '@/components/selectTable/index'
-import { log } from '@antv/g2plot/lib/utils'
+import selectTable from "@/components/selectTable/index";
 export default {
-  props:['data'],
-  components:{selectTable},
-  data () {
-    return {
-      dialogFormVisible:false,
-      classList:[],
-      disabledId:[],
-      tableList:[],
-      tablecols:[],
-      result:[],
-      condition:''
-    }
-  },
-  methods:{
-    // async onSubmit () {
-    //   let arr = this.$refs.tree.getCheckedNodes().map(item => item.itemclassid)
-    //   let res = await this.$api.requested({
-    //     "id": 20220927090102,
-    //     "content": {
-    //         "itemclassids":arr,
-    //         "itemid": this.data.data.itemid,
-    //         "itemno":this.data.data.itemno
-    //     },
-    //   })
-    //   this.tool.showMessage(res,() => {
-    //     this.$emit('onSuccess')
-    //     this.dialogFormVisible = false
-    //   })
-    // },
-    async onSubmit (data) {
-      let res = await this.$api.requested({
-        "id": 20220927090102,
-        "content": {
-            "itemclassids":[data.itemclassid],
-            "itemid": this.data.data.itemid,
-            "itemno":this.data.data.itemno
-        },
-      })
-      this.tool.showMessage(res,() => {
-        this.$emit('onSuccess')
-        this.getClassList()
-      })
-    },
-    async getClassList () {
-      let res = await this.$api.requested({
-          "id": "20230325141103",
-          "content": {
-            "sa_brandid":0,
-            "itemid": this.$route.query.id,
-            "where": {
-              istool: this.data.data.istool ? 1 : 0,
-              condition:this.condition
-            }
-          }
-      })
-      console.log(res.data);
-      res.data = res.data.map((item,index) => {
+    props: ["data"],
+    components: { selectTable },
+    data() {
         return {
-          itemclassname:item.brandname,
-          itemclassid:index + 1,
-          subdep: item.ttemclass,
-        }
-      })
-      this.classList = this.createDeep(res.data)
-      console.log(this.classList);
+            dialogFormVisible: false,
+            classList: [],
+            disabledId: [],
+            tableList: [],
+            tablecols: [],
+            result: [],
+            condition: "",
+        };
     },
-    // createDeep (data) {
-    //   let arr = []
-    //   function createNodes (node) {
-    //     let elNode = {
-    //       label:node.itemclassname,
-    //       itemclassid:node.itemclassid,
-    //       disabled:node.disabled ? true : false,
-    //       children:[]
-    //     }
-    //     if (node.subdep && node.subdep.length > 0) {
-    //       for (let index = 0; index < node.subdep.length; index++) {
-    //         elNode.children.push(createNodes(node.subdep[index]))
-    //       }
-    //     }
-    //     return elNode
-    //   }
-
-    //   data.forEach(item => {
-    //     this.disabledId.push(item.itemclassid)
-    //     arr.push(createNodes(item))
-    //   })
-    //   return arr
-    // },
-    createDeep (data) {
-      let arr = []
-      function createNodes (node,first) {
-        let elNode = {
-          itemclassname:node.itemclassfullname ? node.itemclassfullname : node.itemclassname,
-          itemclassid:node.itemclassid,
-          itemclassnum:node.itemclassnum,
-          children:[],
-          disabled:first ? false : true
-        }
-        if (node.subdep && node.subdep.length > 0) {
-          for (let index = 0; index < node.subdep.length; index++) {
-            elNode.children.push(createNodes(node.subdep[index]))
-          }
-        }
-        return elNode
-      }
+    methods: {
+        async onSubmit(data) {
+            let res = await this.$api.requested({
+                // id: 20220927090102,
+                id: 20220927090106,
+                content: {
+                    itemclassids: [data.itemclassid],
+                    itemid: this.data.data.itemid,
+                    itemno: this.data.data.itemno,
+                },
+            });
+            this.tool.showMessage(res, () => {
+                this.$emit("onSuccess");
+                this.getClassList();
+            });
+        },
+        async getClassList() {
+            let res = await this.$api.requested({
+                // id: "20230325141103",
+                id: "20220922110406",
+                content: {
+                    sc_brandid: 0,
+                    itemid: this.$route.query.id,
+                    where: {
+                        istool: this.data.data.istool ? 1 : 0,
+                        condition: this.condition,
+                    },
+                },
+            });
+            console.log(res.data);
+            res.data = res.data.map((item, index) => {
+                return {
+                    itemclassname: item.brandname,
+                    itemclassid: index + 1,
+                    subdep: item.ttemclass,
+                };
+            });
+            this.classList = this.createDeep(res.data);
+            console.log(this.classList);
+        },
+        createDeep(data) {
+            let arr = [];
+            function createNodes(node, first) {
+                let elNode = {
+                    itemclassname: node.itemclassfullname
+                        ? node.itemclassfullname
+                        : node.itemclassname,
+                    itemclassid: node.itemclassid,
+                    itemclassnum: node.itemclassnum,
+                    children: [],
+                    disabled: first ? false : true,
+                };
+                if (node.subdep && node.subdep.length > 0) {
+                    for (let index = 0; index < node.subdep.length; index++) {
+                        elNode.children.push(createNodes(node.subdep[index]));
+                    }
+                }
+                return elNode;
+            }
 
-      data.forEach(item => {
-        this.disabledId.push(item.itemclassid)
-        arr.push(createNodes(item,true))
-      })
-      return arr
+            data.forEach((item) => {
+                this.disabledId.push(item.itemclassid);
+                arr.push(createNodes(item, true));
+            });
+            return arr;
+        },
     },
-  },
-  created () {
-    this.getClassList()
-    this.tablecols = this.tool.tabelCol(this.$route.name)['selectClassTable'].tablecols
-  }
-}
-
+    created() {
+        this.getClassList();
+        // this.tablecols = this.tool.tabelCol(this.$route.name)['selectClassTable'].tablecols
+    },
+};
 </script>
 <style scoped>
 /deep/.el-dialog__body {
-  padding-bottom: 0 !important;
+    padding-bottom: 0 !important;
 }
 </style>

+ 21 - 14
src/bgj/headquartersServiceMaterial/modules/batchDown.vue

@@ -2,35 +2,42 @@
     <div>
         <el-button
             :type="disabled ? '' : 'primary'"
-            size="small"
+            :size="btn_size ? btn_size : 'small'"
             @click="onshow"
             :disabled="disabled"
-            >{{ $t(`批量下架`) }}</el-button
         >
+            {{ btnName ? $t(btnName) : $t(`批量下架`) }}
+        </el-button>
     </div>
 </template>
 
 <script>
 export default {
     name: "batchDown",
-    props: ["rowData", "disabled"],
+    props: ["rowData", "disabled", "btnName", "btn_size"],
     methods: {
         onshow() {
             this.onBatchDown();
         },
         onBatchDown() {
-            this.$confirm(
-                this.$t("确定下架这些物料吗") + "?",
-                this.$t("提示"),
-                {
-                    confirmButtonText: this.$t("确定"),
-                    cancelButtonText: this.$t("取消"),
-                    type: "warning",
-                }
-            )
+            //根据是否传入 btnName 切换 单数/批量 文案
+            const isSingle = !!this.btnName;
+            const confirmText = isSingle
+                ? this.$t("确定下架此物料吗")
+                : this.$t("确定下架这些物料吗");
+            const cancelText = isSingle
+                ? this.$t("已取消下架")
+                : this.$t("已取消批量下架");
+            // 统一兼容数据格式
+            const dataList = this.btnName ? [this.rowData] : this.rowData;
+            this.$confirm(confirmText + "?", this.$t("提示"), {
+                confirmButtonText: this.$t("确定"),
+                cancelButtonText: this.$t("取消"),
+                type: "warning",
+            })
                 .then(async () => {
                     let row = [];
-                    this.rowData.forEach(function (item, index) {
+                    dataList.forEach(function (item, index) {
                         row[index] = item.sc_itemid;
                     });
                     // 把数组转成 逗号分隔的字符串 "1,2,3"
@@ -48,7 +55,7 @@ export default {
                 .catch(async () => {
                     this.$message({
                         type: "info",
-                        message: this.$t("已取消批量下架"),
+                        message: cancelText,
                     });
                 });
         },

+ 20 - 14
src/bgj/headquartersServiceMaterial/modules/batchUp.vue

@@ -2,10 +2,10 @@
     <div>
         <el-button
             :type="disabled ? '' : 'primary'"
-            size="small"
+            :size="btn_size ? btn_size : 'small'"
             @click="onshow"
             :disabled="disabled"
-            >{{ $t(`批量上架`) }}</el-button
+            >{{ btnName ? $t(btnName) : $t(`批量上架`) }}</el-button
         >
     </div>
 </template>
@@ -13,24 +13,30 @@
 <script>
 export default {
     name: "batchUp",
-    props: ["rowData", "disabled"],
+    props: ["rowData", "disabled", "btnName", "btn_size"],
     methods: {
         onshow() {
             this.onBatchUp();
         },
         onBatchUp() {
-            this.$confirm(
-                this.$t("确定上架这些物料吗") + "?",
-                this.$t("提示"),
-                {
-                    confirmButtonText: this.$t("确定"),
-                    cancelButtonText: this.$t("取消"),
-                    type: "warning",
-                }
-            )
+            //根据是否传入 btnName 切换 单数/批量 文案
+            const isSingle = !!this.btnName;
+            const confirmText = isSingle
+                ? this.$t("确定上架此物料吗")
+                : this.$t("确定上架这些物料吗");
+            const cancelText = isSingle
+                ? this.$t("已取消上架")
+                : this.$t("已取消批量上架");
+            // 统一兼容数据格式
+            const dataList = this.btnName ? [this.rowData] : this.rowData;
+            this.$confirm(confirmText + "?", this.$t("提示"), {
+                confirmButtonText: this.$t("确定"),
+                cancelButtonText: this.$t("取消"),
+                type: "warning",
+            })
                 .then(async () => {
                     let row = [];
-                    this.rowData.forEach(function (item, index) {
+                    dataList.forEach(function (item, index) {
                         row[index] = item.sc_itemid;
                     });
                     // 把数组转成 逗号分隔的字符串 "1,2,3"
@@ -48,7 +54,7 @@ export default {
                 .catch(async () => {
                     this.$message({
                         type: "info",
-                        message: this.$t("已取消批量上架"),
+                        message: cancelText,
                     });
                 });
         },

+ 20 - 14
src/bgj/headquartersServiceMaterial/modules/counterExamine.vue

@@ -2,7 +2,7 @@
     <div>
         <el-button
             :type="disabled ? '' : 'primary'"
-            size="small"
+            :size="btn_size ? btn_size : 'small'"
             @click="onshow"
             :disabled="disabled"
             >{{ $t(`反 审`) }}</el-button
@@ -12,7 +12,7 @@
 
 <script>
 export default {
-    props: ["rowData", "disabled"],
+    props: ["rowData", "disabled", "btnName", "btn_size"],
     name: "counterExamine",
     data() {
         return {
@@ -21,9 +21,12 @@ export default {
     },
     methods: {
         onshow() {
+            // 统一处理 单个对象 / 数组
+            const dataList = this.btnName ? [this.rowData] : this.rowData;
             this.flag = false;
-            this.rowData.forEach((e) => {
-                if (e.status === "新建") {
+            // 统一用 dataList 遍历
+            dataList.forEach((e) => {
+                if (e.status === 1) {
                     this.flag = true;
                 }
             });
@@ -46,18 +49,21 @@ export default {
             }
         },
         onCounter() {
-            this.$confirm(
-                this.$t("确定反审这些数据吗") + "?",
-                this.$t("提示"),
-                {
-                    confirmButtonText: this.$t("确定"),
-                    cancelButtonText: this.$t("取消"),
-                    type: "warning",
-                }
-            )
+            //根据是否传入 btnName 切换 单数/批量 文案
+            const isSingle = !!this.btnName;
+            const confirmText = isSingle
+                ? this.$t("确定反审此数据吗")
+                : this.$t("确定反审这些数据吗");
+            // 统一兼容数据格式
+            const dataList = this.btnName ? [this.rowData] : this.rowData;
+            this.$confirm(confirmText + "?", this.$t("提示"), {
+                confirmButtonText: this.$t("确定"),
+                cancelButtonText: this.$t("取消"),
+                type: "warning",
+            })
                 .then(async () => {
                     let row = [];
-                    this.rowData.forEach(function (item, index) {
+                    dataList.forEach(function (item, index) {
                         row[index] = item.sc_itemid;
                     });
                     // 把数组转成 逗号分隔的字符串 "1,2,3"

+ 101 - 9
src/bgj/headquartersServiceMaterial/modules/detail.vue

@@ -24,6 +24,50 @@
                     :data="mainData"
                     @onSuccess="queryMainData"
                 ></Edit>
+                <batchUp
+                    v-if="mainData.status === 2 && mainData.shelf === 0"
+                    class="inline-16"
+                    :rowData="mainData"
+                    btnName="上架"
+                    btn_size="mini"
+                    @batchUpSuccess="queryMainData"
+                ></batchUp>
+                <!-- v-if="tool.checkAuth($route.name, 'batchUp')" -->
+                <batchDown
+                    v-if="mainData.status === 2 && mainData.shelf === 1"
+                    class="inline-16"
+                    :rowData="mainData"
+                    btnName="下架"
+                    btn_size="mini"
+                    @batchUpSuccess="queryMainData"
+                ></batchDown>
+                <!-- v-if="tool.checkAuth($route.name, 'batchDown')" -->
+                <toExamine
+                    v-if="mainData.status === 1"
+                    class="inline-16"
+                    :rowData="mainData"
+                    btnName="审核"
+                    btn_size="mini"
+                    @examineSuccess="queryMainData"
+                ></toExamine>
+                <!-- v-if="tool.checkAuth($route.name, 'toExamine')" -->
+                <counterExamine
+                    v-if="mainData.status === 2"
+                    class="inline-16"
+                    :rowData="mainData"
+                    btnName="反审"
+                    btn_size="mini"
+                    @examineSuccess="queryMainData"
+                ></counterExamine>
+                <!-- v-if="tool.checkAuth($route.name, 'reverseReview')" -->
+                <!-- 新建状态下可删除 -->
+                <el-button
+                    type="danger"
+                    @click="onDelete"
+                    size="mini"
+                    v-if="mainData.status === 1"
+                    >{{ $t(`删 除`) }}</el-button
+                >
             </template>
             <div slot="slot0">
                 <base-info
@@ -34,11 +78,12 @@
             <div slot="slot1">
                 <saleClass ref="saleClass" :data="mainData">
                     <template v-slot:addClass="scope">
-                        <addClass
-                            v-if="
+                        <!-- v-if="
                                 tool.checkAuth($route.name, 'salerClass') &&
                                 mainData.status === '新建'
-                            "
+                            " -->
+                        <addClass
+                            v-if="mainData.status == 1"
                             :data="scope.data"
                             @onSuccess="
                                 $refs.saleClass.listData();
@@ -47,12 +92,12 @@
                         />
                     </template>
                     <template v-slot:delProduct="scope">
+                        <!-- v-if="tool.checkAuth($route.name, 'salerClass')" -->
                         <delete-btn
-                            v-if="tool.checkAuth($route.name, 'salerClass')"
-                            :nameId="20230214111502"
-                            nameKey="sa_itemsaleclassids"
+                            :nameId="20230214111506"
+                            nameKey="sc_itemsaleclassids"
                             message="确定删除当前分类吗?"
-                            :id="scope.data.sa_itemsaleclassid"
+                            :id="scope.data.sc_itemsaleclassids"
                             @deleteSuccess="$refs.saleClass.listData()"
                         ></delete-btn>
                     </template>
@@ -65,8 +110,12 @@
 <script>
 import Edit from "@/Form/headquartersServiceMaterial/add";
 import BaseInfo from "./baseInfo";
-import saleClass from "../modules/saleClass.vue";
+import saleClass from "../modules/saleClass";
 import addClass from "../modules/addClass";
+import batchUp from "./batchUp";
+import batchDown from "./batchDown";
+import toExamine from "./toExamine";
+import counterExamine from "./counterExamine";
 export default {
     name: "detail",
     data() {
@@ -76,7 +125,16 @@ export default {
             detailInfo: "",
         };
     },
-    components: { Edit, BaseInfo, saleClass, addClass },
+    components: {
+        Edit,
+        BaseInfo,
+        saleClass,
+        addClass,
+        batchUp,
+        batchDown,
+        toExamine,
+        counterExamine,
+    },
     methods: {
         async queryMainData() {
             const res = await this.$api.requested({
@@ -259,6 +317,40 @@ export default {
             this.queryMainData(this.$route.query.id);
             this.$emit("onSuccess");
         },
+        onDelete() {
+            this.$confirm(
+                this.$t("是否确认删除此服务物料") + "?",
+                this.$t("提示"),
+                {
+                    confirmButtonText: this.$t("确定"),
+                    cancelButtonText: this.$t("取消"),
+                    type: "warning",
+                }
+            )
+                .then(async () => {
+                    const res = await this.$api.requested({
+                        id: "2026051509000002",
+                        content: {
+                            sc_itemid: this.$route.query.id,
+                        },
+                    });
+                    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);

+ 264 - 172
src/bgj/headquartersServiceMaterial/modules/importImage.vue

@@ -1,203 +1,295 @@
 <template>
-  <div>
-    <el-button type="success" size="small" @click="onShow(0)" icon="el-icon-upload">{{$t(`图 片 导 入`)}}</el-button>
-    <el-dialog :title="$t('文件上传')" class="import-panel" :visible.sync="dialogUploadVisible" width="500px" append-to-body :close-on-click-modal="false" :show-close="false" @close="clearFiles">
-      <div slot="title"></div>
-      <div style="background:#f1f2f3" class="my-tabs" >
-        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-          <el-tab-pane :label="$t(`导入`)" name="second"></el-tab-pane>
-        </el-tabs>
-      </div>
-      <div style="padding:20px">
-        <el-upload
-          style="width:100%"
-          ref="my-upload"
-          class="upload-demo normal-margin"
-          :accept="accept"
-          action="#"
-          :auto-upload="false"
-          :show-file-list="false"
-          :on-change="handleChange"
-          drag
-          multiple>
-          <i class="el-icon-upload"></i>
-          <div class="el-upload__text">{{$t('将文件拖到此处,或') + ' '}}<em>{{$t('点击上传')}}</em></div>
-        </el-upload>
-        <div class="progress_panel" v-for="file in filelist" :key="file.uid">
-          <img v-if="file.type === 'DOC' || file.type === 'DOCX'" width="30" src="@/assets/file_icons/word.png"
-            alt="">
-          <img v-else-if="file.type === 'PDF'" width="30" src="@/assets/file_icons/PDF.png" alt="">
-          <img v-else-if="file.type === 'MP4' || file.type === 'AVI'" width="30" src="@/assets/file_icons/video.png"
-            alt="">
-          <img v-else-if="file.type === 'XLS' || file.type === 'XLSX'" width="30" src="@/assets/file_icons/excel.png"
-            alt="">
-          <img v-else-if="file.type === 'PNG' || file.type === 'JPG'|| file.type === 'JPEG'" width="30"
-            src="@/assets/file_icons/image.png" alt="">
-          <img v-else-if="file.type === 'PPT' || file.type === 'PPTX'" width="30" src="@/assets/file_icons/PPT.png"
-            alt="">
-          <img v-else width="30" src="@/assets/file_icons/unknow.png" alt="">
-          <div>
-            <p v-if="file.progress === 100" style="float:right"><span style="color:#67C23A">●</span>{{$t('上传成功')}}</p>
-            <p>{{file.raw?file.raw.name:$t('暂无上传文件')}}</p>
-            <el-progress :percentage="file.progress" :show-text="false"></el-progress>
-          </div>
-        </div>
-        <slot name="errorFile"></slot>
-        <p class="tips">• + {{$t('为保证数据导入顺利,推荐您下载并使用' + ' ')}}<a :href="modelurl">《{{$t('Excel标准模板')}}》</a></p>
-        <p class="tips">• {{$t('文件中数据不能超过5000行')}}</p>
-        <a :href="errorUrl" class="tips" style="color:red" v-if="errorUrl">•{{$t(`下载错误数据`)}}</a>
-        <div class="dialog-footer">
-          <el-button size="small" @click="cancel" class="normal-btn-width">{{$t('取 消')}}</el-button>
-          <el-button size="small" type="warning" @click="dialogUploadVisible = false" class="normal-btn-width btn-warning">{{$t('确 定')}}</el-button>
-        </div>
-      </div>
-
-    </el-dialog>
-  </div>
+    <div>
+        <el-button
+            type="success"
+            size="small"
+            @click="onShow(0)"
+            icon="el-icon-upload"
+            >{{ $t(`图 片 导 入`) }}</el-button
+        >
+        <el-dialog
+            :title="$t('文件上传')"
+            class="import-panel"
+            :visible.sync="dialogUploadVisible"
+            width="500px"
+            append-to-body
+            :close-on-click-modal="false"
+            :show-close="false"
+            @close="clearFiles"
+        >
+            <div slot="title"></div>
+            <div style="background: #f1f2f3" class="my-tabs">
+                <el-tabs
+                    v-model="activeName"
+                    type="card"
+                    @tab-click="handleClick"
+                >
+                    <el-tab-pane
+                        :label="$t(`导入`)"
+                        name="second"
+                    ></el-tab-pane>
+                </el-tabs>
+            </div>
+            <div style="padding: 20px">
+                <el-upload
+                    style="width: 100%"
+                    ref="my-upload"
+                    class="upload-demo normal-margin"
+                    :accept="accept"
+                    action="#"
+                    :auto-upload="false"
+                    :show-file-list="false"
+                    :on-change="handleChange"
+                    drag
+                    multiple
+                >
+                    <i class="el-icon-upload"></i>
+                    <div class="el-upload__text">
+                        {{ $t("将文件拖到此处,或") + " "
+                        }}<em>{{ $t("点击上传") }}</em>
+                    </div>
+                </el-upload>
+                <div
+                    class="progress_panel"
+                    v-for="file in filelist"
+                    :key="file.uid"
+                >
+                    <img
+                        v-if="file.type === 'DOC' || file.type === 'DOCX'"
+                        width="30"
+                        src="@/assets/file_icons/word.png"
+                        alt=""
+                    />
+                    <img
+                        v-else-if="file.type === 'PDF'"
+                        width="30"
+                        src="@/assets/file_icons/PDF.png"
+                        alt=""
+                    />
+                    <img
+                        v-else-if="file.type === 'MP4' || file.type === 'AVI'"
+                        width="30"
+                        src="@/assets/file_icons/video.png"
+                        alt=""
+                    />
+                    <img
+                        v-else-if="file.type === 'XLS' || file.type === 'XLSX'"
+                        width="30"
+                        src="@/assets/file_icons/excel.png"
+                        alt=""
+                    />
+                    <img
+                        v-else-if="
+                            file.type === 'PNG' ||
+                            file.type === 'JPG' ||
+                            file.type === 'JPEG'
+                        "
+                        width="30"
+                        src="@/assets/file_icons/image.png"
+                        alt=""
+                    />
+                    <img
+                        v-else-if="file.type === 'PPT' || file.type === 'PPTX'"
+                        width="30"
+                        src="@/assets/file_icons/PPT.png"
+                        alt=""
+                    />
+                    <img
+                        v-else
+                        width="30"
+                        src="@/assets/file_icons/unknow.png"
+                        alt=""
+                    />
+                    <div>
+                        <p v-if="file.progress === 100" style="float: right">
+                            <span style="color: #67c23a">●</span
+                            >{{ $t("上传成功") }}
+                        </p>
+                        <p>
+                            {{ file.raw ? file.raw.name : $t("暂无上传文件") }}
+                        </p>
+                        <el-progress
+                            :percentage="file.progress"
+                            :show-text="false"
+                        ></el-progress>
+                    </div>
+                </div>
+                <slot name="errorFile"></slot>
+                <p class="tips">
+                    • + {{ $t("为保证数据导入顺利,推荐您下载并使用" + " ")
+                    }}<a :href="modelurl">《{{ $t("Excel标准模板") }}》</a>
+                </p>
+                <p class="tips">• {{ $t("文件中数据不能超过5000行") }}</p>
+                <a
+                    :href="errorUrl"
+                    class="tips"
+                    style="color: red"
+                    v-if="errorUrl"
+                    >•{{ $t(`下载错误数据`) }}</a
+                >
+                <div class="dialog-footer">
+                    <el-button
+                        size="small"
+                        @click="cancel"
+                        class="normal-btn-width"
+                        >{{ $t("取 消") }}</el-button
+                    >
+                    <el-button
+                        size="small"
+                        type="warning"
+                        @click="dialogUploadVisible = false"
+                        class="normal-btn-width btn-warning"
+                        >{{ $t("确 定") }}</el-button
+                    >
+                </div>
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-
 export default {
-  props:['btntype','accept','bindData','errorUrl'],
-  data () {
-    return {
-      dialogUploadVisible: false,
-      params: {
-        "classname": "system.attachment.huawei.OBS",
-        "method": "getFileName",
-        "content": {
-          "filename": '',
-          "filetype": '',
-          "parentid": ""
-        }
-      },
-      file: {},
-      filelist: [],
-      CampaignList:[],
-      activeName:'last',
-      modelurl:'',
-      campaignid:'',
-      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
-    }
-  },
-  mounted () {
-
-  },
-  methods: {
-    onShow () {
-      this.dialogUploadVisible = true
-       this.getModelUrl()
-    },
-    cancel () {
-      this.dialogUploadVisible = false
-      this.campaignid = ''
-      this.$refs['my-upload'].clearFiles()
-      this.filelist = []
-    },
-    handleChange (file, filelist) {
-      this.filelist = filelist
-      var index = file.raw.name.lastIndexOf(".");
-      var ext = file.name.substr(index + 1);
-      this.params.content.filename = file.raw.name
-      this.params.content.filetype = ext
-      this.getUploadUrl(file, ext)
-    },
-    handleClick () {
-      this.getModelUrl()
+    props: ["btntype", "accept", "bindData", "errorUrl"],
+    data() {
+        return {
+            dialogUploadVisible: false,
+            params: {
+                classname: "system.attachment.huawei.OBS",
+                method: "getFileName",
+                content: {
+                    filename: "",
+                    filetype: "",
+                    parentid: "",
+                },
+            },
+            file: {},
+            filelist: [],
+            CampaignList: [],
+            activeName: "last",
+            modelurl: "",
+            campaignid: "",
+            folderid: JSON.parse(sessionStorage.getItem("folderid"))
+                .appfolderid,
+        };
     },
-    async getModelUrl () {
-      const res = await this.$api.requested({
-        "accesstoken": "7023086e7fe38389a359dc05ba950b33",
-        "id": 20230407164004,
-        "content": {
-        }
-      })
-      this.modelurl = res.data
-
-    },
-    async getUploadUrl (file, ext) {
-      this.params.content.parentid = this.folderid
-      const res = await this.$api.requested(this.params)
-      let url = res.data.uploadurl
-      let obsfilename = res.data.serialfilename
+    mounted() {},
+    methods: {
+        onShow() {
+            this.dialogUploadVisible = true;
+            this.getModelUrl();
+        },
+        cancel() {
+            this.dialogUploadVisible = false;
+            this.campaignid = "";
+            this.$refs["my-upload"].clearFiles();
+            this.filelist = [];
+        },
+        handleChange(file, filelist) {
+            this.filelist = filelist;
+            var index = file.raw.name.lastIndexOf(".");
+            var ext = file.name.substr(index + 1);
+            this.params.content.filename = file.raw.name;
+            this.params.content.filetype = ext;
+            this.getUploadUrl(file, ext);
+        },
+        handleClick() {
+            this.getModelUrl();
+        },
+        async getModelUrl() {
+            const res = await this.$api.requested({
+                accesstoken: "7023086e7fe38389a359dc05ba950b33",
+                id: 20250520083606,
+                content: {},
+            });
+            console.log("res-----------", res);
+            this.modelurl = res.data;
+        },
+        async getUploadUrl(file, ext) {
+            this.params.content.parentid = this.folderid;
+            const res = await this.$api.requested(this.params);
+            let url = res.data.uploadurl;
+            let obsfilename = res.data.serialfilename;
 
-      this.upoladFileToServer(url, file, ext, obsfilename)
-    },
-    async upoladFileToServer (url, file, ext, obsfilename) {
-      let THIS = this
-      let config = {
-        headers: ext === 'pdf' ? { 'Content-Type': 'application/pdf' } : { 'Content-Type': 'application/octet-stream' },
-        onUploadProgress: function (progressEvent) {
-          let percent = progressEvent.loaded / progressEvent.total * 100
-          THIS.filelist.forEach(e => {
-            if (e.uid === file.uid) {
-              THIS.$set(e, 'type', ext.toUpperCase());
-              THIS.$set(e, 'progress', percent);
-            }
-          })
+            this.upoladFileToServer(url, file, ext, obsfilename);
+        },
+        async upoladFileToServer(url, file, ext, obsfilename) {
+            let THIS = this;
+            let config = {
+                headers:
+                    ext === "pdf"
+                        ? { "Content-Type": "application/pdf" }
+                        : { "Content-Type": "application/octet-stream" },
+                onUploadProgress: function (progressEvent) {
+                    let percent =
+                        (progressEvent.loaded / progressEvent.total) * 100;
+                    THIS.filelist.forEach((e) => {
+                        if (e.uid === file.uid) {
+                            THIS.$set(e, "type", ext.toUpperCase());
+                            THIS.$set(e, "progress", percent);
+                        }
+                    });
+                },
+            };
+            const res = await this.$upload.hw_upload(url, file.raw, config);
+            this.createFileRecord(obsfilename);
         },
-      }
-      const res = await this.$upload.hw_upload(url, file.raw, config)
-      this.createFileRecord(obsfilename)
-    },
 
-    async createFileRecord (obsfilename) {
-      let obj = {
-         "serialfilename": obsfilename
-      }
-      obj = Object.assign({},obj,this.bindData)
-      let param = {
-        "classname": "system.attachment.huawei.OBS",
-        "method": "uploadSuccess",
-        "content":obj
-      }
+        async createFileRecord(obsfilename) {
+            let obj = {
+                serialfilename: obsfilename,
+            };
+            obj = Object.assign({}, obj, this.bindData);
+            let param = {
+                classname: "system.attachment.huawei.OBS",
+                method: "uploadSuccess",
+                content: obj,
+            };
 
-      const res = await this.$api.requested(param)
-      this.$emit('onSuccess',res.data.attachmentids[0])
-    },
+            const res = await this.$api.requested(param);
+            this.$emit("onSuccess", res.data.attachmentids[0]);
+        },
 
-    clearFiles () {
-      this.$refs['my-upload'].clearFiles()
-      this.filelist = []
-      this.dialogUploadVisible = false
-      this.$emit('clearUrl')
+        clearFiles() {
+            this.$refs["my-upload"].clearFiles();
+            this.filelist = [];
+            this.dialogUploadVisible = false;
+            this.$emit("clearUrl");
+        },
     },
-  }
-}
-
+};
 </script>
 <style>
-.import-panel .el-dialog__header,.import-panel .el-dialog__body{
-  padding: 0 !important;
+.import-panel .el-dialog__header,
+.import-panel .el-dialog__body {
+    padding: 0 !important;
 }
 .upload-demo > div {
-  width: 100% !important;
+    width: 100% !important;
 }
 .upload-demo .el-upload-dragger {
-  width: 100% !important;
+    width: 100% !important;
 }
 </style>
 <style scoped>
 .progress_panel {
-  display: flex;
-  align-items: center;
-  padding: 10px;
-  margin: 10px 0;
-  border-radius: 5px;
-  transition: linear 0.2s all;
+    display: flex;
+    align-items: center;
+    padding: 10px;
+    margin: 10px 0;
+    border-radius: 5px;
+    transition: linear 0.2s all;
 }
 .progress_panel:hover {
-  box-shadow: 0px 0px 5px #ccc;
+    box-shadow: 0px 0px 5px #ccc;
 }
 .progress_panel > div {
-  flex: 1;
-  padding: 0 10px;
+    flex: 1;
+    padding: 0 10px;
 }
 .progress_panel > div > p {
-  line-height: 30px;
+    line-height: 30px;
 }
-.tips{
-  line-height: 30px;
+.tips {
+    line-height: 30px;
 }
 </style>

+ 164 - 109
src/bgj/headquartersServiceMaterial/modules/saleClass.vue

@@ -1,122 +1,177 @@
 
 <template>
-  <div>
-    <div style="display:flex;align-items:center">
-      <el-input
-          :placeholder="$t('请输入搜索内容')"
-          suffix-icon="el-icon-search"
-          v-model="params.content.where.condition"
-          style="width:200px"
-          size="mini"
-          class="input-with-select inline-16"
-          @keyup.native.enter="listData(params.content.pageNumber=1)"
-          @clear="clearData"
-          clearable>
-      </el-input>
-      <slot name="addClass" :data="{checkArr:checkArr,data:data}"></slot>
+    <div>
+        <div style="display: flex; align-items: center">
+            <!-- <el-input
+                :placeholder="$t('请输入搜索内容')"
+                suffix-icon="el-icon-search"
+                v-model="params.content.where.condition"
+                style="width: 200px"
+                size="mini"
+                class="input-with-select inline-16"
+                @keyup.native.enter="listData((params.content.pageNumber = 1))"
+                @clear="clearData"
+                clearable
+            >
+            </el-input> -->
+            <slot
+                name="addClass"
+                :data="{ checkArr: checkArr, data: data }"
+            ></slot>
+        </div>
+        <div style="margin-top: 15px">
+            <table-new-layout
+                :layout="tablecols"
+                :data="list"
+                :opwidth="200"
+                :custom="true"
+                :width="true"
+                :height="tableHieght"
+                fixedName="operation"
+            >
+                <template v-slot:customcol="scope">
+                    <div v-if="scope.column.columnname == 'price'">
+                        <el-input
+                            size="small"
+                            v-if="
+                                currentProduct.sa_aftersalesmag_itemsid ==
+                                scope.column.data.sa_aftersalesmag_itemsid
+                            "
+                            v-model="scope.column.data.price"
+                        ></el-input>
+                        <span v-else>{{
+                            tool.formatAmount(scope.column.data.price, 2)
+                        }}</span>
+                    </div>
+                    <div v-else-if="scope.column.columnname == 'qty'">
+                        <el-input
+                            size="small"
+                            v-if="
+                                currentProduct.sa_aftersalesmag_itemsid ==
+                                scope.column.data.sa_aftersalesmag_itemsid
+                            "
+                            v-model="scope.column.data.qty"
+                        ></el-input>
+                        <span v-else>{{ scope.column.data.qty }}</span>
+                    </div>
+                    <div v-else-if="scope.column.columnname == 'reason'">
+                        <div
+                            v-if="
+                                currentProduct.sa_aftersalesmag_itemsid ==
+                                scope.column.data.sa_aftersalesmag_itemsid
+                            "
+                        >
+                            <el-input
+                                type="textarea"
+                                size="mini"
+                                v-model="scope.column.data.reason"
+                            ></el-input>
+                        </div>
+                        <div v-else>
+                            {{
+                                scope.column.data.reason
+                                    ? scope.column.data.reason
+                                    : "--"
+                            }}
+                        </div>
+                    </div>
+                    <p v-else>
+                        {{ $t(scope.column.data[scope.column.columnname]) }}
+                    </p>
+                    <p
+                        v-if="
+                            !scope.column.data[scope.column.columnname] &&
+                            scope.column.data[scope.column.columnname] !== 0 &&
+                            scope.column.columnname != 'operation' &&
+                            scope.column.columnname != 'reason'
+                        "
+                    >
+                        --
+                    </p>
+                </template>
+                <template v-slot:opreation="scope">
+                    <slot name="delProduct" :data="scope.data"></slot>
+                </template>
+            </table-new-layout>
+        </div>
+        <div style="margin-top: 16px; text-align: right">
+            <el-pagination
+                background
+                small
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page="params.content.pageNumber"
+                :page-size="params.content.pageSize"
+                layout="total, prev, pager, next, jumper"
+                :total="total"
+            >
+            </el-pagination>
+        </div>
     </div>
-    <div style="margin-top: 15px">
-      <table-new-layout :layout="tablecols" :data="list" :opwidth="200"  :custom="true" :width="true"  :height="tableHieght" fixedName="operation">
-        <template v-slot:customcol="scope">
-          <div v-if="scope.column.columnname == 'price'">
-            <el-input size="small" v-if="currentProduct.sa_aftersalesmag_itemsid == scope.column.data.sa_aftersalesmag_itemsid" v-model="scope.column.data.price"></el-input>
-            <span v-else>{{tool.formatAmount(scope.column.data.price,2)}}</span>
-          </div>
-          <div v-else-if="scope.column.columnname == 'qty'">
-            <el-input size="small" v-if="currentProduct.sa_aftersalesmag_itemsid == scope.column.data.sa_aftersalesmag_itemsid" v-model="scope.column.data.qty"></el-input>
-            <span v-else>{{scope.column.data.qty}}</span>
-          </div>
-          <div v-else-if="scope.column.columnname == 'reason'">
-            <div v-if="currentProduct.sa_aftersalesmag_itemsid == scope.column.data.sa_aftersalesmag_itemsid">
-              <el-input type="textarea" size="mini" v-model="scope.column.data.reason"></el-input>
-            </div>
-            <div v-else>{{scope.column.data.reason ? scope.column.data.reason : '--'}}</div>
-          </div>
-          <p v-else>{{$t(scope.column.data[scope.column.columnname])}}</p>
-          <p v-if="!scope.column.data[scope.column.columnname] && scope.column.data[scope.column.columnname] !== 0 && scope.column.columnname != 'operation'&& scope.column.columnname != 'reason'">--</p>
-        </template>
-        <template v-slot:opreation="scope">
-          <slot name="delProduct" :data="scope.data"></slot>
-        </template>
-      </table-new-layout>
-    </div>
-    <div style="margin-top:16px;text-align:right">
-      <el-pagination
-          background
-          small
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="params.content.pageNumber"
-          :page-size="params.content.pageSize"
-          layout="total, prev, pager, next, jumper"
-          :total="total">
-      </el-pagination>
-    </div>
-  </div>
 </template>
 
 <script>
 export default {
-  props:["data"],
-  data () {
-    return {
-      tableHieght:"calc(100vh - 371px)",
-      tablecols:[],
-      list:[],
-      total:0,
-      params:{
-          "id": 20220927090202,
-          "content": {
-              "itemid": "",
-              "itemno": "",
-              "pageNumber": 1,
-              "pageSize": 20,
-              "where": {
-                  "condition": ""
-              }
-          },
-      },
-      options:[
-      ],
-      productList:'',
-      currentProduct:{},
-      checkArr:[]
-    }
-  },
-  methods:{
-    async listData(){
-      this.params.content.itemid = this.data.itemid
-      this.params.content.itemno = this.data.itemno
-      const res = await this.$api.requested(this.params)
-      this.list = res.data
-      this.total = res.total
-      this.checkArr = this.list.map(item => item.itemclassid)
-      console.log(this.list)
-    },
-    handleSizeChange(val) {
-      // console.log(`每页 ${val} 条`);
-      this.params.content.pageSize = val
-      this.listData()
+    props: ["data"],
+    data() {
+        return {
+            tableHieght: "calc(100vh - 371px)",
+            tablecols: [],
+            list: [],
+            total: 0,
+            params: {
+                id: 20220927102606,
+                content: {
+                    itemid: "",
+                    itemno: "",
+                    pageNumber: 1,
+                    pageSize: 20,
+                    where: {
+                        condition: "",
+                    },
+                },
+            },
+            options: [],
+            productList: "",
+            currentProduct: {},
+            checkArr: [],
+        };
     },
-    handleCurrentChange(val) {
-      // console.log(`当前页: ${val}`);
-      this.params.content.pageNumber = val
-      this.listData()
+    methods: {
+        async listData() {
+            console.log("this.data------------", this.data);
+            this.params.content.itemid = this.data.itemid;
+            this.params.content.itemno = this.data.itemno;
+            const res = await this.$api.requested(this.params);
+            this.list = res.data;
+            this.total = res.total;
+            this.checkArr = this.list.map((item) => item.itemclassid);
+            console.log(this.list);
+        },
+        handleSizeChange(val) {
+            // console.log(`每页 ${val} 条`);
+            this.params.content.pageSize = val;
+            this.listData();
+        },
+        handleCurrentChange(val) {
+            // console.log(`当前页: ${val}`);
+            this.params.content.pageNumber = val;
+            this.listData();
+        },
+        clearData() {
+            this.listData();
+        },
+        queryClick() {
+            this.listData();
+        },
     },
-    clearData(){
-      this.listData()
+    created() {
+        this.listData();
+        this.tablecols = this.tool.tabelCol(
+            this.$route.name
+        ).materialClassificationTable.tablecols;
     },
-    queryClick(){
-      this.listData()
-    }
-  },
-  created() {
-    this.listData()
-    this.tablecols = this.tool.tabelCol(this.$route.name).salerClassTable.tablecols
-  }
-}
-
+};
 </script>
 <style scoped>
-
 </style>

+ 20 - 14
src/bgj/headquartersServiceMaterial/modules/toExamine.vue

@@ -2,7 +2,7 @@
     <div>
         <el-button
             :type="disabled ? '' : 'primary'"
-            size="small"
+            :size="btn_size ? btn_size : 'small'"
             @click="onshow"
             :disabled="disabled"
             >{{ $t(`审 核`) }}</el-button
@@ -12,7 +12,7 @@
 
 <script>
 export default {
-    props: ["rowData", "disabled"],
+    props: ["rowData", "disabled", "btnName", "btn_size"],
     name: "toExamine",
     data() {
         return {
@@ -21,9 +21,12 @@ export default {
     },
     methods: {
         onshow() {
+            // 统一处理 单个对象 / 数组
+            const dataList = this.btnName ? [this.rowData] : this.rowData;
             this.flag = false;
-            this.rowData.forEach((e) => {
-                if (e.status === "审核") {
+            // 统一用 dataList 遍历
+            dataList.forEach((e) => {
+                if (e.status === 2) {
                     this.flag = true;
                 }
             });
@@ -46,18 +49,21 @@ export default {
             }
         },
         onExamine() {
-            this.$confirm(
-                this.$t("确定通过这些数据的审核吗") + "?",
-                this.$t("提示"),
-                {
-                    confirmButtonText: this.$t("确定"),
-                    cancelButtonText: this.$t("取消"),
-                    type: "warning",
-                }
-            )
+            //根据是否传入 btnName 切换 单数/批量 文案
+            const isSingle = !!this.btnName;
+            const confirmText = isSingle
+                ? this.$t("确定通过此数据的审核吗")
+                : this.$t("确定通过这些数据的审核吗");
+            // 统一兼容数据格式
+            const dataList = this.btnName ? [this.rowData] : this.rowData;
+            this.$confirm(confirmText + "?", this.$t("提示"), {
+                confirmButtonText: this.$t("确定"),
+                cancelButtonText: this.$t("取消"),
+                type: "warning",
+            })
                 .then(async () => {
                     let row = [];
-                    this.rowData.forEach(function (item, index) {
+                    dataList.forEach(function (item, index) {
                         row[index] = item.sc_itemid;
                     });
                     // 把数组转成 逗号分隔的字符串 "1,2,3"