Browse Source

no message

linwenxin 1 year ago
parent
commit
b8bec25288

+ 9 - 0
src/api/auxiliaryChargeManagement.js

@@ -1,5 +1,14 @@
 import request, { postBlob, getBlob, handleImport } from '@/utils/request'
 
+export function materialNormImport(data) {
+  return handleImport('/material/norm/import', data.formdata, data.id || '')
+}
+
+export function materialNormImport2(data) {
+  return handleImport('/material/norm/import2', data.formdata, data.id || '')
+}
+
+
 export function materialNormList(data) {
   return request({
     url: `/material/norm/list?moduleId=${data.moduleId}`,

+ 5 - 0
src/api/auxiliaryPriceManagement.js

@@ -1,5 +1,10 @@
 import request, { postBlob, getBlob, handleImport } from '@/utils/request'
 
+
+export function websitGoodsmImport(data) {
+  return handleImport('/websit/goods/m/import', data.formdata, data.id || '')
+}
+
 export function materialNormList(data) {
   return request({
     url: `/websit/goods/m/list?moduleId=${data.moduleId}`,

+ 57 - 2
src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryChargeManagement/index.vue

@@ -21,9 +21,10 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-import { materialNormList, materialNormListExport, materialNormAdd, materialNormEdit, materialNormDetail, materialNormBatchUpdateStatus } from "@/api/auxiliaryChargeManagement";
+import { materialNormList, materialNormListExport, materialNormAdd, materialNormEdit, materialNormDetail, materialNormBatchUpdateStatus, materialNormImport2, materialNormImport } from "@/api/auxiliaryChargeManagement";
 import { materialCategoryTree } from "@/api/auxiliaryMaterialClass";
 import { getTypeList } from "@/api/auxiliaryFittings/attachmentProfile";
+import { commonTemplateDownload } from '@/api/common.js'
 export default {
   components: { TemplatePage },
   mixins: [import_mixin],
@@ -39,6 +40,60 @@ export default {
               click: this.addData
             }
           ],
+          [
+            {
+              name: '导入物料',
+              click: () => { }
+            },
+            {
+              name: '导入物料收费',
+              render: () => {
+                return this.importButton(materialNormImport, '导入物料收费')
+              }
+            },
+            {
+              name: '下载物料收费模板',
+              click: () => {
+                commonTemplateDownload({ name: '辅材收费标准模板(物料收费).xlsx' }, `辅材收费标准模板(物料收费)`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            },
+          ],
+          [
+            {
+              name: '导入服务',
+              click: () => { }
+            },
+            {
+              name: '导入服务收费',
+              render: () => {
+                return this.importButton(materialNormImport2, '导入服务收费')
+              }
+            },
+            {
+              name: '下载服务收费模板',
+              click: () => {
+                commonTemplateDownload({ name: '辅材收费标准模板(服务收费).xlsx' }, `辅材收费标准模板(服务收费)`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            },
+          ],
         ],
         [
           [
@@ -377,7 +432,7 @@ export default {
     openForm() {
       Promise.all([
         getTypeList({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.dict_type", "compare": "=", "value": `ASSIST_UNIT` }, { "param": "a.status", "compare": "=", "value": "ON" }] }),
-        materialCategoryTree({state:"ON"})
+        materialCategoryTree({ state: "ON" })
       ]).then(([res1, res2]) => {
         this.partsUnitList = res1.data.records
         this.materialCategoryTree = res2.data.filter(item => (item.child && item.child.length > 0))

+ 30 - 2
src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryPriceManagement/index.vue

@@ -21,9 +21,10 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-import { materialNormList, materialNormListExport, materialNormAdd, materialNormEdit, materialNormDetail, materialNormBatchUpdateStatus } from "@/api/auxiliaryPriceManagement";
+import { websitGoodsmImport, materialNormList, materialNormListExport, materialNormAdd, materialNormEdit, materialNormDetail, materialNormBatchUpdateStatus } from "@/api/auxiliaryPriceManagement";
 import { materialCategoryTree } from "@/api/auxiliaryMaterialClass";
 import { getTypeList } from "@/api/auxiliaryFittings/attachmentProfile";
+import { commonTemplateDownload } from '@/api/common.js'
 export default {
   components: { TemplatePage },
   mixins: [import_mixin],
@@ -39,6 +40,33 @@ export default {
               click: this.addData
             }
           ],
+          [
+            {
+              name: '导入辅材',
+              click: () => { }
+            },
+            {
+              name: '导入辅材模板',
+              render: () => {
+                return this.importButton(websitGoodsmImport, '导入辅材模板')
+              }
+            },
+            {
+              name: '下载辅材模板',
+              click: () => {
+                commonTemplateDownload({ name: '辅材模板.xlsx' }, `辅材模板`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            },
+          ],
         ],
         [
           [
@@ -297,7 +325,7 @@ export default {
     openForm() {
       Promise.all([
         getTypeList({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.dict_type", "compare": "=", "value": `ASSIST_UNIT` }, { "param": "a.status", "compare": "=", "value": "ON" }] }),
-        materialCategoryTree({state:"ON"})
+        materialCategoryTree({ state: "ON" })
       ]).then(([res1, res2]) => {
         this.partsUnitList = res1.data.records
         this.materialCategoryTree = res2.data.filter(item => (item.child && item.child.length > 0))