loulijun2021
2023-06-16 db407663e3024050ab3eb701f10ee00ddaf5f1ee
src/views/makeModel/processDefine.vue
@@ -16,27 +16,27 @@
          style="display: flex;"
        >
          <div class="elForm">
            <el-form-item label="工序编码" style=" display: flex;">
              <el-input v-model="form.stepcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="工序名称" style=" display: flex;">
              <el-input v-model="form.stepname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="启用状态" style=" display: flex;">
            <el-form-item label="所属车间" style=" display: flex;">
              <el-select
                v-model="form.enable"
                filterable
                v-model="form.WorkShop"
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <!--                @focus="getWareHouseSelect"-->
                <el-option
                  v-for="item in enableArr"
                  v-for="item in WorkShopArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="工序编码" style=" display: flex;">
              <el-input v-model="form.stepcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="工序名称" style=" display: flex;">
              <el-input v-model="form.stepname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="工序类型" style=" display: flex;">
              <el-select
@@ -48,6 +48,22 @@
              >
                <el-option
                  v-for="item in steptypeArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="启用状态" style=" display: flex;">
              <el-select
                v-model="form.enable"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in enableArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
@@ -189,7 +205,7 @@
        :page.sync="form.page"
        :limit.sync="form.rows"
        align="right"
        layout="total,prev, pager, next,sizes"
        layout="total,prev, pager, next,sizes,jumper"
        popper-class="select_bottom"
        @pagination="getStepSearch"
      />
@@ -217,7 +233,7 @@
        <el-form-item prop="steptypecode" label="工序类型">
          <el-radio-group
            v-model="dialogForm.steptypecode"
            style="width: 200px"
            style="width: 210px"
          >
            <el-radio
              v-for="item in steptypeArr"
@@ -226,20 +242,22 @@
              :label="item.name"
            />
          </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 prop="wkshopcode" label="所属车间">
            <el-select
              v-model="dialogForm.wkshopcode"
              filterable
              style="width: 200px"
              placeholder="请选择"
              :popper-append-to-body="false"
            >
              <el-option
                v-for="item in WorkShopArr"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              />
            </el-select>
          </el-form-item>
        </el-form-item>
        <el-form-item prop="enable" label="启用状态">
          <el-select
@@ -295,7 +313,7 @@
      <el-divider />
      <div>
        <div style="margin-bottom:20px">
          <i class="el-icon-s-operation":style="{color:$store.state.settings.theme}" /> 工作站集合:
          <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 工作站集合:
        </div>
        <div class="myCheckboxGroup">
          <div
@@ -429,6 +447,8 @@
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import TableColumnSettings from '@/components/TableColumnSettings'
import { getCookie } from '@/utils/auth'
import { WorkShopSelect } from '@/api/deviceManager'
export default {
  name: 'GXDY',
@@ -447,6 +467,7 @@
        stepcode: '', // 工序编码
        stepname: '', // 工序名称
        enable: '', // 启用状态
        WorkShop: this.$store.state.settings.orgType !== 'W' ? '' : getCookie('stu_torgcode'), // 所属车间
        steptypecode: [], // 工序类型编码
        createuser: '', // 创建人员
        prop: 'lm_date', // 排序字段
@@ -463,6 +484,7 @@
        { code: 'W', name: '外协' }
        // { code: 'Z;W', name: '自制;外协' }
      ],
      WorkShopArr: [], // 所属车间数组
      total: 10,
      tableData: [],
      tableColumnSettingsArray: [
@@ -517,13 +539,31 @@
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'org_code',
          label: '所属组织编码',
          id: 8,
          show: false,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'org_name',
          label: '所属车间',
          id: 9,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'lm_user',
          label: '创建人员',
          id: 8,
          id: 10,
          show: true,
          fixed: false,
          sortable: true
@@ -533,7 +573,7 @@
          width: 160,
          prop: 'lm_date',
          label: '创建时间',
          id: 9,
          id: 11,
          show: true,
          fixed: false,
          sortable: true
@@ -543,7 +583,7 @@
          width: 110,
          prop: 'is_eqp',
          label: '关联工作站',
          id: 10,
          id: 12,
          show: true,
          fixed: false,
          sortable: false
@@ -553,7 +593,7 @@
          width: 110,
          prop: 'is_defect',
          label: '关联缺陷',
          id: 11,
          id: 13,
          show: true,
          fixed: false,
          sortable: false
@@ -568,7 +608,8 @@
        'steptypecode': '自制',
        'enable': 'Y',
        'description': '',
        'OperType': ''
        'OperType': '',
        'wkshopcode': this.$store.state.settings.orgType !== 'W' ? '' : getCookie('stu_torgcode') // 所属车间
      },
      operation: '',
      dialogFormRules: {
@@ -583,12 +624,16 @@
        ],
        enable: [
          { required: true, message: '请选择状态', trigger: ['blur', 'change'] }
        ],
        wkshopcode: [
          { required: true, message: '请选择所属车间', trigger: ['blur', 'change'] }
        ]
      },
      workDialogVisible: false,
      workDialogForm: {
        stepcode: '', // 工序编码
        stepname: '', // 工序名称
        WorkShop: '', // 所属车间
        workArr: [], //  工作站所有数组
        workGatherArr: [], // 工作站集合数组
        workCodeSelectedGatherArr: [], // 工作站选中集合的code数组
@@ -609,12 +654,18 @@
  },
  created() {
    this.getStepSearch()
    this.getWorkShopSelect()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    // 获取所属车间下拉
    async getWorkShopSelect() {
      const { data: res } = await WorkShopSelect()
      this.WorkShopArr = res
    },
    tableColumnUpdate(val, isCopyTrue) {
      if (isCopyTrue) {
        this.tableColumnSettingsArray = val
@@ -657,6 +708,7 @@
      this.form.enable = ''
      this.form.steptypecode = ''
      this.form.createuser = ''
      this.form.WorkShop = this.$store.state.settings.orgType !== 'W' ? '' : getCookie('stu_torgcode')// 所属车间
      this.getStepSearch()
    },
@@ -676,6 +728,7 @@
        this.dialogForm.stepname = row.stepname
        this.dialogForm.steptypecode = this.steptypeArr.find(item => item.code === row.flwtype).name
        this.dialogForm.description = row.descr
        this.dialogForm.wkshopcode = row.org_code
        this.dialogForm.enable = row.enable
      })
    },
@@ -706,6 +759,7 @@
      this.dialogForm.steptypecode = '自制'
      this.dialogForm.enable = 'Y'
      this.dialogForm.description = ''
      this.dialogForm.wkshopcode = this.$store.state.settings.orgType !== 'W' ? '' : getCookie('stu_torgcode')// 所属车间
      this.$refs.dialogForm.clearValidate()
    },
    // 对话框取消
@@ -724,6 +778,7 @@
            steptypecode: this.steptypeArr.find(item => item.name === this.dialogForm.steptypecode).code,
            enable: this.dialogForm.enable,
            description: this.dialogForm.description,
            WorkShop: this.dialogForm.wkshopcode,
            OperType: this.operation === 'add' ? 'Add' : 'Update'
          }
          AddUpdateStep(data).then(res => {
@@ -765,7 +820,8 @@
      this.workDialogForm.stepcode = row.stepcode
      this.workDialogForm.stepname = row.stepname
      StepAssociationEqp({ stepcode: this.workDialogForm.stepcode }).then(res => {
      this.workDialogForm.WorkShop = row.org_code
      StepAssociationEqp({ stepcode: this.workDialogForm.stepcode, WorkShop: row.org_code }).then(res => {
        if (res.code === '200') {
          setTimeout(() => {
            loading.close()
@@ -1049,7 +1105,7 @@
        }
      })
      this.$store.state.app.buttonIsDisabled = true
      const res = await SaveStepAssociationEqp(this.workDialogForm.stepcode, data)
      const res = await SaveStepAssociationEqp(this.workDialogForm.stepcode, this.workDialogForm.WorkShop, data)
      if (res.code === '200') {
        this.workDialogVisible = false
        this.$message.success('保存成功!')
@@ -1070,8 +1126,9 @@
      this.defectTreeCode = row.stepcode
      this.defectTreeName = row.stepname
      this.workDialogForm.WorkShop = row.org_code
      StepAssociationDefect({ stepcode: row.stepcode }).then(res => {
      StepAssociationDefect({ stepcode: row.stepcode, WorkShop: row.org_code }).then(res => {
        if (res.code === '200') {
          setTimeout(() => {
            loading.close()
@@ -1114,7 +1171,7 @@
        }
      })
      this.$store.state.app.buttonIsDisabled = true
      const res = await SaveStepAssociationDefect(this.defectTreeCode, data)
      const res = await SaveStepAssociationDefect(this.defectTreeCode, this.workDialogForm.WorkShop, data)
      if (res.code === '200') {
        this.defectDialogVisible = false
        this.$message.success('保存成功!')