loulijun2021
2022-07-19 d71436544198b7b051115662fc9cf4b12ce0cda3
1.修改bug
已修改21个文件
910 ■■■■■ 文件已修改
src/api/ErpSyncMes.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/TagsView/index.vue 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/user.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/jsqd.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/wldw.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/yhqd.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/zzjg.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sbgl/sbqd.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/gd.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/scdd.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/sckbg.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wlgl/ckdy.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjybz.vue 259 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjyxm.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/qxdy.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zzmx/chda.vue 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zzmx/gxdy.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zzmx/jpgj.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/ErpSyncMes.js
@@ -7,6 +7,7 @@
    method: 'post'
  })
}
// 制造模型:存货档案同步
export function SeaveSearchInventory() {
  return request({
@@ -14,6 +15,7 @@
    method: 'post'
  })
}
// 物料管理:仓库库位同步
export function SeaveSearchWhareHouseLocation() {
  return request({
@@ -21,10 +23,26 @@
    method: 'post'
  })
}
//
// 基础设置:往来单位同步
export function SeaveSearchPartner() {
  return request({
    url: 'ErpSyncMes/SeaveSearchPartner',
    method: 'post'
  })
}
// 生产管理:生产订单同步
export function SeaveSearchErpOrder() {
  return request({
    url: 'ErpSyncMes/SeaveSearchErpOrder',
    method: 'post'
  })
}
// 制造模型:单位同步
export function SeaveSearchUnit() {
  return request({
    url: 'ErpSyncMes/SeaveSearchUnit',
    method: 'post'
  })
}
src/layout/components/Navbar.vue
@@ -89,7 +89,7 @@
  },
  created() {
    this.usercode = getCookie('navTabId')
    this.username = getCookie('admin')
    this.username = getCookie('username')
  },
  data() {
    const validatePassword = (rule, value, callback) => {
src/layout/components/TagsView/index.vue
@@ -22,6 +22,23 @@
      <li @click="closeOthersTags">关闭其他</li>
      <li @click="closeAllTags(selectedTag)">关闭所有</li>
    </ul>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="500px"
      :close-on-click-modal="false"
    >
      <div>
        现页签打开超过10个,请关闭其它标签
      </div>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">返回</el-button>
        </div>
      </span>
    </el-dialog>
  </div>
</template>
@@ -39,11 +56,16 @@
      top: 0,
      left: 0,
      selectedTag: {},
      affixTags: []
      affixTags: [],
      dialogVisible: false
    }
  },
  computed: {
    visitedViews() {
      if (this.$store.state.tagsView.visitedViews.length > 10) {
        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
        this.dialogVisible = true
      }
      return this.$store.state.tagsView.visitedViews
    },
    routes() {
@@ -95,16 +117,22 @@
        this.$store.state.tagsView.visitedViews = oldViews
      }
    },
    // 对话框返回
    dialogVisibleCancel() {
      this.dialogVisible = false
    },
    isActive(route) {
      if (this.$route.path === '/scgl/sckbg') {
        const time = setInterval(() => {
          this.$nextTick(() => {
            $("input[name='produceCode']")[0].focus()
            $("input[name='WXproduceCode']")[0].focus()
            clearInterval(time)
          })
        })
      }
      // if (this.$route.path === '/scgl/sckbg') {
      //   const time = setInterval(() => {
      //     this.$nextTick(() => {
      //       $("input[name='produceCode']")[0].focus()
      //       $("input[name='WXproduceCode']")[0].focus()
      //       clearInterval(time)
      //     })
      //   })
      // }
      return route.path === this.$route.path
    },
    isAffix(tag) {
src/router/index.js
@@ -444,14 +444,14 @@
      },
      {
        path: 'gxjybz',
        name: '',
        name: 'QXJYBZCancel',
        code: '1085',
        component: () => import('@/views/zlgl/gxjybz'),
        meta: { code: '1085', title: '工序检验标准', icon: '', keepAlive: true }
      },
      {
        path: 'gxjyxm',
        name: '',
        name: 'GXJYXMCancel',
        code: '1086',
        component: () => import('@/views/zlgl/gxjyxm'),
        meta: { code: '1086', title: '工序检验项目', icon: '', keepAlive: true }
src/store/modules/user.js
@@ -39,7 +39,8 @@
      // login({ UserName: '001', PassWord: 123, HOrgName: 1 }).then(response => {
        const { data: res } = response
        setCookie('admin', res.username)
        setCookie('username', res.username)
        setCookie('admin', res.usercode)
        setCookie('navTabId', res.usercode)
        setCookie('usertype', res.usertype)
        setCookie('userid', res.userid)
@@ -108,6 +109,7 @@
          removeToken() // must remove  token  first
          resetRouter()
          removeCookie('username')
          removeCookie('admin')
          removeCookie('navTabId')
          removeCookie('usertype')
src/views/jcsz/jsqd.vue
@@ -989,6 +989,8 @@
          } else {
            if (item.children.length > 0 && item.children) {
              item.children.forEach((it, ind) => {
                console.log(it, 9)
                console.log(it.is_delete, 9)
                if (it.is_delete === '1') {
                  item.children.splice(ind, 1)
                }
src/views/jcsz/wldw.vue
@@ -39,6 +39,12 @@
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
          @click="syncSeaveSearchPartner"
        >同步往来单位
        </el-button>
        <!--        <el-button type="primary" icon="el-icon-upload2">导入</el-button>-->
      </div>
      <el-divider />
@@ -207,6 +213,7 @@
import {
  AddUpdateCurrentUnit, CurrentUnitSearch, DeleteCurrentUnit
} from '@/api/jcsz'
import { SeaveSearchPartner, SeaveSearchWhareHouseLocation } from '@/api/ErpSyncMes'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -323,6 +330,29 @@
      this.tableData = res.data
      this.total = res.count
    },
    // 同步往来单位
    async syncSeaveSearchPartner() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步往来单位,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      const res = await SeaveSearchPartner()
      if (res.code === '200') {
        setTimeout(() => {
          this.getCurrentUnitSearch()
          loading.close()
          this.$message.success('同步成功!')
        }, 2000)
      } else {
        setTimeout(() => {
          loading.close()
          this.$message.error('同步失败!')
        }, 10000)
      }
    },
    // 排序改变时
    sortChange({ column, prop, order }) {
      if (order === 'descending') {
src/views/jcsz/yhqd.vue
@@ -567,7 +567,7 @@
        UserCode: '',
        UserName: '',
        Password: '',
        Enable: '',
        Enable: 'Y',
        StuOrg: '',
        Mobile: '',
        Email: '',
@@ -689,7 +689,7 @@
      this.form.UserCode = ''
      this.form.UserName = ''
      this.form.StuOrg = ''
      this.form.Enable = ''
      this.form.Enable = 'Y'
      this.form.wagetype = ''
      this.$refs.cascader.checkedValue = ''// 级联选择器的清空
      this.getUserSearch()
@@ -758,7 +758,7 @@
      this.dialogForm.UserCode = ''
      this.dialogForm.UserName = ''
      this.dialogForm.Password = ''
      this.dialogForm.Enable = ''
      this.dialogForm.Enable = 'Y'
      this.$refs.dialogCascader.checkedValue = ''
      this.dialogForm.StuOrg = ''
      this.dialogForm.Mobile = ''
src/views/jcsz/zzjg.vue
@@ -144,6 +144,7 @@
        <el-form-item label="组织类型" prop="OrgType">
          <el-radio-group
            v-model="dialogForm.OrgType"
            :disabled="operation==='edit'"
            @change="changeRadio"
          >
            <el-radio
@@ -160,8 +161,7 @@
        <el-form-item label="组织名称" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 200px" />
        </el-form-item>
        <!--        <el-form-item v-if="dialogFormOrgTypeSelected!=='F'" prop="SupUnit" label="上级单位">-->
        <el-form-item v-if="dialogFormOrgTypeSelected!=='D'" prop="SupUnit" label="上级单位">
        <el-form-item v-if="dialogForm.OrgType!=='部门'" prop="SupUnit" label="上级单位">
          <el-select
            v-model="dialogForm.SupUnit"
            style="width: 200px"
@@ -247,13 +247,12 @@
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        OrgType: '',
        OrgType: '部门',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// 上级单位
      },
      SupUnitArr: [],
      dialogFormOrgTypeSelected: '',
      operation: '',
      dialogFormRules: {
        OrgType: [
@@ -338,19 +337,8 @@
    },
    // 单选框改变时
    async changeRadio(val) {
      if (val.length > 1) {
        this.OrgTypeArr.forEach(item => {
          if (item.label === val) {
            this.dialogFormOrgTypeSelected = item.value
          }
        })
        this.dialogForm.SupUnit = ''
      } else {
        this.dialogFormOrgTypeSelected = val
      }
      // if (this.dialogFormOrgTypeSelected !== 'F') {
      if (this.dialogFormOrgTypeSelected !== 'D') {
        const { data: res } = await PrentOrganization({ orgcode: this.dialogFormOrgTypeSelected })
      if (this.dialogForm.OrgType !== '部门') {
        const { data: res } = await PrentOrganization({ orgcode: this.OrgTypeArr.find(item => item.label === this.dialogForm.OrgType).value })
        this.SupUnitArr = res
      }
    },
@@ -407,7 +395,7 @@
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgType = '部门'
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
@@ -422,18 +410,18 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            OrganType: this.dialogFormOrgTypeSelected,
            OrganType: this.dialogForm.OrgType === '部门' ? 'D' : 'W',
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            RightCode: '',
            numvalue: '',
            // RightCode: this.operation === 'add' ? getCookie('ruleCode') : '',
            // numvalue: this.operation === 'add' ? this.numvalue : '',
            // SupUnit: this.dialogFormOrgTypeSelected === 'F' ? '0' : this.dialogForm.SupUnit,
            SupUnit: this.dialogFormOrgTypeSelected === 'D' ? '0' : this.dialogForm.SupUnit,
            SupUnit: this.dialogForm.OrgType === '部门' ? '0' : this.dialogForm.SupUnit,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
          }
          AddUpdateOrganization(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
src/views/login/index.vue
@@ -61,7 +61,7 @@
          <el-input
            ref="username"
            v-model="loginForm.username"
            placeholder="请输入用户名"
            placeholder="请输入用户编码"
            name="username"
            type="text"
            tabindex="1"
@@ -84,7 +84,7 @@
            ref="password"
            v-model="loginForm.password"
            :type="passwordType"
            placeholder="请输入密码"
            placeholder="请输入用户密码"
            name="password"
            tabindex="2"
            style="width: 100%;"
@@ -134,7 +134,7 @@
      // const mPattern = /^\w+$/ // 正则 等价于[A-Za-z0-9_]
      if (value.length < 1) {
        callback(new Error('账号不能为空!'))
        callback(new Error('用户编码不能为空!'))
      } else {
        callback()
      }
@@ -148,15 +148,15 @@
    }
    const validatePassword = (rule, value, callback) => {
      if (value.length < 1) {
        callback(new Error('密码长度不能为空!'))
        callback(new Error('用户密码不能为空!'))
      } else {
        callback()
      }
    }
    return {
      loginForm: {
        username: 'Admin', // Admin
        password: '123456'// 123456
        username: '', // Admin
        password: ''// 123456
      },
      loginRules: {
        username: [{ required: true, trigger: ['blur', 'change'], validator: validateUsername }],
src/views/sbgl/sbqd.vue
@@ -609,7 +609,7 @@
        devicename: '',
        devicetypecode: '',
        devicegroupcode: '',
        importdate: '',
        importdate: handleDatetime(new Date()),
        workshopcode: '',
        linecode: '',
        status: 'Y',
@@ -781,7 +781,7 @@
      this.dialogForm.devicename = ''
      this.dialogForm.devicetypecode = ''
      this.dialogForm.devicegroupcode = ''
      this.dialogForm.importdate = ''
      this.dialogForm.importdate = handleDatetime(new Date())
      this.dialogForm.workshopcode = ''
      // this.dialogForm.linecode = ''
      this.dialogForm.status = 'Y'
src/views/scgl/gd.vue
@@ -30,7 +30,6 @@
            <el-form-item label="订单编号" style=" display: flex;">
              <el-input v-model="form.mesordercode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="产品编码" style=" display: flex;">
              <!--              <el-select v-model="form.partcode" :popper-append-to-body="false" style="width: 200px" placeholder="请选择">-->
              <!--                <el-option-->
@@ -422,7 +421,7 @@
      <!--        工艺路线放大镜对话框-->
      <el-dialog
        title="工序"
        title="工艺路线"
        :visible.sync="dialogVisibleSearch"
        width="840px"
        top="20vh"
@@ -786,6 +785,7 @@
    // 产品信息值改变
    async partcodeChange(val) {
      console.log(val, 22)
      const { data: res } = await PartSelectRoute({ partcode: val })
      this.routeArr = res
@@ -793,6 +793,7 @@
      this.routeArr.forEach(item => {
        if (item.code === item.default_route) {
          this.dialogForm.routecode = item.code
          this.routecodeChange(this.dialogForm.routecode)
          flag = true
        }
      })
@@ -843,6 +844,7 @@
        this.dialogForm.partname = row.partname
        this.dialogForm.mesqty = row.plan_qty
        this.dialogForm.partspec = row.partspec
        // this.routecodeChange(this.dialogForm.routecode)
        this.dialogForm.planstartdate = row.plan_startdate !== null ? row.plan_startdate : handleDatetime(new Date())
        this.dialogForm.planenddate = row.plan_enddate !== null ? row.plan_enddate : handleDatetime(new Date())
src/views/scgl/scdd.vue
@@ -29,7 +29,6 @@
            <el-form-item label="订单编号" style=" display: flex;">
              <el-input v-model="form.erpordercode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="产品编码" style=" display: flex;">
              <el-input v-model="form.partcode" style="width: 200px" placeholder="请输入" />
            </el-form-item>
@@ -39,9 +38,13 @@
            <el-form-item label="产品规格" style=" display: flex;">
              <el-input v-model="form.partspec" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="交付时间" style=" display: flex;">
            <el-form-item label="创建人员" style=" display: flex;">
              <el-input v-model="form.creatuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="预计开工时间" label-width="100px" style=" display: flex;">
              <el-date-picker
                v-model="form.paydate"
                v-model="form.paystartdate"
                type="daterange"
                range-separator="~"
                size="mini"
@@ -53,12 +56,9 @@
              <!--              :picker-options="expireTimeOption"-->
            </el-form-item>
            <el-form-item label="创建人员" style=" display: flex;">
              <el-input v-model="form.creatuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="创建时间" style=" display: flex;">
            <el-form-item label="预计完工时间" label-width="100px" style=" display: flex;">
              <el-date-picker
                v-model="form.createdate"
                v-model="form.payenddate"
                type="daterange"
                :clearable="false"
                range-separator="~"
@@ -174,8 +174,8 @@
          >
            <template slot-scope="{row}">
              <div v-if="row.status==='NEW'">新订单</div>
              <div v-if="row.status==='CREATING'">创建中</div>
              <div v-if="row.status==='CREATED'">已创建</div>
              <div v-if="row.status==='CREATING'">部分下达</div>
              <div v-if="row.status==='CREATED'">全部下达</div>
              <div v-if="row.status==='CLOSED'">已关闭</div>
            </template>
          </el-table-column>
@@ -222,8 +222,14 @@
            width="150"
          />
          <el-table-column
            prop="paydate"
            label="要求交付时间"
            prop="planstartdate"
            label="预计开工时间"
            sortable="custom"
            width="160"
          />
          <el-table-column
            prop="planenddate"
            label="预计完工时间"
            sortable="custom"
            width="160"
          />
@@ -360,6 +366,7 @@
import Pagination from '@/components/Pagination'
import { ClosedErpOrder, ErpOrderSearch, MarkSaveErpOrder } from '@/api/scgl'
import { handleDatatime, handleDatetime } from '@/utils/global'
import { SeaveSearchErpOrder } from '@/api/ErpSyncMes'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -389,8 +396,10 @@
        partcode: '', // 产品编码
        partname: '', // 产品名称
        partspec: '', // 产品规格
        paydate: '', // 交付时间
        creatuser: '', // 创建人员
        // paystartdate: '', // 交付时间
        paystartdate: '', // 预计开工时间
        payenddate: '', // 预计完工时间
        createdate: '', // 创建时间
        prop: 'createdate', // 排序字段
        order: 'desc', // 排序字段
@@ -399,8 +408,8 @@
      },
      erporderstusArr: [
        { code: 'NEW', name: '新订单' },
        { code: 'CREATING', name: '创建中' },
        { code: 'CREATED', name: '已创建' },
        { code: 'CREATING', name: '部分下达' },
        { code: 'CREATED', name: '全部下达' },
        { code: 'CLOSED', name: '已关闭' }
      ],
      total: 10,
@@ -410,7 +419,7 @@
      dialogForm: {
        partname: '', // 产品名称
        partspec: '', // 产品规格
        paydate: '', // 交付时间
        // paystartdate: '', // 预计开工时间
        wkshopname: '', // 车间名称
        warehousename: '', // 仓库名称
@@ -460,12 +469,12 @@
  methods: {
    async getErpOrderSearch() {
      console.log(this.form, 1)
      let tempDate2 = this.form.paydate
      let tempDate2 = this.form.paystartdate
      if (tempDate2.length > 0) {
        tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      }
      let tempDate = this.form.createdate
      let tempDate = this.form.payenddate
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
@@ -476,10 +485,11 @@
        partcode: this.form.partcode, // 产品编码
        partname: this.form.partname, // 产品名称
        partspec: this.form.partspec, // 产品规格
        paydate: tempDate2, // 交付时间
        paystartdate: tempDate2, // 交付时间
        payenddate: tempDate, // 交付时间
        creatuser: this.form.creatuser, // 创建人员
        // createdate: this.form.createdate.toString().length > 0 ? handleDatetime(this.form.createdate) : '', // 创建时间
        createdate: tempDate,
        prop: this.form.prop, // 排序字段
        order: this.form.order, // 排序字段
        page: this.form.page, // 第几页
@@ -505,7 +515,7 @@
      this.getErpOrderSearch()
    },
    // 同步ERP
    async  syncERP() {
    syncERP() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步ERP,请稍等...',
@@ -513,17 +523,23 @@
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      setTimeout(() => {
        loading.close()
      }, 2000)
      // const res = await xxx()
      // if (res.code==='200'){
      setTimeout(() => {
        loading.close()
        this.getErpOrderSearch()
      }, 2000)
      // }
      SeaveSearchErpOrder().then(res => {
        console.log(res, 11)
        if (res.code === '200') {
          setTimeout(() => {
            this.getErpOrderSearch()
            loading.close()
            this.$message.success('同步成功!')
          }, 2000)
        }
        // else if (res.code === '300') {
        //   setTimeout(() => {
        //     loading.close()
        //     this.$message.error('同步失败!')
        //   }, 10000)
        // }
      })
    },
    // 查询
    search() {
@@ -536,7 +552,8 @@
      this.form.partcode = ''
      this.form.partname = ''
      this.form.partspec = ''
      this.form.paydate = ''
      this.form.paystartdate = ''
      this.form.payenddate = ''
      this.form.creatuser = ''
      this.form.createdate = ''
      this.getErpOrderSearch()
src/views/scgl/sckbg.vue
@@ -7,9 +7,10 @@
          <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between">
            <div style="display: flex;align-items: center">
              <div style="width: 90px">扫描条码:</div>
              <!--              oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"-->
              <el-input
                v-model="form.orderstepqrcode"
                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
                name="produceCode"
                style="width: 300px"
                @keyup.enter.native="val=>enterNative(val,'produceCode')"
@@ -166,7 +167,6 @@
              <div style="width: 90px;margin-left: 20px">扫描条码:</div>
              <el-input
                v-model="WXform.orderstepqrcode"
                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
                name="WXproduceCode"
                style="width: 300px"
                @keyup.enter.native="val=>enterNative(val,'WXproduceCode')"
@@ -312,7 +312,6 @@
              <div style="width: 90px">扫描条码:</div>
              <el-input
                v-model="GXform.orderstepqrcode"
                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
                name="GXproduceCode"
                style="width: 300px"
                @keyup.enter.native="val=>enterNative(val,'GXproduceCode')"
@@ -552,6 +551,7 @@
        <!--自制开始-->
        <el-form-item v-if="dialogTitle==='自制开始'" label="开工数量:">
          <div style="width: 200px">{{ dialogForm.startqty }}</div>
          <!--          <div style="width: 200px">{{  dialogForm.noreportqty }}</div>-->
        </el-form-item>
        <el-form-item v-if="dialogTitle==='自制开始'" prop="eqpcode" label="生产设备:">
          <el-select
@@ -602,6 +602,7 @@
        </el-form-item>
        <el-form-item v-if="dialogTitle==='自制报工'" label="报工数量:" prop="startqty">
          <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />
          <!--          <el-input v-model="dialogForm.noreportqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />-->
        </el-form-item>
        <el-form-item v-if="dialogTitle==='自制报工'" label="不良数量:">
          <el-input v-model="dialogForm.noputqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />
@@ -1155,7 +1156,8 @@
        this.dialogForm.planqty = obj.planqty
        this.dialogForm.reportqty = obj.reportqty
        this.dialogForm.noreportqty = obj.noreportqty
        this.dialogForm.startqty = obj.startqty
        // this.dialogForm.startqty = obj.startqty
        this.dialogForm.startqty = obj.noreportqty
      })
      await this.getMesOrderStepStartSelectEqp()
@@ -1181,7 +1183,8 @@
        this.dialogForm.reportqty = obj.reportqty
        this.dialogForm.noputqty = obj.noputqty
        this.dialogForm.noreportqty = obj.noreportqty
        this.dialogForm.startqty = obj.startqty
        // this.dialogForm.startqty = obj.startqty
        this.dialogForm.startqty = obj.noreportqty
        if (obj.nextstepname === null || obj.nextstepcode === '') {
          this.dialogForm.nextstepname = obj.stepname
@@ -1189,7 +1192,7 @@
          this.dialogForm.nextstepname = obj.nextstepname
        }
        this.dialogForm.startqtySum = obj.startqty
        this.dialogForm.startqtySum = obj.noreportqty
      })
      await this.getMesOrderStepStartSelectEqp()
@@ -1607,8 +1610,8 @@
      //   item.isVisible = 0
      // })
      let number = Math.random() * Math.random()// 作为删除时的标识符
      number = number === 0 ? (10 + Math.random()) : number
      // let number = Math.random() * Math.random()// 作为删除时的标识符
      // number = number === 0 ? (10 + Math.random()) : number
      // const data = { group_code: '', group_name: '', description: '', isVisible: 1, number: number }
      // this.JYTableData.unshift(data)
src/views/wlgl/ckdy.vue
@@ -32,6 +32,12 @@
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
          @click="syncSeaveSearchWhareHouseLocation"
        >同步仓库/库位
        </el-button>
        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>-->
      </div>
      <el-divider />
@@ -139,6 +145,7 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateWareHouseDef, DeleteWareHouseDef, WareHouseDefSearch } from '@/api/wlgl'
import { SeaveSearchInventoryClass, SeaveSearchWhareHouseLocation } from '@/api/ErpSyncMes'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -207,6 +214,29 @@
      this.tableData = res.data
      this.total = res.count
    },
    // 同步仓库/库位
    async syncSeaveSearchWhareHouseLocation() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步仓库/库位,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      const res = await SeaveSearchWhareHouseLocation()
      if (res.code === '200') {
        setTimeout(() => {
          this.getWareHouseDefSearch()
          loading.close()
          this.$message.success('同步成功!')
        }, 2000)
      } else {
        setTimeout(() => {
          loading.close()
          this.$message.error('同步失败!')
        }, 10000)
      }
    },
    // 排序改变时
    sortChange({ column, prop, order }) {
      if (order === 'descending') {
src/views/zlgl/gxjybz.vue
@@ -54,17 +54,17 @@
            label="序号"
          />
          <el-table-column
            prop="org_code"
            prop="code"
            label="标准代码"
            sortable="custom"
          />
          <el-table-column
            prop="org_name"
            prop="name"
            label="标准名称"
            sortable="custom"
          />
          <el-table-column
            prop="description"
            prop="descr"
            label="标准描述"
            sortable="custom"
          />
@@ -116,14 +116,14 @@
        <i class="el-icon-s-comment" style="color:#42b983;" /> 标准信息:
      </div>
      <el-form ref="dialogForm" style="margin-left: 80px" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="标准编码" prop="OrgCode">
          <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 200px" />
        <el-form-item label="标准编码" prop="code">
          <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="标准名称" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 200px" />
        <el-form-item label="标准名称" prop="name">
          <el-input v-model="dialogForm.name" style="width: 200px" />
        </el-form-item>
        <el-form-item label="描述">
          <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
          <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" />
        </el-form-item>
      </el-form>
      <div style="margin-bottom: 10px">
@@ -145,26 +145,64 @@
          @sort-change="sortChange"
        >
          <el-table-column
            prop="RowNum"
            label="序号"
            type="index"
            width="100"
          />
          <el-table-column
            prop="mc"
            label="检验标准名称"
            prop="code"
            label="检验标准编码"
          >
            <template slot-scope="{row}">
              <div v-if="row.isVisible===0">{{ row.mc }}</div>
              <el-input v-if="row.isVisible===1" v-model="row.mc" />
              <div v-if="row.isVisible===0">{{ row.code }}</div>
              <el-select
                v-if="row.isVisible===1"
                v-model="row.code"
                filterable
                :popper-append-to-body="false"
                style="width: 200px;"
                placeholder="请选择"
                @change="val=>changeCode(val,row)"
              >
                <el-option
                  v-for="item in JYSelectArr"
                  :key="item.code"
                  :label="item.code"
                  :value="item.code"
                />
              </el-select>
            </template>
          </el-table-column>
          <el-table-column
            prop="ms"
            prop="name"
            label="检验标准名称"
          >
            <template slot-scope="{row}">
              <div v-if="row.isVisible===0">{{ row.name }}</div>
              <el-select
                v-if="row.isVisible===1"
                v-model="row.name"
                filterable
                :popper-append-to-body="false"
                style="width: 200px;"
                placeholder="请选择"
                @change="val=>changeName(val,row)"
              >
                <el-option
                  v-for="item in JYSelectArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </template>
          </el-table-column>
          <el-table-column
            prop="descr"
            label="检验描述描述"
          >
            <template slot-scope="{row}">
              <div v-if="row.isVisible===0">{{ row.ms }}</div>
              <el-input v-if="row.isVisible===1" v-model="row.ms" />
              <div v-if="row.isVisible===0">{{ row.descr }}</div>
              <el-input v-if="row.isVisible===1" v-model="row.descr" />
            </template>
          </el-table-column>
          <el-table-column
@@ -174,29 +212,18 @@
              <div class="operationClass">
                <el-button v-if="row.isVisible===0" type="text" @click="JYedit(row)">编辑</el-button>
                <el-button v-if="row.isVisible===0" type="text" @click="JYdel(row)">删除</el-button>
                <el-button v-if="row.isVisible===1" type="text" @click="JYsave(row)">保存</el-button>
                <el-button v-if="row.isVisible===1" type="text" @click="Jycancel(row)">取消</el-button>
                <el-button v-if="row.isVisible===1" type="text" @click="JYsave(row)">确定</el-button>
                <el-button v-if="row.isVisible===1" type="text" @click="JYcancel(row)">取消</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!--分页-->
      <!--      <pagination-->
      <!--        v-show="JYtotal>0"-->
      <!--        :total="JYtotal"-->
      <!--        :page.sync="JYfrom.page"-->
      <!--        :limit.sync="JYfrom.rows"-->
      <!--        align="right"-->
      <!--        layout="prev, pager, next,sizes"-->
      <!--        popper-class="select_bottom"-->
      <!--        @pagination="getStepCheckItemSelect"-->
      <!--      />-->
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">取 消</el-button>
          <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button>
          <el-button type="primary" @click="dialogVisibleConfirm">提 交</el-button>
        </div>
      </span>
    </el-dialog>
@@ -207,7 +234,7 @@
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { StepCheckStanedSearch } from '@/api/zlgl'
import { AddUpdateStepCheckStaned, StepCheckItemSelect, StepCheckStanedSearch } from '@/api/zlgl'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -246,46 +273,28 @@
        page: 1, // 第几页
        rows: 20 // 每页多少条
      },
      OrgTypeArr: [
        { label: '工厂', value: 'F' },
        { label: '部门', value: 'D' },
        { label: '车间', value: 'W' },
        { label: '科室', value: 'K' },
        { label: '生产线', value: 'L' }
      ],
      total: 10,
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        OrgType: '',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// 上级单位
        code: '', // 工序检验标准编码
        name: '', // 工序检验标准名称
        enable: '', // 传空值
        description: '' // 工序检验标准描述
      },
      operation: '',
      dialogFormRules: {
        OrgType: [
          { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] }
        ],
        OrgCode: [
        code: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
        ],
        OrgName: [
        name: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        ],
        SupUnit: [
          { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
        ]
      },
      JYTableData: [
        { RowNum: 1, mc: 'xxx1', ms: 'aaaa' }
      ], // 对话框检验信息表格
      JYfrom: {
        page: 1,
        rows: 10
      },
      JYtotal: 10
      JYTableData: [], // 对话框检验信息表格
      JYSelectArr: [], // 检验项目下拉数组
      JYSelectedArr: [] // 已选检验项目数组
      // JYAddFlag: true // 是否可进行添加
    }
  },
  created() {
@@ -324,10 +333,9 @@
    },
    // 重置
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.form.stanedcode = ''
      this.form.stanedname = ''
      this.form.staneddescr = ''
      this.getStepCheckStanedSearch()
    },
@@ -342,9 +350,9 @@
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.OrgCode = row.org_code
        this.dialogForm.OrgName = row.org_name
        this.dialogForm.SupUnit = row.parent_id
        this.dialogForm.OrgCode = row.code
        this.dialogForm.OrgName = row.name
        this.dialogForm.SupUnit = row.descr
      })
    },
    // 查看
@@ -371,10 +379,12 @@
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.dialogForm.code = ''
      this.dialogForm.name = ''
      this.dialogForm.enable = ''
      this.dialogForm.description = ''
      this.JYTableData = []
      this.JYSelectedArr = []
      this.$refs.dialogForm.clearValidate()
    },
    // 对话框取消
@@ -383,15 +393,25 @@
    },
    // 对话框确认
    dialogVisibleConfirm() {
      console.log(this.JYSelectedArr.map(i => i))
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const tableData = []
          this.JYTableData.forEach((item, index) => {
            tableData.push({
              STEPCHECKITEM_SEQ: (index + 1),
              STEPCHECKITEM_CODE: item.code,
              STEPCHECKITEM_DESC: item.descr
            })
          })
          const data = {
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
            code: this.dialogForm.code,
            name: this.dialogForm.name,
            description: this.dialogForm.description,
            enable: '',
            Data: tableData
          }
          AddUpdateOrganization(data).then(res => {
          AddUpdateStepCheckStaned(this.operation === 'add' ? 'Add' : 'Update', data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
@@ -410,25 +430,42 @@
        this.tableHeight = this.mainHeight - 100
      })
    },
    //  获取检验项信息表
    getStepCheckItemSelect() {
      // let number = Math.random() * Math.random()// 作为删除时的标识符
      // number = number === 0 ? (10 + Math.random()) : number
      this.JYTableData.forEach(item => {
        item.isVisible = 0
      })
    // 获取检验项目下拉列表
    async  getStepCheckItemSelect() {
      const { data: res } = await StepCheckItemSelect()
      this.JYSelectArr = res
    },
    // 检验标准编码值改变
    changeCode(val, row) {
      console.log(this.JYSelectedArr.map(i => i))
      row.name = this.JYSelectArr.find(it => it.code === val).name
      row.descr = this.JYSelectArr.find(it => it.code === val).descr
    },
    // 检验标准名称值改变
    changeName(val, row) {
      row.code = this.JYSelectArr.find(it => it.code === val).code
      row.descr = this.JYSelectArr.find(it => it.code === val).descr
    },
    // 检验新增
    JYadd() {
      if (this.JYTableData.length > 0 && this.JYTableData[this.JYTableData.length - 1].isVisible === 1) {
        return this.$message.info('请先确定或取消本条记录!')
      }
      let number = Math.random() * Math.random()// 作为删除时的标识符
      number = number === 0 ? (10 + Math.random()) : number
      const data = { mc: '', ms: '', isVisible: 1, number }
      this.JYTableData.unshift(data)
      const data = { code: '', name: '', descr: '', isVisible: 1, number }
      this.JYTableData.push(data)
    },
    JYedit(row) {
      this.JYSelectedArr.forEach((item, index) => {
        if (item === row.code) {
          this.JYSelectedArr.splice(index, 1)
        }
      })
      this.JYTableData.forEach((item, index) => {
        if (item.mc === row.mc) {
        if (item.code === row.code) {
          item.isVisible = 1
        }
      })
@@ -439,18 +476,48 @@
          this.JYTableData.splice(index, 1)
        }
      })
    },
    JYsave(row) {
      this.JYTableData.forEach(item => {
        if (item.number === row.number) {
          item.isVisible = 0
      this.JYSelectedArr.forEach((item, index) => {
        if (item === row.code) {
          this.JYSelectedArr.splice(index, 1)
        }
      })
    },
    Jycancel(row) {
    JYsave(row) {
      if (row.code === '') {
        return this.$message.info('检验标准代码不能为空!')
      }
      if (row.name === '') {
        return this.$message.info('检验标准名称不能为空!')
      }
      if (this.JYSelectedArr.find(item => item === row.code) !== undefined) {
        return this.$message.info('检验标准代码不能重复!')
      } else {
        this.JYSelectedArr.push(row.code)
      }
      // if (row.code === this.JYTableData.find(item => item.code).code) {
      //   return this.$message.info('检验标准代码不能重复!')
      // }
      this.JYTableData.forEach((item, index) => {
        if (item.number === row.number) {
          item.isVisible = 0
          this.JYTableData.splice(index, 1, { number: row.number, code: row.code, name: row.name, isVisible: 0, descr: row.descr })
        }
      })
      console.log(this.JYTableData, 898989)
    },
    JYcancel(row) {
      this.JYTableData.forEach((item, index) => {
        if (item.number === row.number) {
          this.JYTableData.splice(index, 1)
        }
      })
      this.JYSelectedArr.forEach((item, index) => {
        if (item === row.code) {
          this.JYSelectedArr.splice(index, 1)
        }
      })
    }
@@ -621,4 +688,10 @@
  border-color: $main_color;
}
::v-deep .el-select__caret{
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
src/views/zlgl/gxjyxm.vue
@@ -11,12 +11,11 @@
        >
          <div class="elForm">
            <el-form-item label="项目编码" style=" display: flex;">
              <el-input v-model="form.defectcode" placeholder="请输入" style="width: 200px" />
              <el-input v-model="form.itemcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="项目名称" style=" display: flex;">
              <el-input v-model="form.itemname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="项目描述" style=" display: flex;">
              <el-input v-model="form.itemdescr" style="width: 200px" placeholder="请输入" />
            </el-form-item>
@@ -55,31 +54,18 @@
            label="序号"
          />
          <el-table-column
            prop="org_code"
            label="组织编码"
            prop="code"
            label="项目代码"
            sortable="custom"
          />
          <el-table-column
            prop="org_name"
            label="组织名称"
            prop="name"
            label="项目名称"
            sortable="custom"
          />
          <el-table-column
            prop="description"
            label="组织类型"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.description==='F'">工厂</div>
              <div v-if="row.description==='D'">部门</div>
              <div v-if="row.description==='W'">车间</div>
              <div v-if="row.description==='K'">科室</div>
              <div v-if="row.description==='L'">生产线</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="parentorg_name"
            label="上级单位"
            prop="descr"
            label="项目描述"
            sortable="custom"
          />
          <el-table-column
@@ -126,14 +112,14 @@
      @close="handleClose"
    >
      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="项目类型" prop="OrgCode">
          <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 200px" />
        <el-form-item label="项目编码" prop="checkitemcode">
          <el-input v-model="dialogForm.checkitemcode" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="项目名称" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 200px" />
        <el-form-item label="项目名称" prop="checkitemname">
          <el-input v-model="dialogForm.checkitemname" style="width: 200px" />
        </el-form-item>
        <el-form-item label="项目描述" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
        <el-form-item label="项目描述" prop="checkitemdescr">
          <el-input v-model="dialogForm.checkitemdescr" type="textarea" style="width: 200px" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
@@ -150,7 +136,7 @@
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { DedectSearch } from '@/api/zlgl'
import { AddUpdateStepCheckItem, DedectSearch, DeleteStepCheckItem, StepCheckItemSearch } from '@/api/zlgl'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -182,37 +168,23 @@
        page: 1, // 第几页
        rows: 20 // 每页多少条
      },
      OrgTypeArr: [
        { label: '工厂', value: 'F' },
        { label: '部门', value: 'D' },
        { label: '车间', value: 'W' },
        { label: '科室', value: 'K' },
        { label: '生产线', value: 'L' }
      ],
      total: 10,
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        OrgType: '',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// 上级单位
        checkitemcode: '', // 工序检验项目编码
        checkitemname: '', // 工序检验项目名称
        checkitemdescr: '' // 工序检验项目描述
      },
      operation: '',
      dialogFormRules: {
        OrgType: [
          { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] }
        ],
        OrgCode: [
        checkitemcode: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
        ],
        OrgName: [
        checkitemname: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        ]
      }
    }
  },
  created() {
@@ -250,10 +222,9 @@
    },
    // 重置
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.form.itemcode = ''
      this.form.itemname = ''
      this.form.itemdescr = ''
      this.getStepCheckItemSearch()
    },
@@ -268,9 +239,9 @@
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.OrgCode = row.org_code
        this.dialogForm.OrgName = row.org_name
        this.dialogForm.SupUnit = row.parent_id
        this.dialogForm.checkitemcode = row.code
        this.dialogForm.checkitemname = row.name
        this.dialogForm.checkitemdescr = row.descr
      })
    },
    // 删除按钮
@@ -280,7 +251,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteOrganization({ orgid: row.code }).then(res => {
        DeleteStepCheckItem({ checkitemcode: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getStepCheckItemSearch()
@@ -292,10 +263,9 @@
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.dialogForm.checkitemcode = ''
      this.dialogForm.checkitemname = ''
      this.dialogForm.checkitemdescr = ''
      this.$refs.dialogForm.clearValidate()
    },
    // 对话框取消
@@ -307,12 +277,12 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
            checkitemcode: this.dialogForm.checkitemcode,
            checkitemname: this.dialogForm.checkitemname,
            checkitemdescr: this.dialogForm.checkitemdescr,
            OperType: this.operation === 'add' ? 'Add' : 'Update'
          }
          AddUpdateOrganization(data).then(res => {
          AddUpdateStepCheckItem(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
src/views/zlgl/qxdy.vue
@@ -55,31 +55,18 @@
            label="序号"
          />
          <el-table-column
            prop="org_code"
            label="组织编码"
            prop="code"
            label="缺陷代码"
            sortable="custom"
          />
          <el-table-column
            prop="org_name"
            label="组织名称"
            prop="name"
            label="缺陷名称"
            sortable="custom"
          />
          <el-table-column
            prop="description"
            label="组织类型"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.description==='F'">工厂</div>
              <div v-if="row.description==='D'">部门</div>
              <div v-if="row.description==='W'">车间</div>
              <div v-if="row.description==='K'">科室</div>
              <div v-if="row.description==='L'">生产线</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="parentorg_name"
            label="上级单位"
            prop="descr"
            label="缺陷描述"
            sortable="custom"
          />
          <el-table-column
@@ -126,14 +113,14 @@
      @close="handleClose"
    >
      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="缺陷类型" prop="OrgCode">
          <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 200px" />
        <el-form-item label="缺陷代码" prop="defectcode">
          <el-input v-model="dialogForm.defectcode" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="缺陷名称" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 200px" />
        <el-form-item label="缺陷名称" prop="defectname">
          <el-input v-model="dialogForm.defectname" style="width: 200px" />
        </el-form-item>
        <el-form-item label="缺陷描述" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
        <el-form-item label="缺陷描述" prop="defectdescr">
          <el-input v-model="dialogForm.defectdescr" type="textarea" style="width: 200px" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
@@ -150,7 +137,7 @@
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { DedectSearch } from '@/api/zlgl'
import { AddUpdateDedect, DedectSearch, DeleteDedect } from '@/api/zlgl'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -161,10 +148,10 @@
  data() {
    const validateName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请输入编码'))
        return callback(new Error('请输入缺陷代码'))
      } else {
        if (SER_HZ.test(value)) {
          return callback(new Error('编码不能为中文'))
          return callback(new Error('代码不能为中文'))
        } else {
          callback()
        }
@@ -182,37 +169,23 @@
        page: 1, // 第几页
        rows: 20 // 每页多少条
      },
      OrgTypeArr: [
        { label: '工厂', value: 'F' },
        { label: '部门', value: 'D' },
        { label: '车间', value: 'W' },
        { label: '科室', value: 'K' },
        { label: '生产线', value: 'L' }
      ],
      total: 10,
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        OrgType: '',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// 上级单位
        defectcode: '', // 缺陷代码
        defectname: '', // 缺陷名称
        defectdescr: ''// 缺陷描述
      },
      operation: '',
      dialogFormRules: {
        OrgType: [
          { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] }
        ],
        OrgCode: [
        defectcode: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
        ],
        OrgName: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        defectname: [
          { required: true, message: '请输入缺陷名称', trigger: ['blur', 'change'] }
        ]
      }
    }
  },
  created() {
@@ -250,13 +223,11 @@
    },
    // 重置
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.form.defectcode = ''
      this.form.defectname = ''
      this.form.defectdescr = ''
      this.getDedectSearch()
    },
    // 新增按钮
    add(operation) {
      this.operation = operation
@@ -268,9 +239,9 @@
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.OrgCode = row.org_code
        this.dialogForm.OrgName = row.org_name
        this.dialogForm.SupUnit = row.parent_id
        this.dialogForm.defectcode = row.code
        this.dialogForm.defectname = row.name
        this.dialogForm.defectdescr = row.descr
      })
    },
    // 删除按钮
@@ -280,7 +251,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteOrganization({ orgid: row.code }).then(res => {
        DeleteDedect({ defectcode: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getDedectSearch()
@@ -292,10 +263,9 @@
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.dialogForm.defectcode = ''
      this.dialogForm.defectname = ''
      this.dialogForm.defectdescr = ''
      this.$refs.dialogForm.clearValidate()
    },
    // 对话框取消
@@ -307,12 +277,12 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
            defectcode: this.dialogForm.defectcode,
            defectname: this.dialogForm.defectname,
            defectdescr: this.dialogForm.defectdescr,
            OperType: this.operation === 'add' ? 'Add' : 'Update'
          }
          AddUpdateOrganization(data).then(res => {
          AddUpdateDedect(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
src/views/zzmx/chda.vue
@@ -80,7 +80,25 @@
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button type="primary" icon="el-icon-office-building" @click="office">单位</el-button>
        <!--        <el-button type="primary" icon="el-icon-office-building" @click="office">单位</el-button>-->
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
          @click="syncSeaveSearchUnit"
        >同步计量单位
        </el-button>
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
          @click="syncInventoryFileSelect"
        >同步存货档案
        </el-button>
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
          @click="syncStockTypeSelect"
        >同步存货类型
        </el-button>
        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>-->
      </div>
      <el-divider />
@@ -558,6 +576,7 @@
  UomSearch, UomSelect
} from '@/api/zzmx'
import $ from 'jquery'
import { SeaveSearchErpOrder, SeaveSearchInventory, SeaveSearchInventoryClass, SeaveSearchUnit } from '@/api/ErpSyncMes'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -682,6 +701,77 @@
    this.getHeight()
  },
  methods: {
    // 同步计量单位
    async syncSeaveSearchUnit() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步计量单位,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      const res = await SeaveSearchUnit()
      if (res.code === '200') {
        setTimeout(() => {
          // this.getInventoryFileSelect()
          this.officeTableData = res.data
          console.log(this.officeTableData, 9)
          loading.close()
          this.$message.success('同步成功!')
        }, 2000)
      } else {
        setTimeout(() => {
          loading.close()
          this.$message.error('同步失败!')
        }, 10000)
      }
    },
    // 同步存货档案
    async  syncInventoryFileSelect() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步存货档案,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      const res = await SeaveSearchInventory()
      if (res.code === '200') {
        setTimeout(() => {
          this.getInventoryFileSelect()
          loading.close()
          this.$message.success('同步成功!')
        }, 2000)
      } else {
        setTimeout(() => {
          loading.close()
          this.$message.error('同步失败!')
        }, 10000)
      }
    },
    // 同步存货类型
    async syncStockTypeSelect() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步存货类型,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      const res = await SeaveSearchInventoryClass()
      if (res.code === '200') {
        setTimeout(() => {
          this.getStockTypeSelect()
          loading.close()
          this.$message.success('同步成功!')
        }, 2000)
      } else {
        setTimeout(() => {
          loading.close()
          this.$message.error('同步失败!')
        }, 10000)
      }
    },
    async getInventoryFileSelect() {
      const res = await InventoryFileSelect(this.form)
      this.tableData = res.data
@@ -803,6 +893,10 @@
    },
    // 对话框确认
    dialogVisibleConfirm() {
      if (this.defaultroute_codeArr.length > 0 && this.defaultroute_code === '') {
        return this.$message.info('默认工艺路线不能为空!')
      }
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
src/views/zzmx/gxdy.vue
@@ -190,21 +190,33 @@
        <el-form-item label="工序名称" prop="stepname">
          <el-input v-model="dialogForm.stepname" style="width: 200px" />
        </el-form-item>
        <el-form-item prop="steptypecode" label="工序类型">
          <el-select
          <el-radio-group
            v-model="dialogForm.steptypecode"
            filterable
            style="width: 200px"
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
            <el-radio
              v-for="item in steptypeArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
              :label="item.name"
            />
          </el-select>
          </el-radio-group>
          <!--          <el-select-->
          <!--            v-model="dialogForm.steptypecode"-->
          <!--            filterable-->
          <!--            style="width: 200px"-->
          <!--            placeholder="请选择"-->
          <!--            :popper-append-to-body="false"-->
          <!--          >-->
          <!--            <el-option-->
          <!--              v-for="item in steptypeArr"-->
          <!--              :key="item.code"-->
          <!--              :label="item.name"-->
          <!--              :value="item.code"-->
          <!--            />-->
          <!--          </el-select>-->
        </el-form-item>
        <el-form-item prop="enable" label="启用状态">
          <el-select
@@ -412,7 +424,7 @@
        'id': '',
        'stepcode': '',
        'stepname': '',
        'steptypecode': '',
        'steptypecode': '自制',
        'enable': 'Y',
        'description': '',
        'OperType': ''
@@ -511,7 +523,7 @@
        this.dialogForm.id = row.id
        this.dialogForm.stepcode = row.stepcode
        this.dialogForm.stepname = row.stepname
        this.dialogForm.steptypecode = row.flwtype
        this.dialogForm.steptypecode = this.steptypeArr.find(item => item.code === row.flwtype).name
        this.dialogForm.description = row.descr
        this.dialogForm.enable = row.enable
      })
@@ -537,7 +549,7 @@
    handleClose() {
      this.dialogForm.stepcode = ''
      this.dialogForm.stepname = ''
      this.dialogForm.steptypecode = ''
      this.dialogForm.steptypecode = '自制'
      this.dialogForm.enable = 'Y'
      this.dialogForm.description = ''
      this.$refs.dialogForm.clearValidate()
@@ -554,7 +566,7 @@
            id: this.dialogForm.id,
            stepcode: this.dialogForm.stepcode,
            stepname: this.dialogForm.stepname,
            steptypecode: this.dialogForm.steptypecode,
            steptypecode: this.steptypeArr.find(item => item.name === this.dialogForm.steptypecode).code,
            enable: this.dialogForm.enable,
            description: this.dialogForm.description,
            OperType: this.operation === 'add' ? 'Add' : 'Update'
src/views/zzmx/jpgj.vue
@@ -594,27 +594,18 @@
    },
    async partDialogChange(val) {
      const { data: res } = await PartSelectRpute({ partcode: val })
      console.log(this.routeDialogArr = res, 888)
      this.routeDialogArr = res
      this.stepDialogArr = []
      this.eqpDialogArr = []
    },
    async routeDialogChange(val) {
      const { data: res } = await RouteSelectStep({ routecode: val })
      this.stepDialogArr = res
      // this.stepDialogArr = [
      //   { code: '1001', name: '测试工序1' },
      //   { code: '1002', name: '测试工序2' },
      //   { code: '1003', name: '测试工序3' },
      //   { code: '1004', name: '测试工序4' },
      //   { code: '1005', name: '测试工序5' },
      //   { code: '1006', name: '测试工序6' },
      //   { code: '1007', name: '测试工序7' },
      //   { code: '1008', name: '测试工序8' },
      //   { code: '1009', name: '测试工序9' }
      // ]
      this.eqpDialogArr = []
    },
    radioChange(val) {
      this.isEqpTableEdit = true
      // this.dialogForm.stepcode = this.stepDialogArr.find(item => item.name === val).code
      this.getEqpTable(val)
    },
@@ -662,7 +653,7 @@
        cavity_qty: row.cavity_qty, // 型腔数
        unprice: row.unprice//  计件单价
      }
      console.log(data, 7)
      // row.isVisible = 0
      const res = await SaveBeatRate(data)
      if (res.code === '200') {
@@ -687,7 +678,6 @@
    },
    // 复制行
    async  copyRow(row) {
      console.log(row)
      let currentData = {}// 当前行对象
      let nextData = {}// 下一行对象
      if (row.RowNum === this.eqpDialogArr.length) {
@@ -700,8 +690,6 @@
          }
        })
      }
      console.log(currentData, 2)
      console.log(nextData, 3)
      const newData = {
        partcode: this.eqpTable.partcode, //  产品编码
        routecode: this.eqpTable.routecode, //  工艺路线编码
@@ -713,7 +701,7 @@
        cavity_qty: currentData.cavity_qty, // 型腔数
        unprice: currentData.unprice//  计件单价
      }
      console.log(newData, 4)
      const res = await SaveBeatRate(newData)
      if (res.code === '200') {
        this.$message.success('复制成功!')
@@ -746,7 +734,6 @@
    async  edit(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      console.log(row)
      this.editPartName = row.partname
      this.editRouteName = row.route_name