NULL1222 2 minggu lalu
induk
melakukan
0f5c187633

+ 202 - 92
src/Form/headquartersServiceMaterial/add.vue

@@ -1,7 +1,11 @@
 <template>
     <div>
-        <el-button size="small" type="primary" @click="show">
-            {{ title_btn ? $t(title_btn) : $t('新 建') }}
+        <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(`新建服务物料`)"
@@ -21,49 +25,63 @@
                     label-position="right"
                     size="mini"
                 >
-                    <!-- 物料名称 -->
                     <el-col :span="24">
                         <el-form-item :label="$t('物料名称:')" prop="name">
-                            <el-input v-model="form.name" :placeholder="$t('请填写物料名称')"></el-input>
+                            <el-input
+                                v-model="form.name"
+                                :placeholder="$t('请填写物料名称')"
+                            ></el-input>
                         </el-form-item>
                     </el-col>
-
-                    <!-- 物料编号 -->
                     <el-col :span="24">
                         <el-form-item :label="$t('物料编号:')" prop="code">
-                            <el-input v-model="form.code" :placeholder="$t('请填写物料编号')"></el-input>
+                            <el-input
+                                v-model="form.code"
+                                :placeholder="$t('请填写物料编号')"
+                            ></el-input>
                         </el-form-item>
                     </el-col>
-
-                    <!-- erp品名 -->
                     <el-col :span="24">
-                        <el-form-item :label="$t('erp品名:')" prop="erpitemname">
-                            <el-input v-model="form.erpitemname" :placeholder="$t('请填写erp品名')"></el-input>
+                        <el-form-item
+                            :label="$t('erp品名:')"
+                            prop="erpitemname"
+                        >
+                            <el-input
+                                v-model="form.erpitemname"
+                                :placeholder="$t('请填写erp品名')"
+                            ></el-input>
                         </el-form-item>
                     </el-col>
-
-                    <!-- erp品号 -->
                     <el-col :span="24">
                         <el-form-item :label="$t('erp品号:')" prop="erpitemno">
-                            <el-input v-model="form.erpitemno" :placeholder="$t('请填写erp品号')"></el-input>
+                            <el-input
+                                v-model="form.erpitemno"
+                                :placeholder="$t('请填写erp品号')"
+                            ></el-input>
                         </el-form-item>
                     </el-col>
-
                     <el-col :span="24">
                         <el-form-item :label="$t('牌价:')" prop="marketprice">
-                            <el-input v-model="form.marketprice" :placeholder="$t('请填写牌价')"></el-input>
+                            <el-input
+                                v-model="form.marketprice"
+                                :placeholder="$t('请填写牌价')"
+                            ></el-input>
                         </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-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="unit">
                             <el-select
@@ -82,7 +100,6 @@
                             </el-select>
                         </el-form-item>
                     </el-col>
-
                     <!-- 辅助单位 -->
                     <!-- <el-col :span="24">
                         <el-form-item :label="$t('辅助单位:')" prop="auxunit">
@@ -103,11 +120,22 @@
                                     :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 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>
@@ -132,28 +160,65 @@
                             </el-select>
                         </el-form-item>
                     </el-col>
-
-                    <!-- 起订量 -->
+                    <el-col :span="24">
+                        <el-form-item :label="$t('型号:')" prop="type">
+                            <el-input
+                                v-model="form.type"
+                                :placeholder="$t('请填写型号')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t('规格:')" prop="spec">
+                            <el-input
+                                v-model="form.spec"
+                                :placeholder="$t('请填写规格')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <!-- <el-col :span="24">
+                        <el-form-item :label="$t('品牌:')" prop="brand">
+                            <el-input
+                                v-model="form.brand"
+                                :placeholder="$t('请填写品牌')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t('分类:')" prop="itemclassids">
+                            <el-input
+                                v-model="form.itemclassids"
+                                :placeholder="$t('请填写分类')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col> -->
                     <el-col :span="24">
                         <el-form-item :label="$t('起订量:')" prop="start_num">
-                            <el-input-number v-model="form.start_num" :min="1" :placeholder="$t('请填写起订量')" />
+                            <el-input-number
+                                v-model="form.start_num"
+                                :min="1"
+                                :placeholder="$t('请填写起订量')"
+                            />
                         </el-form-item>
                     </el-col>
-
-                    <!-- 增量 -->
                     <el-col :span="24">
                         <el-form-item :label="$t('增量:')" prop="increment">
-                            <el-input-number v-model="form.increment" :min="1" :placeholder="$t('请填写增量')" />
+                            <el-input-number
+                                v-model="form.increment"
+                                :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-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('物料图:')">
                             <uploadFile
@@ -168,39 +233,52 @@
                             </uploadFile>
                             <!-- <previewImage  :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
+                            <small
+                                style="display: block; margin-top: 20px"
+                                class="info"
+                                >{{ $t(`注:建议上传图片大小`) }}1024x1024px,{{
+                                    $t("大小不超过")
+                                }}2M,{{ $t("格式为") }}JPG/PNG</small
                             >
                         </el-form-item>
                     </el-col>
                 </el-form>
             </div>
             <div class="fixed__btn__panel">
-                <el-button size="small" @click="onCancel" class="normal-btn-width">{{ $t('取 消') }}</el-button>
+                <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('确 定') }}
+                    >{{ title_btn == "编辑" ? $t("保 存") : $t("确 定") }}
                 </el-button>
             </div>
         </el-drawer>
     </div>
 </template>
 <script>
-import uploadFile from '@/components/upload/preview_upload.vue';
+import uploadFile from "@/components/upload/preview_upload.vue";
 
 export default {
-    name: 'add',
+    name: "add",
     components: { uploadFile },
-    props: { title_btn: String, title_drawer: String, data: Object },
+    props: {
+        btn_size: String,
+        title_btn: String,
+        title_drawer: String,
+        data: Object,
+    },
     data() {
         return {
-            folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+            folderid: JSON.parse(sessionStorage.getItem("folderid"))
+                .appfolderid,
             tradefield: [], // 领域
             unitData: [], // 主单位
             unitGroupData: [],
@@ -211,41 +289,73 @@ export default {
             currentData: {},
             form: {
                 sc_itemid: 0,
-                code: 'ITEM001', //物料编号
-                name: '测试物料', //物料名称
-                erpitemno: '品号', // 品号
-                erpitemname: '品名', // 品名
-                marketprice: '32', // 牌价
+                code: "ITEM001", //物料编号
+                name: "测试物料", //物料名称
+                erpitemno: "品号", // 品号
+                erpitemname: "品名", // 品名
+                marketprice: "32", // 牌价
                 isauxunit: 0, //是否启用辅助单位
-                unit: '', //主单位
-                auxunit: '', // 辅助单位
-                domain: '', // 领域
-                start_num: '1', // 起订量
-                increment: '1', // 增量
-                remarks: '', // 备注
-                pic: '', // 图片
-                status: 1,
-                shelf: 0,
-                shefl_time: '2026-05-15 10:00:00',
-                type: '配件',
-                spec: '规格A',
-                brand: '品牌A',
-                category: '分类A',
+                unit: "", //主单位
+                auxunit: "", // 辅助单位
+                domain: "", // 领域
+                type: "", // 型号
+                spec: "", // 规格
+                // brand: "", // 品牌
+                // itemclassids: "", // 分类
+                start_num: "1", // 起订量
+                increment: "1", // 增量
+                remarks: "", // 备注
+                pic: "", // 图片
+                status: 1, // 状态
+                shelf: 0, // 是否上架
             },
             rules: {
-                name: [{ required: true, message: this.$t('请填写物料名称'), trigger: 'blur' }],
-                code: [{ required: true, message: this.$t('请填写物料编号'), trigger: 'blur' }],
-                marketprice: [{ required: true, message: this.$t('请填写牌价'), trigger: 'blur' }],
-                unit: [{ required: true, message: this.$t('请选择主单位'), trigger: 'change' }],
-                domain: [{ required: true, message: this.$t('请选择领域'), trigger: 'change' }],
+                name: [
+                    {
+                        required: true,
+                        message: this.$t("请填写物料名称"),
+                        trigger: "blur",
+                    },
+                ],
+                code: [
+                    {
+                        required: true,
+                        message: this.$t("请填写物料编号"),
+                        trigger: "blur",
+                    },
+                ],
+                marketprice: [
+                    {
+                        required: true,
+                        message: this.$t("请填写牌价"),
+                        trigger: "blur",
+                    },
+                ],
+                unit: [
+                    {
+                        required: true,
+                        message: this.$t("请选择主单位"),
+                        trigger: "change",
+                    },
+                ],
+                domain: [
+                    {
+                        required: true,
+                        message: this.$t("请选择领域"),
+                        trigger: "change",
+                    },
+                ],
             },
         };
     },
     methods: {
         // 查询领域
         async fieldData() {
-            const res = await this.$store.dispatch('optiontypeselect', 'tradefield');
-            console.log('res-----------', res);
+            const res = await this.$store.dispatch(
+                "optiontypeselect",
+                "tradefield"
+            );
+            console.log("res-----------", res);
             this.tradefield = res.data;
         },
         //初始化
@@ -255,19 +365,19 @@ export default {
             this.unitlist();
             this.unitGrouplist();
             this.dialogFormVisible = true;
-            if (this.title_btn == '编辑') {
+            if (this.title_btn == "编辑") {
                 this.form = Object.assign({}, this.form, this.data);
             }
         },
         async unitlist() {
             const res = await this.$api.requested({
-                id: '20220922084803',
+                id: "20220922084803",
                 version: 1,
                 nocache: true,
                 content: {
                     pageSize: 1000,
                     where: {
-                        condition: '',
+                        condition: "",
                     },
                 },
             });
@@ -278,13 +388,13 @@ export default {
         },
         async unitGrouplist() {
             const res = await this.$api.requested({
-                id: '20220922084503',
+                id: "20220922084503",
                 version: 1,
                 nocache: true,
                 content: {
                     pageSize: 1000,
                     where: {
-                        condition: '',
+                        condition: "",
                         unitid: this.form.unitid,
                     },
                 },
@@ -309,7 +419,7 @@ export default {
             // this.form.domain = this.form.tradefield.map((e) => {
             //     return e.tradefield;
             // });
-            fn ? fn() : '';
+            fn ? fn() : "";
         },
         // onSubmit() {
         //     console.log('this.form---------', this.form);
@@ -329,28 +439,28 @@ export default {
         //     });
         // },
         onSubmit() {
-            console.log('this.form---------', this.form);
-            this.$refs['form'].validate(async (valid) => {
+            console.log("this.form---------", this.form);
+            this.$refs["form"].validate(async (valid) => {
                 if (!valid) return false;
-                this.$store.commit('setLoading', true);
+                this.$store.commit("setLoading", true);
                 const res = await this.$api.requested({
                     id: 2026051508523606,
                     content: this.form,
                 });
                 this.tool.showMessage(res, () => {
-                    this.$store.commit('setLoading', false);
+                    this.$store.commit("setLoading", false);
                     this.bindData = {
-                        ownertable: 'hs_item',
+                        ownertable: "hs_item",
                         ownerid: res.data.itemid,
-                        usetype: 'default',
+                        usetype: "default",
                     };
                     /* this.setTag(res.data.itemid,res.data.rowindex)*/
-                    this.$refs['form'].resetFields();
-                    this.$refs['upload'].toUpload();
-                    this.$emit('onSuccess');
+                    this.$refs["form"].resetFields();
+                    this.$refs["upload"].toUpload();
+                    this.$emit("onSuccess");
                     this.refresh();
                     this.dialogFormVisible = false;
-                    this.$store.dispatch('changeDetailDrawer', true);
+                    this.$store.dispatch("changeDetailDrawer", true);
                     // this.$router.push({
                     //     path: '/productmagDetail',
                     //     query: { id: res.data.itemid, rowindex: res.data.rowindex },
@@ -360,10 +470,10 @@ export default {
         },
         onCancel() {
             this.dialogFormVisible = false;
-            this.$refs['form'].resetFields();
+            this.$refs["form"].resetFields();
         },
         uploadSuccess(res) {
-            this.$emit('onSuccess');
+            this.$emit("onSuccess");
         },
     },
 };

+ 355 - 0
src/Form/ourServiceMaterial/add.vue

@@ -0,0 +1,355 @@
+<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-form
+                    :model="form"
+                    :rules="rules"
+                    ref="form"
+                    :label-width="tool.onlyZh('180px')"
+                    label-position="right"
+                    size="mini"
+                >
+                    <el-col :span="24">
+                        <el-form-item :label="$t('物料名称:')" prop="name">
+                            <el-input
+                                v-model="form.name"
+                                :placeholder="$t('请填写物料名称')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t('物料编号:')" prop="code">
+                            <el-input
+                                v-model="form.code"
+                                :placeholder="$t('请填写物料编号')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t(`领域`)" prop="domain">
+                            <el-select
+                                style="width: 100%"
+                                v-model="form.domain"
+                                multiple
+                                :placeholder="$t('请选择')"
+                                clearable
+                            >
+                                <el-option
+                                    v-for="item in tradefield"
+                                    :key="item.value"
+                                    :label="$t(item.value)"
+                                    :value="item.value"
+                                >
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t('型号:')" prop="type">
+                            <el-input
+                                v-model="form.type"
+                                :placeholder="$t('请填写型号')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t('规格:')" prop="spec">
+                            <el-input
+                                v-model="form.type"
+                                :placeholder="$t('请填写规格')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t('品牌:')" prop="brand">
+                            <el-input
+                                v-model="form.type"
+                                :placeholder="$t('请填写品牌')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t('分类:')" prop="category">
+                            <el-input
+                                v-model="form.type"
+                                :placeholder="$t('请填写分类')"
+                            ></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item :label="$t(`计量单位`)" prop="unit">
+                            <el-select
+                                style="width: 100%"
+                                v-model="form.unit"
+                                :placeholder="$t('请选择')"
+                                @change="unitChange"
+                            >
+                                <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="20">
+                        <el-form-item :label="$t('物料图:')">
+                            <uploadFile
+                                ref="upload"
+                                style="margin-top: 10px"
+                                :folderid="folderid"
+                                accept=".JPG,.PNG,.jpg,.png"
+                                type="image"
+                                :bindData="bindData"
+                                @onSuccess="uploadSuccess"
+                            >
+                            </uploadFile>
+                            <!-- <previewImage  :image="form.attinfos[0]" :deletebtn="true"
+                  @onSuccess="clearCover"></previewImage> -->
+                            <small
+                                style="display: block; margin-top: 20px"
+                                class="info"
+                                >{{ $t(`注:建议上传图片大小`) }}1024x1024px,{{
+                                    $t("大小不超过")
+                                }}2M,{{ $t("格式为") }}JPG/PNG</small
+                            >
+                        </el-form-item>
+                    </el-col>
+                </el-form>
+            </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";
+
+export default {
+    name: "add",
+    components: { uploadFile },
+    props: {
+        btn_size: String,
+        title_btn: String,
+        title_drawer: String,
+        data: Object,
+    },
+    data() {
+        return {
+            folderid: JSON.parse(sessionStorage.getItem("folderid"))
+                .appfolderid,
+            tradefield: [], // 领域
+            unitData: [], // 计量单位
+            unitGroupData: [],
+
+            bindData: {}, // 传递给子组件的图片绑定信息
+            loading: false,
+            dialogFormVisible: false,
+            currentData: {},
+            form: {
+                sc_itemid: 0,
+                code: "ITEM001", //物料编号
+                name: "测试物料", //物料名称
+                unit: "", //计量单位
+                domain: "", // 领域
+                type: "", // 型号
+                spec: "", // 规格
+                brand: "", // 品牌
+                category: "", // 分类
+                pic: "", // 图片
+                status: 1, // 状态
+            },
+            rules: {
+                name: [
+                    {
+                        required: true,
+                        message: this.$t("请填写物料名称"),
+                        trigger: "blur",
+                    },
+                ],
+                code: [
+                    {
+                        required: true,
+                        message: this.$t("请填写物料编号"),
+                        trigger: "blur",
+                    },
+                ],
+                unit: [
+                    {
+                        required: true,
+                        message: this.$t("请选择计量单位"),
+                        trigger: "change",
+                    },
+                ],
+                domain: [
+                    {
+                        required: true,
+                        message: this.$t("请选择领域"),
+                        trigger: "change",
+                    },
+                ],
+            },
+        };
+    },
+    methods: {
+        // 查询领域
+        async fieldData() {
+            const res = await this.$store.dispatch(
+                "optiontypeselect",
+                "tradefield"
+            );
+            console.log("res-----------", res);
+            this.tradefield = res.data;
+        },
+        //初始化
+        show() {
+            this.fieldData();
+            this.queryMain();
+            this.unitlist();
+            this.unitGrouplist();
+            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;
+        },
+        unitChange() {
+            this.unitGrouplist();
+        },
+        async unitGrouplist() {
+            const res = await this.$api.requested({
+                id: "20220922084503",
+                version: 1,
+                nocache: true,
+                content: {
+                    pageSize: 1000,
+                    where: {
+                        condition: "",
+                        unitid: this.form.unitid,
+                    },
+                },
+            });
+            this.unitGroupData = res.data;
+        },
+        async queryMain(fn) {
+            // const res = await this.$api.requested({
+            //     id: 20220923155302,
+            //     content: {
+            //         itemid: this.data.itemid,
+            //     },
+            // });
+            // this.form = Object.assign({}, this.form, res.data);
+
+            // this.form.categories = this.form.categories
+            //     ? this.form.categories
+            //     : this.categoriesList.length > 0
+            //     ? this.categoriesList[0].remarks
+            //     : '';
+
+            // this.form.domain = this.form.tradefield.map((e) => {
+            //     return e.tradefield;
+            // });
+            fn ? fn() : "";
+        },
+        // onSubmit() {
+        //     console.log('this.form---------', this.form);
+        //     this.$refs['form'].validate(async (valid) => {
+        //         if (!valid) return false;
+        //         this.loading = true;
+        //         const res = await this.$api.requested({
+        //             id: '2026051508523606',
+        //             content: this.form,
+        //         });
+        //         this.tool.showMessage(res, () => {
+        //             this.$emit('onSuccess');
+        //             this.loading = false;
+        //             this.$refs['form'].resetFields();
+        //             this.dialogFormVisible = false;
+        //         });
+        //     });
+        // },
+        onSubmit() {
+            console.log("this.form---------", this.form);
+            this.$refs["form"].validate(async (valid) => {
+                if (!valid) return false;
+                this.$store.commit("setLoading", true);
+                const res = await this.$api.requested({
+                    id: 2026051510000001,
+                    content: this.form,
+                });
+                this.tool.showMessage(res, () => {
+                    this.$store.commit("setLoading", false);
+                    this.bindData = {
+                        ownertable: "hs_item",
+                        ownerid: res.data.itemid,
+                        usetype: "default",
+                    };
+                    /* this.setTag(res.data.itemid,res.data.rowindex)*/
+                    this.$refs["form"].resetFields();
+                    this.$refs["upload"].toUpload();
+                    this.$emit("onSuccess");
+                    this.refresh();
+                    this.dialogFormVisible = false;
+                    this.$store.dispatch("changeDetailDrawer", true);
+                    // this.$router.push({
+                    //     path: '/productmagDetail',
+                    //     query: { id: res.data.itemid, rowindex: res.data.rowindex },
+                    // });
+                });
+            });
+        },
+        onCancel() {
+            this.dialogFormVisible = false;
+            this.$refs["form"].resetFields();
+        },
+        uploadSuccess(res) {
+            this.$emit("onSuccess");
+        },
+    },
+};
+</script>

+ 106 - 42
src/Form/serviceWorkItem/add.vue

@@ -1,7 +1,11 @@
 <template>
     <div>
-        <el-button size="mini" type="primary" @click="show">
-            {{ title_btn ? $t(title_btn) : $t('新 建') }}
+        <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(`新建服务工作项`)"
@@ -23,7 +27,10 @@
                 >
                     <el-col :span="24">
                         <el-form-item :label="$t('工作名:')" prop="workname">
-                            <el-input v-model="form.workname" :placeholder="$t('请输入工作名')"></el-input>
+                            <el-input
+                                v-model="form.workname"
+                                :placeholder="$t('请输入工作名')"
+                            ></el-input>
                         </el-form-item>
                     </el-col>
                     <el-col :span="24">
@@ -36,77 +43,123 @@
                         </el-form-item>
                     </el-col>
                     <el-col :span="24">
-                        <el-form-item :label="$t('上传附件:')" prop="fileupload">
+                        <el-form-item
+                            :label="$t('上传附件:')"
+                            prop="fileupload"
+                        >
                             <el-radio-group v-model="form.fileupload">
-                                <el-radio :label="11">{{ $t('必填') }}</el-radio>
-                                <el-radio :label="1">{{ $t('非必填') }}</el-radio>
-                                <el-radio :label="0">{{ $t('无') }}</el-radio>
+                                <el-radio :label="11">{{
+                                    $t("必填")
+                                }}</el-radio>
+                                <el-radio :label="1">{{
+                                    $t("非必填")
+                                }}</el-radio>
+                                <el-radio :label="0">{{ $t("无") }}</el-radio>
                             </el-radio-group>
                         </el-form-item>
                     </el-col>
                     <el-col :span="24">
-                        <el-form-item :label="$t('是否添加物料:')" prop="additem">
+                        <el-form-item
+                            :label="$t('是否添加物料:')"
+                            prop="additem"
+                        >
                             <el-radio-group v-model="form.additem">
-                                <el-radio :label="11">{{ $t('必填') }}</el-radio>
-                                <el-radio :label="1">{{ $t('非必填') }}</el-radio>
-                                <el-radio :label="0">{{ $t('无') }}</el-radio>
+                                <el-radio :label="11">{{
+                                    $t("必填")
+                                }}</el-radio>
+                                <el-radio :label="1">{{
+                                    $t("非必填")
+                                }}</el-radio>
+                                <el-radio :label="0">{{ $t("无") }}</el-radio>
                             </el-radio-group>
                         </el-form-item>
                     </el-col>
                     <el-col :span="24">
-                        <el-form-item :label="$t('上传全景影像:')" prop="panorama">
+                        <el-form-item
+                            :label="$t('上传全景影像:')"
+                            prop="panorama"
+                        >
                             <el-radio-group v-model="form.panorama">
-                                <el-radio :label="11">{{ $t('必填') }}</el-radio>
-                                <el-radio :label="1">{{ $t('非必填') }}</el-radio>
-                                <el-radio :label="0">{{ $t('无') }}</el-radio>
+                                <el-radio :label="11">{{
+                                    $t("必填")
+                                }}</el-radio>
+                                <el-radio :label="1">{{
+                                    $t("非必填")
+                                }}</el-radio>
+                                <el-radio :label="0">{{ $t("无") }}</el-radio>
                             </el-radio-group>
                         </el-form-item>
                     </el-col>
                     <el-col :span="24">
-                        <el-form-item :label="$t('是否合格:')" prop="passcheck">
+                        <el-form-item
+                            :label="$t('是否合格:')"
+                            prop="passcheck"
+                        >
                             <el-radio-group v-model="form.passcheck">
-                                <el-radio :label="11">{{ $t('必填') }}</el-radio>
-                                <el-radio :label="1">{{ $t('非必填') }}</el-radio>
-                                <el-radio :label="0">{{ $t('无') }}</el-radio>
+                                <el-radio :label="11">{{
+                                    $t("必填")
+                                }}</el-radio>
+                                <el-radio :label="1">{{
+                                    $t("非必填")
+                                }}</el-radio>
+                                <el-radio :label="0">{{ $t("无") }}</el-radio>
                             </el-radio-group>
                         </el-form-item>
                     </el-col>
                     <el-col :span="24">
-                        <el-form-item :label="$t('是否客户签名:')" prop="signature">
+                        <el-form-item
+                            :label="$t('是否客户签名:')"
+                            prop="signature"
+                        >
                             <el-radio-group v-model="form.signature">
-                                <el-radio :label="11">{{ $t('必填') }}</el-radio>
-                                <el-radio :label="1">{{ $t('非必填') }}</el-radio>
-                                <el-radio :label="0">{{ $t('无') }}</el-radio>
+                                <el-radio :label="11">{{
+                                    $t("必填")
+                                }}</el-radio>
+                                <el-radio :label="1">{{
+                                    $t("非必填")
+                                }}</el-radio>
+                                <el-radio :label="0">{{ $t("无") }}</el-radio>
                             </el-radio-group>
                         </el-form-item>
                     </el-col>
                     <el-col :span="24">
-                        <el-form-item :label="$t('内容是否需要验证表单:')" prop="formcheck">
+                        <el-form-item
+                            :label="$t('内容是否需要验证表单:')"
+                            prop="formcheck"
+                        >
                             <el-radio-group v-model="form.formcheck">
-                                <el-radio :label="1">{{ $t('是') }}</el-radio>
-                                <el-radio :label="0">{{ $t('否') }}</el-radio>
+                                <el-radio :label="1">{{ $t("是") }}</el-radio>
+                                <el-radio :label="0">{{ $t("否") }}</el-radio>
                             </el-radio-group>
                         </el-form-item>
                     </el-col>
                     <el-col :span="24">
-                        <el-form-item :label="$t('是否必填服务节点:')" prop="servicenode">
+                        <el-form-item
+                            :label="$t('是否必填服务节点:')"
+                            prop="servicenode"
+                        >
                             <el-radio-group v-model="form.servicenode">
-                                <el-radio :label="1">{{ $t('是') }}</el-radio>
-                                <el-radio :label="0">{{ $t('否') }}</el-radio>
+                                <el-radio :label="1">{{ $t("是") }}</el-radio>
+                                <el-radio :label="0">{{ $t("否") }}</el-radio>
                             </el-radio-group>
                         </el-form-item>
                     </el-col>
                 </el-form>
             </div>
             <div class="fixed__btn__panel">
-                <el-button size="small" @click="onCancel" class="normal-btn-width">{{ $t('取 消') }}</el-button>
+                <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('确 定') }}
+                    >{{ title_btn == "编辑" ? $t("保 存") : $t("确 定") }}
                 </el-button>
             </div>
         </el-drawer>
@@ -114,8 +167,13 @@
 </template>
 <script>
 export default {
-    name: 'add',
-    props: { title_btn: String, title_drawer: String, data: Object },
+    name: "add",
+    props: {
+        btn_size: String,
+        title_btn: String,
+        title_drawer: String,
+        data: Object,
+    },
     data() {
         return {
             loading: false,
@@ -123,8 +181,8 @@ export default {
             currentData: {},
             form: {
                 sc_workpresetid: 0,
-                workname: '',
-                remarks: '',
+                workname: "",
+                remarks: "",
                 fileupload: 0, //附件上传,0不需要 1可上传 11必须上传
                 signature: 0, //客户签名,0不需要 1可填写 11必须填写
                 additem: 0, //物料添加,0不添加 1添加 11必须添加
@@ -134,7 +192,13 @@ export default {
                 servicenode: 0, //服务节点,0 不需要 1 需要
             },
             rules: {
-                workname: [{ required: true, message: this.$t('请输入工作名'), trigger: 'blur' }],
+                workname: [
+                    {
+                        required: true,
+                        message: this.$t("请输入工作名"),
+                        trigger: "blur",
+                    },
+                ],
             },
         };
     },
@@ -142,30 +206,30 @@ export default {
         //初始化
         show() {
             this.dialogFormVisible = true;
-            if (this.title_btn == '编辑') {
+            if (this.title_btn == "编辑") {
                 this.form = Object.assign({}, this.form, this.data);
             }
         },
         onSubmit() {
             console.log(this.form);
-            this.$refs['form'].validate(async (valid) => {
+            this.$refs["form"].validate(async (valid) => {
                 if (!valid) return false;
                 this.loading = true;
                 const res = await this.$api.requested({
-                    id: '2026051416454302',
+                    id: "2026051416454302",
                     content: this.form,
                 });
                 this.tool.showMessage(res, () => {
-                    this.$emit('onSuccess');
+                    this.$emit("onSuccess");
                     this.loading = false;
-                    this.$refs['form'].resetFields();
+                    this.$refs["form"].resetFields();
                     this.dialogFormVisible = false;
                 });
             });
         },
         onCancel() {
             this.dialogFormVisible = false;
-            this.$refs['form'].resetFields();
+            this.$refs["form"].resetFields();
         },
     },
 };

+ 140 - 21
src/HDrpManagement/headquartersServiceMaterial/index.vue

@@ -4,28 +4,110 @@
             ref="list"
             formPath="headquartersServiceMaterial"
             tableName="headquartersServiceMaterialTable"
-            idName="systemappid"
-            :apiId="{ query: 2026051508534106, del: 2026051509000001 }"
+            idName="sc_itemid"
+            :apiId="{ query: 2026051508534106, del: 2026051509000002 }"
             :detailPath="{
                 path: '/headquartersServiceMaterialDetail',
             }"
+            @checkboxCallBack="rows"
         >
             <template #titleRight>
                 <batchUp
                     class="inline-16"
-                    v-if="tool.checkAuth($route.name, 'batchUp')"
                     :rowData="rowData"
                     :disabled="rowData.length === 0"
                     @batchUpSuccess="onSuccess"
                 ></batchUp>
+                <!-- v-if="tool.checkAuth($route.name, 'batchUp')" -->
+                <batchDown
+                    class="inline-16"
+                    :rowData="rowData"
+                    :disabled="rowData.length === 0"
+                    @batchUpSuccess="onSuccess"
+                ></batchDown>
+                <!-- v-if="tool.checkAuth($route.name, 'batchDown')" -->
+                <toExamine
+                    class="inline-16"
+                    :rowData="rowData"
+                    :disabled="rowData.length === 0"
+                    @examineSuccess="onSuccess"
+                ></toExamine>
+                <!-- v-if="tool.checkAuth($route.name, 'toExamine')" -->
+                <counterExamine
+                    class="inline-16"
+                    :rowData="rowData"
+                    :disabled="rowData.length === 0"
+                    @examineSuccess="onSuccess"
+                ></counterExamine>
+                <!-- v-if="tool.checkAuth($route.name, 'reverseReview')" -->
+                <importImage
+                    class="inline-16"
+                    ref="importImage"
+                    :bindData="{
+                        ownertable: 'plm_item',
+                        ownerid: $route.query.id,
+                        usetype: 'default',
+                    }"
+                    :errorUrl="errorUrl"
+                    @clearUrl="errorUrl = null"
+                    @onSuccess="bindImportImage"
+                ></importImage>
+                <!-- v-if="tool.checkAuth($route.name, 'exportImage')" -->
             </template>
             <template v-slot:tbList="scope">
-                <div>
+                <p
+                    :style="{
+                        color:
+                            scope.data.column.data.shelf === 1
+                                ? tool.getStatusColor('上架', true)
+                                : tool.getStatusColor('下架', true),
+                    }"
+                    v-if="scope.data.column.columnname === 'shelf'"
+                >
+                    {{ scope.data.column.data.shelf ? $t("上架") : $t("下架") }}
+                </p>
+                <p v-else-if="scope.data.column.columnname === 'cover'">
+                    <previewImage
+                        v-if="scope.data.column.data.attinfos[0]"
+                        class="image"
+                        :image="scope.data.column.data.attinfos[0]"
+                        :list="scope.data.column.data.attinfos"
+                        :deletebtn="false"
+                    ></previewImage>
+                </p>
+                <p v-else-if="scope.data.column.columnname === 'itemclass'">
+                    <span
+                        v-if="
+                            JSON.stringify(scope.data.column.data.itemclass) !==
+                                '[]' && scope.data.column.data.itemclass
+                        "
+                    >
+                        <span
+                            v-for="item in scope.data.column.data.itemclass"
+                            :key="item.index"
+                        >
+                            <el-tag
+                                style="
+                                    margin-right: 10px;
+                                    margin-top: 5px;
+                                    margin-bottom: 5px;
+                                "
+                                type="success"
+                                >{{ $t(item.itemclassfullname) }}</el-tag
+                            >
+                        </span>
+                    </span>
+                    <span v-else> </span>
+                </p>
+                <div v-else>
                     {{
-                        formatColumnValue(
-                            scope.data.column.columnname,
-                            scope.data.column.data[scope.data.column.columnname],
-                        )
+                        scope.data.column.data[[scope.data.column.columnname]]
+                            ? $t(
+                                  scope.data.column.data[
+                                      [scope.data.column.columnname]
+                                  ]
+                              )
+                            : "--"
                     }}
                 </div>
             </template>
@@ -35,46 +117,83 @@
 </template>
 
 <script>
-import batchUp from './modules/batchUp';
+import batchUp from "./modules/batchUp";
+import batchDown from "./modules/batchDown";
+import toExamine from "./modules/toExamine";
+import counterExamine from "./modules/counterExamine";
+import importImage from "./modules/importImage";
 export default {
     data() {
         return {
+            rowData: [],
+            errorUrl: null,
             // 是否类型字段
-            booleanFields: ['formcheck', 'servicenode'],
+            booleanFields: ["formcheck", "servicenode"],
 
             // 通用状态
             commonStatusMap: {
-                0: '无',
-                1: '非必填',
-                11: '必填',
+                0: "无",
+                1: "非必填",
+                11: "必填",
             },
 
             // 是否状态
             booleanStatusMap: {
-                0: '否',
-                1: '是',
+                0: "否",
+                1: "是",
             },
         };
     },
+    components: {
+        batchUp,
+        batchDown,
+        toExamine,
+        counterExamine,
+        importImage,
+    },
     methods: {
         formatColumnValue(columnName, value) {
-            const map = this.booleanFields.includes(columnName) ? this.booleanStatusMap : this.commonStatusMap;
-            return this.$t(map[value] || value || '--');
+            const map = this.booleanFields.includes(columnName)
+                ? this.booleanStatusMap
+                : this.commonStatusMap;
+            return this.$t(map[value] || value || "--");
         },
         detailGo(row) {
+            console.log("row-------", row);
             let route = this.$route;
-            if (route.path !== '/headquartersServiceMaterialDetail') {
+            if (route.path !== "/headquartersServiceMaterialDetail") {
                 this.oldRoute = { path: route.path, query: route.query };
-                this.$store.dispatch('setHistoryRouter', this.oldRoute);
+                this.$store.dispatch("setHistoryRouter", this.oldRoute);
             }
             this.$router.push({
-                path: '/headquartersServiceMaterialDetail',
+                path: "/headquartersServiceMaterialDetail",
                 query: {
-                    id: row.sc_workpresetid,
+                    id: row.sc_itemid,
                     rowindex: row.rowindex,
                 },
             });
         },
+        rows(val) {
+            this.rowData = val;
+        },
+        onSuccess() {
+            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();
+            });
+        },
     },
 };
 </script>

+ 48 - 0
src/HDrpManagement/headquartersServiceMaterial/modules/batchDown.vue

@@ -0,0 +1,48 @@
+<template>
+  <div>
+    <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">{{$t(`批量下架`)}}</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "batchDown",
+  props:["rowData","disabled"],
+  methods:{
+    onshow(){
+      this.onBatchDown()
+    },
+    onBatchDown(){
+      this.$confirm(this.$t('确定下架这些物料吗')+'?', this.$t('提示'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: 'warning'
+      }).then(async () => {
+        let row = []
+        this.rowData.forEach(function (item,index) {
+          row[index] = item.itemid
+        })
+        const res = await this.$api.requested({
+          "id": 20220923154802,
+          "content": {
+            "itemids": row,
+            "isonsale": 0
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('batchUpSuccess')
+        })
+      }).catch(async () => {
+        this.$message({
+          type: 'info',
+          message: this.$t('已取消批量下架')
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 71 - 0
src/HDrpManagement/headquartersServiceMaterial/modules/counterExamine.vue

@@ -0,0 +1,71 @@
+<template>
+  <div>
+    <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">{{$t(`反 审`)}}</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props:["rowData","disabled"],
+  name: "counterExamine",
+  data(){
+    return {
+      flag:false
+    }
+  },
+  methods:{
+    onshow(){
+      this.flag = false
+      this.rowData.forEach(e => {
+        if (e.status === '新建'){
+          this.flag = true
+        }
+      })
+      if (this.flag){
+        this.$alert(this.$t('所选数据中有数据还未被审核,请检查后再进行操作'), this.$t('提示'), {
+          confirmButtonText: this.$t('确定'),
+          callback: action => {
+            this.$message({
+              type: 'info',
+              message: this.$t(`请检查所选数据`)
+            });
+          }
+        });
+      }else {
+        this.onCounter()
+      }
+    },
+    onCounter(){
+      this.$confirm(this.$t('确定反审这些数据吗')+'?', this.$t('提示'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: 'warning'
+      }).then(async () => {
+        let row = []
+        this.rowData.forEach(function (item,index) {
+          row[index] = item.itemid
+        })
+        const res = await this.$api.requested({
+          "id": 20220923153902,
+          "content": {
+            "itemids": row,
+            "status": 0
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('examineSuccess')
+        })
+      }).catch(async () => {
+        this.$message({
+          type: 'info',
+          message: this.$t('已取消反审')
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 134 - 0
src/HDrpManagement/headquartersServiceMaterial/modules/detail.vue

@@ -0,0 +1,134 @@
+<template>
+    <div>
+        <basicDetails
+            ref="details"
+            :titleText="mainData.name"
+            :editData="mainData"
+            :mainAreaData="mainAreaData"
+            turnPageId="2026051509000001"
+            idname="sc_itemid"
+            ownertable="sc_item"
+            tags=""
+            :tabs="['详细信息', '物料分类']"
+            :column="4"
+            @pageChange="pageChange"
+            @onEditSuccess="queryMainData($route.query.id)"
+        >
+            <div slot="tags"></div>
+            <template slot="customOperation">
+                <Edit
+                    class="inline-16"
+                    title_btn="编辑"
+                    title_drawer="编辑服务工作项"
+                    btn_size="mini"
+                    :data="mainData"
+                    @onSuccess="queryMainData"
+                ></Edit>
+            </template>
+            <div slot="slot0">
+                <base-info
+                    v-if="detailInfo"
+                    :detailInfo="detailInfo"
+                ></base-info>
+            </div>
+            <div slot="slot1"></div>
+        </basicDetails>
+    </div>
+</template>
+
+<script>
+import Edit from "@/Form/serviceWorkItem/add";
+import BaseInfo from "@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo";
+
+export default {
+    name: "detail",
+    data() {
+        return {
+            mainData: {},
+            mainAreaData: {},
+            detailInfo: "",
+        };
+    },
+    components: { Edit, BaseInfo },
+    methods: {
+        async queryMainData() {
+            console.log("this.$route.query.id", this.$route.query.id);
+            const res = await this.$api.requested({
+                id: 2026051509000001,
+                content: {
+                    sc_itemid: this.$route.query.id,
+                },
+            });
+            this.mainData = res.data;
+            this.changeDataStructure();
+            console.log("this.mainData", this.mainData);
+        },
+        changeDataStructure() {
+            let that = this;
+            this.mainAreaData = [
+                {
+                    label: "物料名称",
+                    value: this.mainData.name,
+                },
+                {
+                    label: "上/下架",
+                    value: this.mainData.shelf ? "上架" : "下架",
+                    style: function () {
+                        let style = {};
+                        switch (that.mainData.shelf) {
+                            case 1:
+                                style = { color: "#ff0000" };
+                                break;
+                            case 0:
+                                style = { color: "#666666" };
+                                break;
+                            default:
+                                break;
+                        }
+                        return style;
+                    },
+                },
+            ];
+            this.detailInfo = {
+                baseInfo: [
+                    {
+                        label: "物料名称",
+                        value: this.mainData.name,
+                    },
+                ],
+                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.changedate },
+                    { label: "上架时间", value: this.mainData.changedate },
+                    { label: "审核人", value: this.mainData.changedate },
+                    { label: "审核时间", value: this.mainData.changedate },
+                ],
+            };
+        },
+        // 监听切换数据,上一页,下一页
+        pageChange(id, rowindex, tabIndex) {
+            this.flag = false;
+            tabIndex = this.$route.query.tabIndex;
+            this.$router.replace({
+                path: "/headquartersServiceMaterialDetail",
+                query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
+            });
+            this.queryMainData(id);
+        },
+        onSuccess() {
+            this.visible = false;
+            this.queryMainData(this.$route.query.id);
+            this.$emit("onSuccess");
+        },
+    },
+    mounted() {
+        this.queryMainData(this.$route.query.id);
+    },
+    created() {},
+};
+</script>
+
+<style scoped></style>

+ 203 - 0
src/HDrpManagement/headquartersServiceMaterial/modules/importImage.vue

@@ -0,0 +1,203 @@
+<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>
+</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()
+    },
+    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
+
+      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)
+    },
+
+    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])
+    },
+
+    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;
+}
+.upload-demo > div {
+  width: 100% !important;
+}
+.upload-demo .el-upload-dragger {
+  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;
+}
+.progress_panel:hover {
+  box-shadow: 0px 0px 5px #ccc;
+}
+.progress_panel > div {
+  flex: 1;
+  padding: 0 10px;
+}
+.progress_panel > div > p {
+  line-height: 30px;
+}
+.tips{
+  line-height: 30px;
+}
+</style>

+ 72 - 0
src/HDrpManagement/headquartersServiceMaterial/modules/toExamine.vue

@@ -0,0 +1,72 @@
+<template>
+  <div >
+    <el-button :type="disabled?'':'primary'"  size="small"  @click="onshow" :disabled="disabled">{{$t(`审 核`)}}</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props:["rowData","disabled"],
+  name: "toExamine",
+  data(){
+    return {
+      flag:false
+    }
+  },
+  methods:{
+    onshow(){
+      this.flag = false
+      this.rowData.forEach(e => {
+        if (e.status === '审核'){
+          this.flag = true
+        }
+      })
+      if (this.flag){
+        this.$alert(this.$t('所选数据中已有数据被审核,请检查后再进行操作'), this.$t('提示'), {
+          confirmButtonText: this.$t('确定'),
+          callback: action => {
+            this.$message({
+              type: 'info',
+              message: this.$t(`请检查所选数据`)
+            });
+          }
+        });
+      }else {
+        this.onExamine()
+      }
+    },
+    onExamine(){
+      this.$confirm(this.$t('确定通过这些数据的审核吗')+'?', this.$t('提示'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: 'warning'
+      }).then(async () => {
+        let row = []
+        this.rowData.forEach(function (item,index) {
+          row[index] = item.itemid
+        })
+        const res = await this.$api.requested({
+          "id": 20220923153902,
+          "content": {
+            "itemids": row,
+            "status": 1
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('examineSuccess')
+        })
+      }).catch((err) => {
+        console.log(err)
+        this.$message({
+          type: 'info',
+          message: this.$t('已取消审核')
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 113 - 0
src/HDrpManagement/ourServiceMaterial/index.vue

@@ -0,0 +1,113 @@
+<template>
+    <div>
+        <basicLayout
+            ref="list"
+            formPath="ourServiceMaterial"
+            tableName="ourServiceMaterialTable"
+            idName="sc_item_localid"
+            :apiId="{ query: 2026051510000002, del: 2026051510000004 }"
+            :detailPath="{
+                path: '/ourServiceMaterialDetail',
+            }"
+        >
+            <template #custom>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t(`使用状态`) }}:</label>
+                    <el-select
+                        class="inline-24"
+                        v-model="selectParam.isonsale"
+                        :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.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>
+            </template>
+            <template v-slot:tbList="scope">
+                <div v-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
+                    >
+                </div>
+                <div v-else>
+                    {{
+                        scope.data.column.data[[scope.data.column.columnname]]
+                            ? $t(
+                                  scope.data.column.data[
+                                      [scope.data.column.columnname]
+                                  ]
+                              )
+                            : "--"
+                    }}
+                </div>
+            </template>
+            <template v-slot:tbOpreation="scope"> </template>
+        </basicLayout>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            selectParam: {},
+            tradefield: [], // 领域
+        };
+    },
+    methods: {
+        selectChange() {},
+        // 查询领域
+        async fieldData() {
+            const res = await this.$store.dispatch(
+                "optiontypeselect",
+                "tradefield"
+            );
+            this.tradefield = res.data;
+        },
+        listData() {
+            this.$refs.basicLayout.param.content.where = this.selectParam;
+            this.$refs.basicLayout.listData();
+        },
+    },
+    mounted() {
+        this.fieldData();
+        this.listData();
+    },
+};
+</script>
+<style></style>

+ 0 - 0
src/HDrpManagement/ourServiceMaterial/modules/detail.vue


+ 15 - 13
src/HDrpManagement/serviceWorkItem/index.vue

@@ -5,7 +5,7 @@
             formPath="serviceWorkItem"
             tableName="serviceWorkItemTable"
             idName="sc_workpresetid"
-            :apiId="{ query: 2026051416494002, del: 2026051416481302 }"
+            :apiId="{ query: 2026051416494002, del: 2026051416503602 }"
             :detailPath="{
                 path: '/serviceWorkItemDetail',
             }"
@@ -15,7 +15,7 @@
                     {{
                         formatColumnValue(
                             scope.data.column.columnname,
-                            scope.data.column.data[scope.data.column.columnname],
+                            scope.data.column.data[scope.data.column.columnname]
                         )
                     }}
                 </div>
@@ -30,35 +30,37 @@ export default {
     data() {
         return {
             // 是否类型字段
-            booleanFields: ['formcheck', 'servicenode'],
+            booleanFields: ["formcheck", "servicenode"],
 
             // 通用状态
             commonStatusMap: {
-                0: '无',
-                1: '非必填',
-                11: '必填',
+                0: "无",
+                1: "非必填",
+                11: "必填",
             },
 
             // 是否状态
             booleanStatusMap: {
-                0: '否',
-                1: '是',
+                0: "否",
+                1: "是",
             },
         };
     },
     methods: {
         formatColumnValue(columnName, value) {
-            const map = this.booleanFields.includes(columnName) ? this.booleanStatusMap : this.commonStatusMap;
-            return this.$t(map[value] || value || '--');
+            const map = this.booleanFields.includes(columnName)
+                ? this.booleanStatusMap
+                : this.commonStatusMap;
+            return this.$t(map[value] || value || "--");
         },
         detailGo(row) {
             let route = this.$route;
-            if (route.path !== '/serviceWorkItemDetail') {
+            if (route.path !== "/serviceWorkItemDetail") {
                 this.oldRoute = { path: route.path, query: route.query };
-                this.$store.dispatch('setHistoryRouter', this.oldRoute);
+                this.$store.dispatch("setHistoryRouter", this.oldRoute);
             }
             this.$router.push({
-                path: '/serviceWorkItemDetail',
+                path: "/serviceWorkItemDetail",
                 query: {
                     id: row.sc_workpresetid,
                     rowindex: row.rowindex,

+ 62 - 41
src/HDrpManagement/serviceWorkItem/modules/detail.vue

@@ -20,6 +20,7 @@
                     class="inline-16"
                     title_btn="编辑"
                     title_drawer="编辑服务工作项"
+                    btn_size="mini"
                     :data="mainData"
                     @onSuccess="queryMainData"
                 ></Edit>
@@ -31,9 +32,9 @@
 </template>
 
 <script>
-import Edit from '@/Form/serviceWorkItem/add';
+import Edit from "@/Form/serviceWorkItem/add";
 export default {
-    name: 'detail',
+    name: "detail",
     data() {
         return {
             mainData: {},
@@ -51,29 +52,33 @@ export default {
             });
             this.mainData = res.data;
             this.changeDataStructure();
-            console.log('this.mainData', this.mainData);
+            console.log("this.mainData", this.mainData);
         },
         changeDataStructure() {
             let that = this;
             this.mainAreaData = [
                 {
-                    label: '工作名',
+                    label: "工作名",
                     value: this.mainData.workname,
                 },
                 {
-                    label: '上传附件',
-                    value: this.mainData.fileupload ? (this.mainData.fileupload == 1 ? '非必填' : '必填') : '无',
+                    label: "上传附件",
+                    value: this.mainData.fileupload
+                        ? this.mainData.fileupload == 1
+                            ? "非必填"
+                            : "必填"
+                        : "无",
                     style: function () {
                         let style = {};
                         switch (that.mainData.fileupload) {
                             case 0:
-                                style = { color: '#333333' };
+                                style = { color: "#333333" };
                                 break;
                             case 1:
-                                style = { color: '#008000' };
+                                style = { color: "#008000" };
                                 break;
                             case 11:
-                                style = { color: '#ff0000' };
+                                style = { color: "#ff0000" };
                                 break;
                             default:
                                 break;
@@ -83,19 +88,23 @@ export default {
                 },
 
                 {
-                    label: '是否添加物料',
-                    value: this.mainData.additem ? (this.mainData.additem == 1 ? '非必填' : '必填') : '无',
+                    label: "是否添加物料",
+                    value: this.mainData.additem
+                        ? this.mainData.additem == 1
+                            ? "非必填"
+                            : "必填"
+                        : "无",
                     style: function () {
                         let style = {};
                         switch (that.mainData.additem) {
                             case 0:
-                                style = { color: '#333333' };
+                                style = { color: "#333333" };
                                 break;
                             case 1:
-                                style = { color: '#008000' };
+                                style = { color: "#008000" };
                                 break;
                             case 11:
-                                style = { color: '#ff0000' };
+                                style = { color: "#ff0000" };
                                 break;
                             default:
                                 break;
@@ -105,16 +114,16 @@ export default {
                 },
 
                 {
-                    label: '内容是否需验证表单',
-                    value: this.mainData.formcheck ? '是' : '否',
+                    label: "内容是否需验证表单",
+                    value: this.mainData.formcheck ? "是" : "否",
                     style: function () {
                         let style = {};
                         switch (that.mainData.formcheck) {
                             case 1:
-                                style = { color: '#ff0000' };
+                                style = { color: "#ff0000" };
                                 break;
                             case 0:
-                                style = { color: '#666666' };
+                                style = { color: "#666666" };
                                 break;
                             default:
                                 break;
@@ -124,19 +133,23 @@ export default {
                 },
 
                 {
-                    label: '上传全景影像',
-                    value: this.mainData.panorama ? (this.mainData.panorama == 1 ? '非必填' : '必填') : '无',
+                    label: "上传全景影像",
+                    value: this.mainData.panorama
+                        ? this.mainData.panorama == 1
+                            ? "非必填"
+                            : "必填"
+                        : "无",
                     style: function () {
                         let style = {};
                         switch (that.mainData.panorama) {
                             case 0:
-                                style = { color: '#333333' };
+                                style = { color: "#333333" };
                                 break;
                             case 1:
-                                style = { color: '#008000' };
+                                style = { color: "#008000" };
                                 break;
                             case 11:
-                                style = { color: '#ff0000' };
+                                style = { color: "#ff0000" };
                                 break;
                             default:
                                 break;
@@ -146,19 +159,23 @@ export default {
                 },
 
                 {
-                    label: '是否合格',
-                    value: this.mainData.passcheck ? (this.mainData.passcheck == 1 ? '非必填' : '必填') : '无',
+                    label: "是否合格",
+                    value: this.mainData.passcheck
+                        ? this.mainData.passcheck == 1
+                            ? "非必填"
+                            : "必填"
+                        : "无",
                     style: function () {
                         let style = {};
                         switch (that.mainData.passcheck) {
                             case 0:
-                                style = { color: '#333333' };
+                                style = { color: "#333333" };
                                 break;
                             case 1:
-                                style = { color: '#008000' };
+                                style = { color: "#008000" };
                                 break;
                             case 11:
-                                style = { color: '#ff0000' };
+                                style = { color: "#ff0000" };
                                 break;
                             default:
                                 break;
@@ -167,19 +184,23 @@ export default {
                     },
                 },
                 {
-                    label: '是否客户签名',
-                    value: this.mainData.signature ? (this.mainData.signature == 1 ? '非必填' : '必填') : '无',
+                    label: "是否客户签名",
+                    value: this.mainData.signature
+                        ? this.mainData.signature == 1
+                            ? "非必填"
+                            : "必填"
+                        : "无",
                     style: function () {
                         let style = {};
                         switch (that.mainData.signature) {
                             case 0:
-                                style = { color: '#333333' };
+                                style = { color: "#333333" };
                                 break;
                             case 1:
-                                style = { color: '#008000' };
+                                style = { color: "#008000" };
                                 break;
                             case 11:
-                                style = { color: '#ff0000' };
+                                style = { color: "#ff0000" };
                                 break;
                             default:
                                 break;
@@ -188,16 +209,16 @@ export default {
                     },
                 },
                 {
-                    label: '是否必填服务节点',
-                    value: this.mainData.servicenode ? '是' : '否',
+                    label: "是否必填服务节点",
+                    value: this.mainData.servicenode ? "是" : "否",
                     style: function () {
                         let style = {};
                         switch (that.mainData.servicenode) {
                             case 1:
-                                style = { color: '#ff0000' };
+                                style = { color: "#ff0000" };
                                 break;
                             case 0:
-                                style = { color: '#666666' };
+                                style = { color: "#666666" };
                                 break;
                             default:
                                 break;
@@ -206,8 +227,8 @@ export default {
                     },
                 },
                 {
-                    label: '操作说明',
-                    value: this.mainData.remarks || '--',
+                    label: "操作说明",
+                    value: this.mainData.remarks || "--",
                 },
             ];
         },
@@ -216,7 +237,7 @@ export default {
             this.flag = false;
             tabIndex = this.$route.query.tabIndex;
             this.$router.replace({
-                path: '/serveWorkTaskDetail',
+                path: "/serveWorkTaskDetail",
                 query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
             });
             this.queryMainData(id);
@@ -224,7 +245,7 @@ export default {
         onSuccess() {
             this.visible = false;
             this.queryMainData(this.$route.query.id);
-            this.$emit('onSuccess');
+            this.$emit("onSuccess");
         },
     },
     mounted() {

+ 1 - 1
src/HDrpManagement/terminalWorkBillModule/index.vue

@@ -5,7 +5,7 @@
             formPath="terminalWorkBillModule"
             tableName="terminalWorkBillModuleTable"
             idName="sc_workorder_templateid"
-            :apiId="{ query: 2026051511261302, del: 2026051513132402 }"
+            :apiId="{ query: 2026051511261302, del: 2026051513141202 }"
             :detailPath="{
                 path: '/terminalWorkBillModuleDetail',
             }"

+ 1 - 1
src/HDrpManagement/terminalWorkBillModule/modules/detail.vue

@@ -319,7 +319,7 @@ export default {
             this.flag = false;
             tabIndex = this.$route.query.tabIndex;
             this.$router.replace({
-                path: "/serveWorkTaskDetail",
+                path: "/terminalWorkBillModuleDetail",
                 query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
             });
             this.queryMainData(id);

+ 23 - 0
src/router/HDrpManagement.js

@@ -1410,5 +1410,28 @@ const HDrpManagement = [
       },
     ],
   },
+  {
+    path: '/ourServiceMaterial',
+    name: 'ourServiceMaterial',
+    meta: {
+      title: '本站服务物料',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/ourServiceMaterial/index'),
+    children: [
+      {
+        path: '/ourServiceMaterialDetail',
+        name: 'ourServiceMaterial',
+        meta: {
+          title: '本站服务物料详情',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () =>
+          import(/* webpackChunkName: "about" */ '@/HDrpManagement/ourServiceMaterial/modules/detail'),
+      },
+    ],
+  },
 ];
 export default HDrpManagement;