loulijun2021
2022-08-29 1d739783b70e11e964d86a882b00c20d2e000997
src/views/scgl/scdd.vue
@@ -2,7 +2,7 @@
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button
          icon="el-icon-refresh-right"
          @click="syncERP"
@@ -154,10 +154,10 @@
          >
            <template slot-scope="{row}">
              <el-radio
                v-model="radioSelected"
                :label="row.wo"
                style="color: #fff;padding-left: 10px; margin-right: -25px;"
                @change.native="getCurrentRow(row.wo)"
                v-model="radioSelectedId"
                :label="row.id"
                style="color: transparent;padding-left: 15px; margin-right: -25px;"
                @change.native="getCurrentRow(row.id)"
              />
            </template>
          </el-table-column>
@@ -203,7 +203,12 @@
            label="产品规格"
            sortable="custom"
            min-width="110"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.partspec">{{ row.partspec }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="qty"
            label="订单数量"
@@ -221,31 +226,56 @@
            label="生产车间"
            sortable="custom"
            width="150"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="planstartdate"
            label="预计开工时间"
            sortable="custom"
            width="160"
          />
            width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.planstartdate">{{ row.planstartdate.substring(0,11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="planenddate"
            label="预计完工时间"
            sortable="custom"
            width="160"
          />
            width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.planenddate">{{ row.planenddate.substring(0,11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="createuser"
            label="创建人员"
            sortable="custom"
            width="150"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.createuser">{{ row.createuser }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="createdate"
            label="创建时间"
            width="160"
            width="130"
            sortable="custom"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.createdate">{{ row.createdate.substring(0,11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            fixed="right"
@@ -264,7 +294,6 @@
      </div>
      <!--分页-->
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="form.page"
        :limit.sync="form.rows"
@@ -418,10 +447,11 @@
        { code: 'CLOSED', name: '已关闭' }
      ],
      total: 10,
      radioSelected: '',
      radioSelectedId: '',
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        erporderid: '',
        partname: '', // 产品名称
        partspec: '', // 产品规格
        // paystartdate: '', // 预计开工时间
@@ -564,16 +594,16 @@
      this.getErpOrderSearch()
    },
    // 单选框选中获取当前行信息
    getCurrentRow(wo) {
      this.radioSelected = wo
    getCurrentRow(id) {
      this.radioSelectedId = id
    },
    // 订单关闭
    async orderClose() {
      if (this.radioSelected.length < 1) {
      if (this.radioSelectedId.length < 1) {
        return this.$message.info('请先选择订单!')
      }
      this.tableData.forEach(item => {
        if (item.wo === this.radioSelected) {
        if (item.id === this.radioSelectedId) {
          if (item.status !== 'NEW') {
            return this.$message.info('此订单非新订单,无法关闭!')
          } else {
@@ -582,11 +612,10 @@
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              ClosedErpOrder({ erpordercode: this.radioSelected }).then(res => {
              ClosedErpOrder({ erpordercode: item.wo, erporderid: this.radioSelectedId }).then(res => {
                if (res.code === '200') {
                  this.$message.success('订单关闭成功!')
                  this.getErpOrderSearch()
                  // this.radioSelected = ''
                }
              })
            }).catch(() => {
@@ -607,6 +636,7 @@
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.erporderid = row.id
        this.dialogForm.erporderstus = row.status
        this.dialogForm.erpordercode = row.wo
        this.dialogForm.partcode = row.partcode
@@ -657,6 +687,7 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            'erporderid': this.dialogForm.erporderid,
            // 'erporderstus': this.dialogForm.erporderstus,
            'erpordercode': this.dialogForm.erpordercode,
            'partcode': this.dialogForm.partcode,