小小儁爺
2024-08-08 d20654ba067e5c0621d4d7d95915cbe47a10fe87
src/views/qualityManager/qualityPlaning.vue
@@ -296,11 +296,29 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="所属车间" prop="wkshopcode">
          <el-select
            v-model="dialogForm.wkshopcode"
            filterable
            :popper-append-to-body="false"
            style="width: 200px"
            placeholder="请选择"
            @change="getStepSelect"
          >
            <el-option
              v-for="item in WorkShopArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
        <br>
        <el-form-item prop="checktype" label="质检类型">
          <el-radio-group v-model="dialogForm.checktype">
            <el-radio label="InCheck">入厂检验</el-radio>
            <el-radio label="OutCheck">出厂检验</el-radio>
            <!--            <el-radio label="InCheck">入厂检验</el-radio>-->
            <!--            <el-radio label="OutCheck">出厂检验</el-radio>-->
            <el-radio label="FirstCheck">首检检验</el-radio>
            <el-radio label="PatroCheck">巡检</el-radio>
            <el-radio label="EndCheck">完工检</el-radio>
@@ -336,7 +354,6 @@
            style="width: 200px"
            multiple
            filterable
            collapse-tags
            placeholder="请选择"
            :popper-append-to-body="false"
@@ -345,7 +362,7 @@
              v-for="item in PartSelectArr"
              v-if="dialogForm.suitobject==='P'"
              :key="item.partcode"
              :label="item.partname"
              :label="item.partname+'/'+item.partcode"
              :value="item.partcode"
            />
            <el-option
@@ -378,10 +395,10 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="检验方案描述">
          <el-input v-model="dialogForm.descr" type="textarea" :autosize="{ minRows: 2 }" />
        </el-form-item>
      </el-form>
      <div style="display: flex;align-items: center;margin-bottom: 10px;">
@@ -712,9 +729,10 @@
  StepCheckItemSelect
} from '@/api/qualityManager'
import TableColumnSettings from '@/components/TableColumnSettings'
import { WorkShopSelect } from '@/api/deviceManager'
export default {
  name: 'Zzjg',
  name: 'QualityPlaning',
  components: {
    Pagination, TableColumnSettings
  },
@@ -816,12 +834,33 @@
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'org_code',
          label: '所属车间编码',
          id: 9,
          show: false,
          fixed: false,
          sortable: true
        }, {
          minWidth: false,
          width: 110,
          prop: 'org_name',
          label: '所属车间',
          id: 10,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'stepcode',
          label: '工序编码',
          id: 9,
          id: 11,
          show: false,
          fixed: false,
          sortable: true
@@ -830,7 +869,7 @@
          width: false,
          prop: 'stepname',
          label: '工序名称',
          id: 10,
          id: 12,
          show: true,
          fixed: false,
          sortable: true
@@ -840,7 +879,7 @@
          width: 110,
          prop: 'username',
          label: '创建人员',
          id: 11,
          id: 13,
          show: true,
          fixed: false,
          sortable: true
@@ -850,7 +889,7 @@
          width: 160,
          prop: 'lm_date',
          label: '创建时间',
          id: 12,
          id: 14,
          show: true,
          fixed: false,
          sortable: true
@@ -869,6 +908,7 @@
        suitobject: 'P', // 适用对象
        suitpart: [], // 适用物料
        stepcode: '', // 工序
        wkshopcode: '', // 所属车间
        descr: '' // /描述
      },
      operation: '',
@@ -902,6 +942,9 @@
        ],
        stepcode: [
          { required: true, message: '请选择工序名称', trigger: ['blur', 'change'] }
        ],
        wkshopcode: [
          { required: true, message: '请选择所属车间', trigger: ['blur', 'change'] }
        ]
      },
      checkitem: [],
@@ -918,6 +961,7 @@
      CheckItemSelectArr: [], // 检验项目
      StepSelectArr: [], // 工序名称下拉所有
      WorkShopArr: [], // 所属车间数组
      isCancel: true// 是否可取消
    }
@@ -942,16 +986,25 @@
      this.getQualityInspectionSearch().then(res => {
        if (res.code === '200') {
          // this.getUomSelect()
          this.getStepCheckItemSelect()
          // this.getStepCheckItemSelect()
          this.getPartSelect()
          this.getStockTypeSelect()
          this.getStepSelect()
          this.getWorkShopSelect()
        }
      })
    },
    async getStepSelect() {
      const { data: res } = await StepSelect()
    // 获取所属车间下拉
    async getWorkShopSelect() {
      const { data: res } = await WorkShopSelect()
      this.WorkShopArr = res
    },
    async getStepSelect(val) {
      this.dialogForm.stepcode = ''
      const { data: res } = await StepSelect({ WorkShop: val })
      this.StepSelectArr = res
      await this.getStepCheckItemSelect(val)
    },
    async getQualityInspectionSearch() {
      const res = await QualityInspectionSearch(this.form)
@@ -1017,6 +1070,7 @@
        this.dialogForm.suitobject = row.suitobject
        this.dialogForm.suitpart = row.suitpart.split(',')
        this.dialogForm.descr = row.descr
        this.dialogForm.wkshopcode = row.org_code
        this.checkitem = res
        this.$refs.tableDataRef2.doLayout()
@@ -1060,6 +1114,7 @@
        this.dialogForm.suitobject = row.suitobject
        this.dialogForm.suitpart = row.suitpart.split(',')
        this.dialogForm.descr = row.descr
        this.dialogForm.wkshopcode = row.org_code
        this.checkitem = res
        // console.log(this.checkitem, 2)
        this.$refs.tableDataRef2.doLayout()
@@ -1105,9 +1160,9 @@
      this.dialogForm.suitpart = []
    },
    // 获取检验项目下拉接口
    async getStepCheckItemSelect() {
      const { data: res } = await StepCheckItemSelect()
    async getStepCheckItemSelect(val) {
      const { data: res } = await StepCheckItemSelect({ WorkShop: val })
      this.CheckItemSelectArr = []
      res.forEach(i => {
        this.CheckItemSelectArr.push({
          code: i.code,
@@ -1210,7 +1265,8 @@
        sampscale: '',
        suitobject: 'P',
        suitpart: [],
        descr: ''
        descr: '',
        wkshopcode: ''
      }
      this.isCancel = true
@@ -1228,6 +1284,12 @@
        if (valid) {
          if (this.checkitem.length < 1) {
            return this.$message.info('质检列表不能为空!')
          }
          if (this.checkitem.find(i => i.isVisible === 1)) {
            return this.$message.info('请先保存质检列表!')
          }
          if (this.dialogForm.checktype === 'InCheck' || this.dialogForm.checktype === 'OutCheck') {
            this.dialogForm.stepcode = ''
          }
          const checkitem = []
@@ -1257,6 +1319,7 @@
            suitpart: this.dialogForm.suitpart.join(','),
            type: this.operation === 'add' ? 'Add' : 'Update',
            descr: this.dialogForm.descr,
            wkshopcode: this.dialogForm.wkshopcode,
            checkitem
          }