From 6317d3b3cf91bad379cf72ee0bd8a595b8e24e77 Mon Sep 17 00:00:00 2001 From: Fixiaobai <fixiaobai@163.com> Date: 星期三, 06 十二月 2023 16:41:20 +0800 Subject: [PATCH] modified: src/views/warehouse/pallettransports/index.vue --- src/views/basic/part/index.vue | 95 ++++++++++++++++++++++++++++++++++++----------- 1 files changed, 73 insertions(+), 22 deletions(-) diff --git a/src/views/basic/part/index.vue b/src/views/basic/part/index.vue index 576a443..9154b53 100644 --- a/src/views/basic/part/index.vue +++ b/src/views/basic/part/index.vue @@ -25,11 +25,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 +65,15 @@ export default { data() { return { + dataRule: { + selectTime: [ + { required: true, message: '鍚屾鏃ユ湡涓嶈兘涓虹┖', trigger: 'change' } + ] + }, + dataForm: { + selectTime: null + }, + syncDateVisible: false, ajaxFun: fetchList, addOrUpdateVisible: false, multipleSelection: [], @@ -135,7 +169,7 @@ { minWidth: '120', prop: 'sunit', - label: '鍗曚綅2', + label: '閲嶉噺鍗曚綅', sort: true, isTrue: true, isSearch: true, @@ -363,17 +397,17 @@ fun: this.addOrUpdateHandle }, { - text: '鍚屾ERP', + text: '鍚屾MDM', type: 'primary', - fun: this.syncIfs, - loading: false - }, - { - text: '澶ф爣绛�', - type: 'primary', - fun: this.printLabel, + fun: () => (this.syncDateVisible = true), loading: false } + // { + // text: '澶ф爣绛�', + // type: 'primary', + // fun: this.printLabel, + // loading: false + // } ], operator: [ { @@ -628,18 +662,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 +721,13 @@ this.$message.error('璇烽�夋嫨闆朵欢') } } + }, + watch: { + syncDateVisible(newVal) { + if (!newVal) { + this.$refs.dataForm.resetFields() + } + } } } </script> -- Gitblit v1.9.3