zouyu
2023-10-20 eadcab6a72d883a557631114b85bc19dfdbc6286
	modified:   src/api/basic/part.js
modified: src/views/basic/part/index.vue
modified: src/views/basic/part/part-form.vue
modified: src/views/plan/customerorder/index.vue
已修改4个文件
104 ■■■■ 文件已修改
src/api/basic/part.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basic/part/index.vue 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basic/part/part-form.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/customerorder/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/basic/part.js
@@ -121,7 +121,7 @@
export function syncPart(query) {
  return request({
    url: '/mes/part/syncPart',
    method: 'post',
    method: 'get',
    params: query
  })
}
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: [],
@@ -363,11 +397,11 @@
            fun: this.addOrUpdateHandle
          },
          {
            text: '同步ERP',
            text: '同步MDM',
            type: 'primary',
            fun: this.syncIfs,
            fun: () => (this.syncDateVisible = true),
            loading: false
          },
          }
          // {
          //   text: '大标签',
          //   type: 'primary',
@@ -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>
src/views/basic/part/part-form.vue
@@ -20,12 +20,12 @@
              placeholder="零件号"
              :disabled="(dataForm.id != null && dataForm.id > 0) || status"
            >
              <el-button
              <!-- <el-button
                slot="append"
                icon="el-icon-search"
                @click="openPartDialog()"
                v-show="!dataForm.id"
              ></el-button>
              ></el-button> -->
            </el-input>
          </el-form-item>
        </el-col>
@@ -36,11 +36,11 @@
              placeholder="零件名称"
              :disabled="status"
            >
              <el-button
              <!-- <el-button
                slot="append"
                icon="el-icon-search"
                @click="openPartDialog()"
              ></el-button>
              ></el-button> -->
            </el-input>
          </el-form-item>
        </el-col>
src/views/plan/customerorder/index.vue
@@ -40,8 +40,7 @@
              <el-dropdown-item
                :command="item.command"
                v-for="item in documentTagArr"
                :disabled="item.disabled"
              >
                :disabled="item.disabled">
                {{ item.label }}
              </el-dropdown-item>
            </el-dropdown-menu>
@@ -835,9 +834,9 @@
    ...mapGetters(['permissions'])
  },
  watch: {
    exportDialogVisible(newVal){
      if(!newVal){
        this.$refs['exportForm'].resetFields()
    exportDialogVisible(newVal) {
      if (!newVal) {
        this.$refs.exportForm.resetFields()
      }
    },
    coState: {
@@ -954,7 +953,7 @@
      queryParam.push(
        Object.assign({
          prop: 'coState',
          searchInfoType: 'select',
          searchInfoType: 'select'
          // propVal: '01partUnCheck'
          // propVal: '02technologyUnCheck'
        })