|
@@ -38,6 +38,10 @@ export default {
|
|
|
puOrderExecuteList: [],
|
|
|
},
|
|
|
checkedList: [],
|
|
|
+ // 子表Select
|
|
|
+ checkedTabList: [],
|
|
|
+ // 主表点击信息
|
|
|
+ primaryResource:{},
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -134,6 +138,8 @@ export default {
|
|
|
// 获取子表信息
|
|
|
async handleDetailsData(row) {
|
|
|
try {
|
|
|
+ this.primaryResource = row;
|
|
|
+ this.checkedTabList = [];
|
|
|
const { code, msg, data } = await orderApi.details(row.id);
|
|
|
if (code === 200) {
|
|
|
// 物料信息:puOrderItemList 执行结果:puOrderExecuteList
|
|
@@ -186,30 +192,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- // this.$confirm('此操作将删除该订单, 是否继续?', '提示', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // type: 'warning'
|
|
|
- // }).then( async() => {
|
|
|
-
|
|
|
- // const { id } = row;
|
|
|
-
|
|
|
- // const { code } = await orderApi.remove(id);
|
|
|
-
|
|
|
- // if (code === 200) {
|
|
|
-
|
|
|
- // this.fetchList(this.params, this.page);
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // }).catch(() => {
|
|
|
-
|
|
|
- // this.$message({
|
|
|
- // type: 'info',
|
|
|
- // message: '已取消删除'
|
|
|
- // });
|
|
|
- // });
|
|
|
-
|
|
|
} catch (err) {
|
|
|
//
|
|
|
} finally {
|
|
@@ -236,11 +218,11 @@ export default {
|
|
|
} finally {
|
|
|
}
|
|
|
},
|
|
|
- // 判断“退回”按钮
|
|
|
- judgeIsAllSendBack() {
|
|
|
+ // 判断“整单退回”按钮
|
|
|
+ judgeIsAllReturn() {
|
|
|
if (this.checkedList.length == 1) {
|
|
|
|
|
|
- // 非手工、状态非审批通过
|
|
|
+ // 非手工、状态:自由/驳回
|
|
|
if (this.checkedList[0].source != 3 && (this.checkedList[0].status == 0 || this.checkedList[0].status == 3)) {
|
|
|
|
|
|
return false
|
|
@@ -249,8 +231,62 @@ export default {
|
|
|
return true;
|
|
|
},
|
|
|
// 整单退回
|
|
|
- handleAllSendBack() {
|
|
|
+ handleAllReturn() {
|
|
|
+
|
|
|
+ this.handleReturn(this.checkedList[0].id,[]);
|
|
|
+ // this.$prompt('请输入退回原因', '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // inputPattern: /\s*\S+?/,
|
|
|
+ // inputErrorMessage: '退回原因不能为空'
|
|
|
+ // }).then(async ({ value }) => {
|
|
|
+
|
|
|
+ // let data = {
|
|
|
+ // id: this.checkedList[0].id,
|
|
|
+ // documentIds: [],
|
|
|
+ // baskCause: value,
|
|
|
+ // };
|
|
|
+
|
|
|
+ // console.log(data);
|
|
|
+
|
|
|
+ // try {
|
|
|
+
|
|
|
+ // let { code, msg } = await orderApi.documentsReturn(data);
|
|
|
+
|
|
|
+ // if (code === 200) {
|
|
|
+
|
|
|
+ // this.fetchList(this.params, this.page);
|
|
|
+
|
|
|
+ // }
|
|
|
+ // } catch (error) {
|
|
|
+ // console.log(error,'error------------');
|
|
|
+ // }
|
|
|
+ // }).catch(() => { });
|
|
|
+
|
|
|
+ },
|
|
|
+ // 判断“行退回”按钮
|
|
|
+ judgeIsLineReturn() {
|
|
|
+
|
|
|
+ if (this.checkedTabList.length == 1) {
|
|
|
+
|
|
|
+ // 主信息:非手工、状态:自由/驳回
|
|
|
+ if(this.primaryResource.source != 3 &&
|
|
|
+ (this.primaryResource.status == 0 || this.primaryResource.status == 3) ){
|
|
|
+
|
|
|
+ return false
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ // 行退回
|
|
|
+ handleLineReturn(){
|
|
|
+ let ids = this.checkedTabList.map(checked => checked.id);
|
|
|
+ console.log(ids,'行退回ids');
|
|
|
+ this.handleReturn(this.primaryResource.id,ids);
|
|
|
+ },
|
|
|
+ // 退回接口
|
|
|
+ handleReturn(id,documentIds){
|
|
|
this.$prompt('请输入退回原因', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -259,8 +295,8 @@ export default {
|
|
|
}).then(async ({ value }) => {
|
|
|
|
|
|
let data = {
|
|
|
- id: this.checkedList[0].id,
|
|
|
- documentIds: [],
|
|
|
+ id,
|
|
|
+ documentIds,
|
|
|
baskCause: value,
|
|
|
};
|
|
|
|
|
@@ -274,12 +310,17 @@ export default {
|
|
|
|
|
|
this.fetchList(this.params, this.page);
|
|
|
|
|
|
+ this.checkedList = [];
|
|
|
+
|
|
|
+ this.checkedTabList = [];
|
|
|
+
|
|
|
+ this.primaryResource = {};
|
|
|
+
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log(error,'error------------');
|
|
|
}
|
|
|
}).catch(() => { });
|
|
|
-
|
|
|
},
|
|
|
// 判断是否满足整单关闭
|
|
|
judgeIsAllClose() {
|
|
@@ -341,6 +382,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ // 主表Select框
|
|
|
handleSelect(selection, row) {
|
|
|
|
|
|
this.checkedList = selection;
|
|
@@ -348,6 +390,13 @@ export default {
|
|
|
console.log(this.checkedList, 'this.checkedList');
|
|
|
|
|
|
},
|
|
|
+ // 子表Select框
|
|
|
+ handleTabSelect(selection, row){
|
|
|
+
|
|
|
+ this.checkedTabList = selection;
|
|
|
+
|
|
|
+ console.log(this.checkedTabList, 'this.checkedTabList');
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -477,7 +526,7 @@ export default {
|
|
|
</el-button-group>
|
|
|
|
|
|
<el-button-group style="margin-left: 10px" :key="checkedList.length + 1">
|
|
|
- <el-button size="mini" @click="handleAllSendBack" :disabled="judgeIsAllSendBack()">整单退回</el-button>
|
|
|
+ <el-button size="mini" @click="handleAllReturn" :disabled="judgeIsAllReturn()">整单退回</el-button>
|
|
|
<el-button size="mini" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button>
|
|
|
</el-button-group>
|
|
|
|
|
@@ -501,7 +550,7 @@ export default {
|
|
|
height="450"
|
|
|
style="width: 100%; margin: 20px 0 0 0"
|
|
|
>
|
|
|
- <el-table-column type="selection" width="45"></el-table-column>
|
|
|
+ <el-table-column type="selection" width="45" ></el-table-column>
|
|
|
<el-table-column type="index" width="50" label="序号"></el-table-column>
|
|
|
<el-table-column
|
|
|
v-for="(column, index) in tableColumns"
|
|
@@ -574,43 +623,64 @@ export default {
|
|
|
:limit.sync="page.pageSize"
|
|
|
@pagination="fetchList(params, page)"
|
|
|
/>
|
|
|
-
|
|
|
- <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
|
|
|
- <el-tab-pane
|
|
|
- v-for="(column, index) in tabColumns"
|
|
|
- :key="index"
|
|
|
- :label="column.title"
|
|
|
- :name="column.key"
|
|
|
- >
|
|
|
- <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row
|
|
|
- :height="tabTableDatas[column.key].length ? 300 : 100">
|
|
|
- <el-table-column type="index" width="50" label="序号"></el-table-column>
|
|
|
- <el-table-column
|
|
|
- v-for="(cColumn, cIndex) in column.tableColumns"
|
|
|
- :key="cIndex"
|
|
|
- :prop="cColumn.key"
|
|
|
- :label="cColumn.title"
|
|
|
- :width="cColumn.width || 180"
|
|
|
- :show-overflow-tooltip="cColumn.showOverflowTooltip || true"
|
|
|
+
|
|
|
+ <div style="position: relative; padding-top: 10px;">
|
|
|
+ <el-row style="position: absolute; top: 30px; right: 20px;z-index: 10;">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ @click="handleLineReturn"
|
|
|
+ :disabled="judgeIsLineReturn()"
|
|
|
+ >行退回</el-button>
|
|
|
+ </el-row>
|
|
|
+ <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
|
|
|
+
|
|
|
+ <el-tab-pane
|
|
|
+ v-for="(column, index) in tabColumns"
|
|
|
+ :key="index"
|
|
|
+ :label="column.title"
|
|
|
+ :name="column.key"
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ :data="tabTableDatas[column.key]"
|
|
|
+ style="width: 100%"
|
|
|
+ highlight-current-row
|
|
|
+ :height="tabTableDatas[column.key].length ? 300 : 100"
|
|
|
+ @select="handleTabSelect"
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag v-if="cColumn.referName"
|
|
|
- size="small"
|
|
|
- :value="scope.row[cColumn.key]"
|
|
|
- :options="dict.type[cColumn.referName]"
|
|
|
- />
|
|
|
- <el-checkbox v-else-if="cColumn.inputType === 'Checkbox'"
|
|
|
- v-model="scope.row[cColumn.key]"
|
|
|
- disabled
|
|
|
- true-label="Y"
|
|
|
- false-label="N"
|
|
|
- ></el-checkbox>
|
|
|
- <span v-else>{{ scope.row[cColumn.key] }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
-
|
|
|
+ <el-table-column
|
|
|
+ v-if=" tabName === 'puOrderItemList'"
|
|
|
+ type="selection"
|
|
|
+ width="45"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column type="index" width="50" label="序号"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-for="(cColumn, cIndex) in column.tableColumns"
|
|
|
+ :key="cIndex"
|
|
|
+ :prop="cColumn.key"
|
|
|
+ :label="cColumn.title"
|
|
|
+ :width="cColumn.width || 180"
|
|
|
+ :show-overflow-tooltip="cColumn.showOverflowTooltip || true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag v-if="cColumn.referName"
|
|
|
+ size="small"
|
|
|
+ :value="scope.row[cColumn.key]"
|
|
|
+ :options="dict.type[cColumn.referName]"
|
|
|
+ />
|
|
|
+ <el-checkbox v-else-if="cColumn.inputType === 'Checkbox'"
|
|
|
+ v-model="scope.row[cColumn.key]"
|
|
|
+ disabled
|
|
|
+ true-label="Y"
|
|
|
+ false-label="N"
|
|
|
+ ></el-checkbox>
|
|
|
+ <span v-else>{{ scope.row[cColumn.key] }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+ </div>
|
|
|
</el-card>
|
|
|
</template>
|