loulijun2021
2023-06-17 ff76b3ed3494474e9301c49cf635f1553d49ecc5
src/views/reportManager/subcontractingOperation.vue
@@ -14,6 +14,16 @@
          style="display: flex;"
        >
          <div class="elForm">
            <el-form-item label="生产车间" style=" display: flex;">
              <el-select v-model="form.wkshopcode" style="width: 200px" placeholder="请选择">
                <el-option
                  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.wocode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
@@ -23,9 +33,9 @@
            <el-form-item label="产品名称" style=" display: flex;">
              <el-input v-model="form.partname" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <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-input v-model="form.partspec" style="width: 200px" placeholder="请输入" />-->
            <!--            </el-form-item>-->
            <el-form-item v-show="isExpandForm" label="工序名称" style=" display: flex;">
              <el-input v-model="form.stepname" style="width: 200px" placeholder="请输入" />
            </el-form-item>
@@ -143,6 +153,13 @@
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="wkshp_name"
            label="生产车间"
            width="105"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="stepcode"
            label="工序编码"
@@ -323,6 +340,7 @@
import { OutSourceReportExcelSearch, OutSourceReportSearch } from '@/api/reportManager'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import { WorkShopSelect } from '@/api/deviceManager'
export default {
  name: 'Zzjg',
@@ -345,6 +363,7 @@
        suppername: '', // 供方名称
        type: '', // 操作类型
        receivdate: '', // 收料时间
        wkshopcode: this.$store.state.settings.orgType === 'W' ? getCookie('stu_torgcode') : '', // 所属车间
        prop: 'out_time', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
@@ -377,6 +396,8 @@
      },
      WorkShopArr: [],
      title_value: '数据导入 / 点检部位',
      code: '4',
      shows: false
@@ -392,12 +413,18 @@
  },
  created() {
    this.getOutSourceReportSearch()
    this.getWorkShopSelect()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    // 获取所属车间下拉
    async getWorkShopSelect() {
      const { data: res } = await WorkShopSelect()
      this.WorkShopArr = res
    },
    async getOutSourceReportSearch() {
      let tempDate = this.form.receivdate
      if (tempDate.length > 0) {
@@ -411,6 +438,7 @@
        partspec: this.form.partspec,
        stepname: this.form.stepname,
        suppername: this.form.suppername,
        wkshopcode: this.form.wkshopcode,
        type: this.form.type,
        receivdate: tempDate,
        prop: this.form.prop,
@@ -419,7 +447,6 @@
        rows: this.form.rows
      }
      console.log(data, 1)
      const res = await OutSourceReportSearch(data)
      this.tableData = res.data
      this.total = res.count
@@ -450,6 +477,7 @@
        partspec: this.form.partspec,
        stepname: this.form.stepname,
        suppername: this.form.suppername,
        wkshopcode: this.form.wkshopcode,
        type: this.form.type,
        receivdate: tempDate
      }
@@ -479,78 +507,9 @@
      this.form.suppername = ''
      this.form.type = ''
      this.form.receivdate = ''
      this.form.wkshopcode = this.$store.state.settings.orgType === 'W' ? getCookie('stu_torgcode') : ''// 所属车间
      this.getOutSourceReportSearch()
    },
    // 新增按钮
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
    },
    // 修改按钮
    edit(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.OrgCode = row.org_code
        this.dialogForm.OrgName = row.org_name
        this.dialogForm.SupUnit = row.parent_id
      })
    },
    // 删除按钮
    async del(row) {
      // this.$confirm('是否确认删除?', '提示', {
      //   confirmButtonText: '确定',
      //   cancelButtonText: '取消',
      //   type: 'warning'
      // }).then(() => {
      //   DeleteOrganization({ orgid: row.code }).then(res => {
      //     if (res.code === '200') {
      //       this.$message.success('删除成功!')
      //       if (this.form.page > 1 && this.tableData.length === 1) {
      //         this.form.page--
      //       }
      //       this.getOutSourceReportSearch()
      //     }
      //   })
      // }).catch(() => {
      //   this.$message.info('已取消删除')
      // })
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.$refs.dialogForm.clearValidate()
    },
    // 对话框取消
    dialogVisibleCancel() {
      this.dialogVisible = false
    },
    // 对话框确认
    dialogVisibleConfirm() {
      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')
          }
          // AddUpdateOrganization(data).then(res => {
          //   if (res.code === '200') {
          //     this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
          //     this.dialogVisible = false
          //     this.getOutSourceReportSearch()
          //   } else {
          //     this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
          //   }
          // })
        }
      })
    },
    // 获取页面高度
    getHeight() {