Quellcode durchsuchen

产品加入导入演示功能

yejian vor 2 Jahren
Ursprung
Commit
e54da26108

+ 163 - 153
imcs-ui/src/api/prepareProductMgr/bomMgr.js

@@ -1,153 +1,163 @@
-import axiosApi from '../AxiosApi.js'
-
-const apiList = {
-	getList: {
-    method: 'POST',
-    url: `/authority/bBom/all`
-  },
-  page: {
-    method: 'POST',
-    url: `/authority/bBom/page`
-  },
-  pageList: {
-    method: 'POST',
-    url: `/authority/bBom/pageList`
-  },
-  update: {
-    method: 'POST',
-    url: `/authority/bBom/update`
-  },
-  save: {
-    method: 'POST',
-    url: `/authority/bBom/save`
-  },
-  updateStatus: {
-    method: 'POST',
-    url: `/authority/bBom/status`
-  },
-  audioStatus: {
-    method: 'POST',
-    url: `/authority/bBom/updateStatus`
-  },
-  remove: {
-    method: 'DELETE',
-    url: `/authority/bBom`
-  },
-  get: {
-    method: 'POST',
-    url: `/authority/bBom/get`
-  },
-  list: {
-    method: 'POST',
-    url: `/authority/bBom/query`
-  },
-  preview: {
-    method: 'POST',
-    url: `/authority/bBom/preview`
-  },
-  export: {
-    method: 'POST',
-    url: `/authority/bBom/export`
-  },
-  import: {
-    method: 'POST',
-    url: `/authority/bBom/import`
-  }
-}
-
-export default {
-	getList (data) {
-    return axiosApi({
-      ...apiList.getList,
-      data
-    })
-  },
-  page (data) {
-    return axiosApi({
-      ...apiList.page,
-      data
-    })
-  },
-  pageList (data) {
-    return axiosApi({
-      ...apiList.pageList,
-      data
-    })
-  },
-  save (data) {
-    return axiosApi({
-      ...apiList.save,
-      data
-    })
-  },
-  update (data) {
-    return axiosApi({
-      ...apiList.update,
-      data
-    })
-  },
-  updateStatus (data) {
-    return axiosApi({
-      ...apiList.updateStatus,
-      formData: true,
-      data
-    })
-  },
-  // 1-待审核(提交审核); 2-审核通过; 3-审核不通过
-  audioStatus (data) {
-    return axiosApi({
-      ...apiList.audioStatus,
-      data
-    })
-  },
-  remove (data) {
-    return axiosApi({
-      ...apiList.remove,
-      data
-    })
-  },
-  get (data) {
-    return axiosApi({
-      ...apiList.get,
-      data
-    })
-  },
-  list (data) {
-    return axiosApi({
-      ...apiList.list,
-      data
-    })
-  },
-  check (code) {
-    return axiosApi({
-      method: 'GET',
-      url: `/authority/bBom/check/${code}`
-    })
-  },
-  checkField (data) {
-    return axiosApi({
-      method: 'POST',
-      url: `/authority/bBom/check`,
-      data
-    })
-  },
-  preview (data) {
-    return axiosApi({
-      ...apiList.preview,
-      data
-    })
-  },
-  export (data) {
-    return axiosApi({
-      ...apiList.export,
-      responseType: "blob",
-      data
-    })
-  },
-  import (data) {
-    return axiosApi({
-      ...apiList.import,
-      data
-    })
-  }
-}
+import axiosApi from '../AxiosApi.js'
+
+const apiList = {
+	getList: {
+    method: 'POST',
+    url: `/authority/bBom/all`
+  },
+  page: {
+    method: 'POST',
+    url: `/authority/bBom/page`
+  },
+  pageList: {
+    method: 'POST',
+    url: `/authority/bBom/pageList`
+  },
+  update: {
+    method: 'POST',
+    url: `/authority/bBom/update`
+  },
+  save: {
+    method: 'POST',
+    url: `/authority/bBom/save`
+  },
+  updateStatus: {
+    method: 'POST',
+    url: `/authority/bBom/status`
+  },
+  audioStatus: {
+    method: 'POST',
+    url: `/authority/bBom/updateStatus`
+  },
+  remove: {
+    method: 'DELETE',
+    url: `/authority/bBom`
+  },
+  get: {
+    method: 'POST',
+    url: `/authority/bBom/get`
+  },
+  list: {
+    method: 'POST',
+    url: `/authority/bBom/query`
+  },
+  preview: {
+    method: 'POST',
+    url: `/authority/bBom/preview`
+  },
+  export: {
+    method: 'POST',
+    url: `/authority/bBom/export`
+  },
+  import: {
+    method: 'POST',
+    url: `/authority/bBom/import`
+  },
+  importBom: {
+    method: 'POST',
+    url: `/authority/bBom/importBom`
+  }
+}
+
+export default {
+	getList (data) {
+    return axiosApi({
+      ...apiList.getList,
+      data
+    })
+  },
+  page (data) {
+    return axiosApi({
+      ...apiList.page,
+      data
+    })
+  },
+  pageList (data) {
+    return axiosApi({
+      ...apiList.pageList,
+      data
+    })
+  },
+  save (data) {
+    return axiosApi({
+      ...apiList.save,
+      data
+    })
+  },
+  update (data) {
+    return axiosApi({
+      ...apiList.update,
+      data
+    })
+  },
+  updateStatus (data) {
+    return axiosApi({
+      ...apiList.updateStatus,
+      formData: true,
+      data
+    })
+  },
+  // 1-待审核(提交审核); 2-审核通过; 3-审核不通过
+  audioStatus (data) {
+    return axiosApi({
+      ...apiList.audioStatus,
+      data
+    })
+  },
+  remove (data) {
+    return axiosApi({
+      ...apiList.remove,
+      data
+    })
+  },
+  get (data) {
+    return axiosApi({
+      ...apiList.get,
+      data
+    })
+  },
+  list (data) {
+    return axiosApi({
+      ...apiList.list,
+      data
+    })
+  },
+  check (code) {
+    return axiosApi({
+      method: 'GET',
+      url: `/authority/bBom/check/${code}`
+    })
+  },
+  checkField (data) {
+    return axiosApi({
+      method: 'POST',
+      url: `/authority/bBom/check`,
+      data
+    })
+  },
+  preview (data) {
+    return axiosApi({
+      ...apiList.preview,
+      data
+    })
+  },
+  export (data) {
+    return axiosApi({
+      ...apiList.export,
+      responseType: "blob",
+      data
+    })
+  },
+  import (data) {
+    return axiosApi({
+      ...apiList.import,
+      data
+    })
+  },
+  importBom (data) {
+    return axiosApi({
+      ...apiList.importBom,
+      data
+    })
+  }
+}

+ 6 - 3
imcs-ui/src/lang/zh/prepare.js

@@ -94,7 +94,7 @@ export default {
 		// 列表搜索表单名称
 		searchForm: {
 			name: '零件名称',
-			tpName: '托板名称',			
+			tpName: '托板名称',
 			productName: '产品名称',
 			parts_no: '零部件编号',
 			bomAlias: '产品代号',
@@ -144,8 +144,11 @@ export default {
 	  		expandsEve: '展开产品所有节点',
 	  		audioStatus: '提交审核',
 	  		audioBtn: '审核产品',
-	  		viewTech: '查看工序分析',
-			printBtn: '打印',
+        importBtn: '零件信息导入',
+        importExcel: 'EXCEL',
+        importSiemens: 'Siemens NX',
+        importCatia: 'CATIA',
+			  printBtn: '打印',
 	  	},
 	  	// 列表的cell名称
 		table: {

+ 58 - 1
imcs-ui/src/views/zuihou/prepareProductMgr/bomMgr/Index.vue

@@ -86,7 +86,8 @@
 <!--	      <el-button type="primary" icon="el-icon-finished" size="medium" @click="expandsEve()">{{$t("prepare.buttons.expandsEve")}}</el-button>-->
 	      <el-button type="primary" icon="el-icon-thumb" size="medium" v-has-permission="['bom:examine']" @click="audioStatus('1')">{{$t("prepare.buttons.audioStatus")}}</el-button>
 	      <el-button type="primary" icon="el-icon-suitcase" size="medium" v-has-permission="['bom:exproduct']" @click="audioBtn()">{{$t("prepare.buttons.audioBtn")}}</el-button>
-    	</el-col>
+        <el-button type="primary" icon="el-icon-reading" size="medium" @click="importBtn()">{{$t("prepare.buttons.importBtn")}}</el-button>
+      </el-col>
     </el-row>
 
     <el-table
@@ -213,6 +214,38 @@
 			  </el-row>
 			</template>
     </el-dialog>
+
+    <!--导入-->
+    <el-dialog
+      v-el-drag-dialog
+      :close-on-click-modal="false"
+      :close-on-press-escape="true"
+      :title='$t("prepare.buttons.importBtn")'
+      width="400px"
+      top="150px"
+      :visible.sync="importIsVisible"
+    >
+      <template>
+        <el-row>
+          <el-radio v-model="importValue" label="excel">{{$t("prepare.buttons.importExcel")}}</el-radio>
+        </el-row>
+        <el-row>
+          <el-radio v-model="importValue" label="Siemens">{{$t("prepare.buttons.importSiemens")}}</el-radio>
+        </el-row>
+        <el-row>
+          <el-radio v-model="importValue" label="Catia">{{$t("prepare.buttons.importCatia")}}</el-radio>
+        </el-row>
+        <el-row style="margin-top: 30px;text-align: center;">
+          <span  v-show="showSpanFlag" id="showSpanFlag">正在导入,请等待...</span>
+          <el-button plain type="primary" size="medium" @click="importBom">
+            {{ $t("common.confirm") }}
+          </el-button>
+          <el-button plain type="danger" size="medium" @click="colseImport">
+            {{ $t("common.cancel") }}
+          </el-button>
+        </el-row>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -232,6 +265,7 @@ export default {
   components: { Pagination, TenantEdit, TenantView },
   data () {
     return {
+      showSpanFlag:false,
     	expands: [], // 展开行的key
     	qiyongStatus: [], //状态
     	statusList: [], // 启用状态
@@ -246,6 +280,8 @@ export default {
         context: ''
       },
       audioIsVisible: false,
+      importIsVisible: false,
+      importValue:"excel",
       audioVal: '2', //默认【审核通过】
       tenantViewVisible: false,
       tableKey: 0,
@@ -345,6 +381,27 @@ export default {
       // }
     	this.audioIsVisible = true
     },
+    // 【导入零件】-按钮事件
+    importBtn(){
+      this.importIsVisible = true
+    },
+    // 【取消】导入按钮-事件
+    colseImport(){
+      this.importIsVisible = false
+    },
+    // 【确定】导入按钮-事件
+    importBom(){
+  	  this.showSpanFlag = true;
+      // 调用导入
+      bomMgrApi.importBom({}).then(response => {
+        if (response.status == 200) {
+          this.showSpanFlag = false;
+          this.importIsVisible = false
+          // 重新查询列表数据
+          this.search()
+        }
+      })
+    },
     // 【审核产品】-Table的Row操作事件
     audioBtnRow(row) {
     	// 清除所有的选择数据