From 7815d256ec9817bf80f552e9da26b22534144fc0 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期三, 20 十二月 2023 15:15:51 +0800
Subject: [PATCH] modified: src/views/plan/manufacturingorder/index.vue modified: vue.config.js
---
src/views/basic/part/index.vue | 149 ++++++++++++++++++++++++++++++++++---------------
1 files changed, 103 insertions(+), 46 deletions(-)
diff --git a/src/views/basic/part/index.vue b/src/views/basic/part/index.vue
index 576a443..ea71043 100644
--- a/src/views/basic/part/index.vue
+++ b/src/views/basic/part/index.vue
@@ -12,7 +12,12 @@
:ajaxFun="ajaxFun"
ref="partTable"
>
- <template #toolbar></template>
+ <template #toolbar>
+ <el-button type="primary" @click="addOrUpdateHandle"
+ v-if="permissions.basic_part_add">鏂板</el-button>
+ <el-button type="primary" @click="() => (this.syncDateVisible = true)"
+ v-if="permissions.basic_part_mdm">鍚屾MDM</el-button>
+ </template>
</ttable>
<!-- 寮圭獥, 鏂板 / 淇敼 -->
<table-form
@@ -25,11 +30,36 @@
:printLabelInfo="printLabelInfo"
/>
</basic-container>
+ <el-dialog title="閫夋嫨鍚屾鏃ユ湡" :visible.sync="syncDateVisible" width="21%">
+ <div style="display: flex;justify-content: center">
+ <el-form
+ :model="dataForm"
+ :inline="true"
+ :rules="dataRule"
+ ref="dataForm"
+ class="l-mes"
+ >
+ <el-form-item label="鏃ユ湡" prop="selectTime">
+ <el-date-picker
+ v-model="dataForm.selectTime"
+ type="datetime"
+ placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ >
+ </el-date-picker>
+ </el-form-item>
+ </el-form>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="syncDateVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="syncIfs">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
</div>
</template>
<script>
-import { fetchList, delObj, syncIfs, syncPart } from '@/api/basic/part'
+import { fetchList, delObj, syncPart } from '@/api/basic/part'
import TableForm from './part-form'
import { mapGetters } from 'vuex'
import ttable from '@/views/common/ztt-table.vue'
@@ -40,6 +70,15 @@
export default {
data() {
return {
+ dataRule: {
+ selectTime: [
+ { required: true, message: '鍚屾鏃ユ湡涓嶈兘涓虹┖', trigger: 'change' }
+ ]
+ },
+ dataForm: {
+ selectTime: null
+ },
+ syncDateVisible: false,
ajaxFun: fetchList,
addOrUpdateVisible: false,
multipleSelection: [],
@@ -59,7 +98,8 @@
multiSelect: true, //
seqNo: true,
isShowHide: true, // 鏄惁鏄剧ず鏄惧奖鎸夐挳
- isSearch: false, // 楂樼骇鏌ヨ鎸夐挳
+ isSearch: false, // 楂樼骇鏌ヨ鎸夐挳,
+ isRefresh: true, // 鏄惁鏄剧ず鍒锋柊鎸夐挳
defaultOrderBy: { column: 'id', direction: 'desc' }
},
table: {
@@ -135,7 +175,7 @@
{
minWidth: '120',
prop: 'sunit',
- label: '鍗曚綅2',
+ label: '閲嶉噺鍗曚綅',
sort: true,
isTrue: true,
isSearch: true,
@@ -156,7 +196,7 @@
searchInfoType: 'text'
},
// 涓�绾у垎绫�
- {
+ {
minWidth: '120',
prop: 'assortment',
label: '涓�绾у垎绫�',
@@ -193,7 +233,7 @@
optList: () => {
return this.getThreeLevelClassification()
}
- },
+ },
// 瑙勬牸
{
minWidth: '140',
@@ -205,7 +245,7 @@
searchInfoType: 'text'
},
// 鍨嬪彿
- {
+ /* {
minWidth: '140',
prop: 'partModel',
label: '鍨嬪彿',
@@ -267,7 +307,7 @@
optList: () => {
return this.lotTrackingIfsOptions
}
- },
+ }, */
// 鐗堟湰鍙�
{
minWidth: '140',
@@ -277,7 +317,7 @@
isTrue: true,
isSearch: true,
searchInfoType: 'text'
- },
+ }/* ,
// 璁″垝鏂规硶
{
minWidth: '140',
@@ -291,9 +331,9 @@
optList: () => {
return this.planningMethodOptions
}
- },
+ }, */
// 鍥惧彿
- {
+ /* {
minWidth: '140',
prop: 'drawingNumber',
label: '鍥惧彿',
@@ -321,9 +361,9 @@
isTrue: true,
isSearch: true,
searchInfoType: 'text'
- },
+ }, */
// 妫�楠屽憳
- {
+ /* {
minWidth: '140',
prop: 'examiner',
label: '妫�楠屽憳',
@@ -354,26 +394,15 @@
isTrue: true,
isSearch: true,
searchInfoType: 'text'
- }
+ } */
],
toolbar: [
- {
- text: '鏂板',
- type: 'primary',
- fun: this.addOrUpdateHandle
- },
- {
- text: '鍚屾ERP',
- type: 'primary',
- fun: this.syncIfs,
- loading: false
- },
- {
- text: '澶ф爣绛�',
- type: 'primary',
- fun: this.printLabel,
- loading: false
- }
+ // {
+ // text: '澶ф爣绛�',
+ // type: 'primary',
+ // fun: this.printLabel,
+ // loading: false
+ // }
],
operator: [
{
@@ -412,16 +441,19 @@
PrintLabelForm
},
created() {
+ this.uploadInfo.isShow = this.permissions.basic_part_upload
this.table.column.find((e) => e.label === 'IFS鍚敤鎵规绠$悊').isTrue = false
this.table.column.find((e) => e.label === '璁″垝鏂规硶').isTrue = false
- this.getUnitType('unit')
- this.getMaterialType('material_type')
this.getCategoryType('category')
this.getAssortmentType('assortment')
this.getPlanningMethodType('planning_method_type')
this.getThreeLevelClassificationType('three_classification_type')
- this.getMaterialAttributeType()
this.getExaminerDict('examiner_type')
+ },
+ mounted(){
+ this.getUnitType('unit')
+ this.getMaterialType('material_type')
+ this.getMaterialAttributeType()
},
computed: {
...mapGetters(['permissions'])
@@ -433,6 +465,10 @@
},
// 鏂板 / 淇敼
addOrUpdateHandle(row) {
+ if(!this.permissions.basic_part_edit && row.id!=null){
+ this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+ return
+ }
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(row == null ? null : row.id)
@@ -440,6 +476,10 @@
},
// 鍒犻櫎
deleteHandle(row) {
+ if(!this.permissions.basic_part_del){
+ this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+ return
+ }
this.$confirm('鏄惁纭闆朵欢鍚嶄负:' + row.partName, '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
@@ -628,18 +668,28 @@
// }
// },
syncIfs() {
- syncPart({})
- .then((res) => {
- const data = res.data
- if (data.code === 0) {
- this.$message.success('寮�濮嬪悓姝�')
- } else {
- this.$message.error('鍚屾ERP澶辫触')
- }
- })
- .catch((e) => {
- // this.$message.error('鍚屾ERP澶辫触:' + e)
- })
+ this.$refs.dataForm.validate((valid) => {
+ if (valid) {
+ this.syncDateVisible = false
+ this.table.toolbar.find((e) => e.text === '鍚屾MDM').loading = true
+ syncPart({ updateTime: this.dataForm.selectTime })
+ .then((res) => {
+ const data = res.data
+ if (data.code === 0) {
+ this.$message.success(data.msg)
+ } else {
+ this.$message.error('鍚屾MDM澶辫触')
+ }
+ this.getData()
+ this.table.toolbar.find(
+ (e) => e.text === '鍚屾MDM'
+ ).loading = false
+ })
+ .catch((e) => {
+ this.$message.error('鍚屾MDM澶辫触:' + e)
+ })
+ }
+ })
},
printLabel() {
if (this.multipleSelection && this.multipleSelection.length > 0) {
@@ -677,6 +727,13 @@
this.$message.error('璇烽�夋嫨闆朵欢')
}
}
+ },
+ watch: {
+ syncDateVisible(newVal) {
+ if (!newVal) {
+ this.$refs.dataForm.resetFields()
+ }
+ }
}
}
</script>
--
Gitblit v1.9.3