|
@@ -21,7 +21,6 @@
|
|
|
:page.sync="page"
|
|
|
:before-open="beforeOpen"
|
|
|
:table-loading="loading"
|
|
|
- @row-del="rowDel"
|
|
|
@row-update="rowUpdate"
|
|
|
@row-save="rowSave"
|
|
|
@search-change="searchChange"
|
|
@@ -32,18 +31,6 @@
|
|
|
@refresh-change="refreshChange"
|
|
|
@on-load="onLoad"
|
|
|
>
|
|
|
- <template slot="menuLeft">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- size="small"
|
|
|
- plain
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
-
|
|
|
<template slot-scope="{row}" slot="itemStatus">
|
|
|
<el-tag :type="getItemStatusType(row.itemStatus)">
|
|
|
{{ getItemStatusText(row.itemStatus) }}
|
|
@@ -55,7 +42,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getList, add, update, remove, getDetail } from '@/api/order/order-item'
|
|
|
+import { getList, add, update, getDetail } from '@/api/order/order-item'
|
|
|
|
|
|
/**
|
|
|
* 订单明细查询参数类型定义
|
|
@@ -208,13 +195,14 @@ export default {
|
|
|
searchMenuSpan: 6,
|
|
|
border: true,
|
|
|
index: true,
|
|
|
- selection: true,
|
|
|
+ selection: false,
|
|
|
viewBtn: true,
|
|
|
addBtn: true,
|
|
|
editBtn: true,
|
|
|
- delBtn: true,
|
|
|
+ delBtn: false,
|
|
|
dialogClickModal: false,
|
|
|
- dialogWidth: 800,
|
|
|
+ dialogWidth: 1000,
|
|
|
+ labelWidth: 120, // 新增:设置表单label宽度为120px
|
|
|
column: [
|
|
|
{
|
|
|
label: '物料编码',
|
|
@@ -587,54 +575,6 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * 明细删除
|
|
|
- * @param {OrderItemRecord} row - 明细行数据
|
|
|
- * @param {number} index - 行索引
|
|
|
- */
|
|
|
- async rowDel(row, index) {
|
|
|
- try {
|
|
|
- await remove(row.id)
|
|
|
- this.$message.success('删除成功!')
|
|
|
- this.onLoad(this.page)
|
|
|
- this.$emit('item-changed')
|
|
|
- } catch (error) {
|
|
|
- console.error('删除明细失败:', error)
|
|
|
- this.$message.error('删除明细失败')
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 明细批量删除
|
|
|
- */
|
|
|
- async handleDelete() {
|
|
|
- if (this.selectionList.length === 0) {
|
|
|
- this.$message.warning('请选择要删除的数据')
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- try {
|
|
|
- await this.$confirm('确定删除选中的明细吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
-
|
|
|
- const ids = this.selectionList.map(item => item.id).join(',')
|
|
|
- await remove(ids)
|
|
|
-
|
|
|
- this.$message.success('删除成功!')
|
|
|
- this.selectionList = []
|
|
|
- this.onLoad(this.page)
|
|
|
- this.$emit('item-changed')
|
|
|
- } catch (error) {
|
|
|
- if (error !== 'cancel') {
|
|
|
- console.error('批量删除明细失败:', error)
|
|
|
- this.$message.error('批量删除明细失败')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
* 明细搜索
|
|
|
* @param {Object} params - 搜索参数
|
|
|
* @param {boolean} done - 完成回调
|