lyh
2025-06-16 e48436b9c5dd3f0365f77339f84b37eea95b56e2
src/views/dnc/base/modules/ProductStructure/Cutter/CutterTableList.vue
@@ -20,7 +20,7 @@
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="handleAdd" icon="plus" v-has="'cutter_add'">新增</a-button>
              <a-button type="primary" @click="handleAdd()" icon="export">发送刀具系统</a-button>
              <a-button type="primary" @click="handleSend()" icon="export">发送刀具系统</a-button>
            </a-space>
          </a-col>
        </a-row>
@@ -31,7 +31,7 @@
             @change="handleTableChange" :scroll="{y:189}">
      <template slot="action" slot-scope="text, record">
        <a @click="handleEdit(record)">选择刀具</a>
        <a @click="handleChoose(record)">选择刀具</a>
        <a-divider type="vertical"/>
@@ -56,16 +56,21 @@
    </a-table>
    <CutterModal ref="cutterModalRef" :currentTreeNodeInfo="currentLevelInfo" @submitSuccess="loadData"/>
    <DncToolsSelectModal ref="dncToolsSelectModal" @submitSuccess="loadData"/>
  </div>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CutterModal from '@views/dnc/base/modules/ProductStructure/Cutter/CutterModal.vue'
import DncToolsSelectModal from '@views/tms/modules/baseTools/DncToolsSelectModal.vue'
import { getAction, httpAction } from '@api/manage'
import dncApi from '@api/dnc'
export default {
  name: 'CutterTableList',
  components: { CutterModal },
  components: { DncToolsSelectModal, CutterModal },
  mixins: [JeecgListMixin],
  props: {
    currentLevelInfo: {
@@ -89,7 +94,7 @@
            return parseInt(index) + 1
          }
        },
        { title: '刀具编号', dataIndex: 'cutterCode', width: 100, align: 'center' },
        { title: '刀具编号', dataIndex: 'cutterCode', width: 200, align: 'center' },
        { title: '刀具名称', dataIndex: 'cutterName', width: 100, align: 'center' },
        { title: '刀具简称', dataIndex: 'cutterType', width: 80, align: 'center' },
        { title: '刀具规格', dataIndex: 'cutterSpec', align: 'center' },
@@ -103,7 +108,8 @@
        list: '/nc/cutter/getByBusinessId',
        delete: '/nc/cutter/delete',
        exportXlsUrl: '/nc/cutter/exportXls',
        importExcelUrl: '/nc/cutter/importExcel'
        importExcelUrl: '/nc/cutter/importExcel',
        sendCutterUrl: '/nc/cutter/sendCutterUrl',
      }
    }
  },
@@ -171,6 +177,62 @@
      this.$refs.cutterModalRef.title = '刀具详情'
      this.$refs.cutterModalRef.disableSubmit = true
      this.$refs.cutterModalRef.handleCutterEdit(record)
    },
    /**
     * 选择刀具
     */
    handleChoose(record){
      if (record.cutterName.match(/\d+(\.\d+)?/g) !== null) {
        record.cutterName = record.cutterName.match(/\d+(\.\d+)?/g)[0]
      }
      const param = {
        aliasLabel: record.cutterType,
        diameter: record.cutterName,
        cutterId: record.id
      }
      this.$refs.dncToolsSelectModal.open(param)
      this.$refs.dncToolsSelectModal.title = '选择刀具'
    },
    /**
     * 发送刀具系统
     */
    handleSend(){
      const that = this
      const { docId,attributionId, attributionType } = this.currentLevelInfo
      that.$confirm({
        title: '提示',
        content: `确认发送刀具系统吗?`,
        okText: '确认',
        cancelText: '取消',
        onOk: () => {
          dncApi.sendToolsApi({ docId, attributionId, attributionType })
            .then(res => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
              } else {
                that.$notification.error({
                  message: '消息',
                  description: res.message
                })
              }
            })
            .catch(err => {
              that.$notification.error({
                message: '消息',
                description: err.message
              })
            })
            .finally(() => {
              that.$destroyAll()
            })
        },
        onCancel: () => {
          that.$destroyAll()
        }
      })
    }
  }
}