Commit ba6f28e0 authored by hangjun83's avatar hangjun83

罗恩工具类更新

parent ca7d079a
...@@ -170,6 +170,46 @@ export const getBhSordersDetail = (params) => { ...@@ -170,6 +170,46 @@ export const getBhSordersDetail = (params) => {
return postRequest('/tools/bh/getSorderDetailByTaskId', params) return postRequest('/tools/bh/getSorderDetailByTaskId', params)
} }
/*=========== rhawn =========================*/
export const getRhawnSordersDataDetail = (params) => {
return postRequest('/tools/rhawn/getSordersDetail', params)
}
export const getRhawnSordersRefundTask = (params) => {
params.type = 'rhawn_sorder_refund'
return getRequest('/tools/rhawn/getSorderRefundTask', params)
}
export const getRhawnSordersStock = (params) => {
return getRequest('/tools/rhawn/getRhawnSordersStock', params)
}
export const addRhawnSorderRefundTask = (params) => {
return postRequest('/tools/rhawn/addSorderRefundTask', params)
}
export const execRhawnSordersRefundTask = (params) => {
return postRequest('/tools/rhawn/execRhawnSorderRefundTask', params)
}
export const delRhawnSorderRefundTask = (params) => {
return postRequest('/tools/rhawn/delSorderRefundTask', params)
}
export const getRhawnSorderRefundTaskLogs = (params) => {
params.type = 'rhawn_sorder_refund'
return getRequest('/tools/rhawn/getSorderRefundTaskLogs', params)
}
export const getRhawnSordersDetail = (params) => {
return postRequest('/tools/rhawn/getSorderDetailByTaskId', params)
}
export const editRhawnSorderRefundTask = (params) => {
return postRequest('/tools/rhawn/editSorderRefundTask', params)
}
/*=================== 工具类相关接口 结束================================ */ /*=================== 工具类相关接口 结束================================ */
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
}"> }">
<shrinkable-menu :shrink="shrink" @on-change="handleSubmenuChange" :theme="menuTheme" :before-push="beforePush" :menu-list="menuList"> <shrinkable-menu :shrink="shrink" @on-change="handleSubmenuChange" :theme="menuTheme" :before-push="beforePush" :menu-list="menuList">
<div slot="top" class="logo-content" v-if="showLogo || fixNav"> <div slot="top" class="logo-content" v-if="showLogo || fixNav">
<Icon type="ios-game-controller-b" size="100"></Icon>
<img v-show="!shrink && menuTheme == 'light' && mainTheme != 'darkMode'" src="@/assets/logo-black.png" /> <img v-show="!shrink && menuTheme == 'light' && mainTheme != 'darkMode'" src="@/assets/logo-black.png" />
<img v-show="shrink" src="@/assets/logo-min.png" key="min-logo" /> <img v-show="shrink" src="@/assets/logo-min.png" key="min-logo" />
</div> </div>
......
...@@ -371,7 +371,7 @@ ...@@ -371,7 +371,7 @@
.ivu-table-border td { .ivu-table-border td {
border-color: #f9f9f9; border-color: #f9f9f9;
height: 70px; height: 10px;
} }
.ivu-table-tip td { .ivu-table-tip td {
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
font-weight: bold; font-weight: bold;
background-color: #f9f9f9; background-color: #f9f9f9;
border:1px; border:1px;
height: 85px; height: 65px;
} }
.ivu-table table { .ivu-table table {
width: calc(~'100% - 0px') !important; width: calc(~'100% - 0px') !important;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</div> </div>
</Col> </Col>
</Row> </Row>
<Table stripe border class="tableInfoBox":loading="loading" :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table> <Table stripe class="tableInfoBox":loading="loading" :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" show-total show-sizer></Page> <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" show-total show-sizer></Page>
</Row> </Row>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</div> </div>
</Col> </Col>
</Row> </Row>
<Table stripe class="tableInfoBox" :loading="loading" :columns="columns" :data="data" sortable="custom" @on-sort-change="changeSort" @on-selection-change="showSelect"></Table> <Table stripe class="tableInfoBox" :loading="loading" :columns="columns" :data="data" sortable="custom" @on-sort-change="changeSort" @on-selection-change="showSelect"></Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page> <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
</Row> </Row>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</FormItem> </FormItem>
</Form> </Form>
</Row> </Row>
<Table :loading="loading" :columns="columns" :data="data" sortable="custom" ref="table"></Table> <Table stripe class="tableInfoBox" :loading="loading" :columns="columns" :data="data" sortable="custom" ref="table"></Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page> <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
</Row> </Row>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<Row> <Row>
<Button @click="add" type="primary" size="large" icon="md-add">添加任务</Button> <Button @click="add" type="primary" size="large" icon="md-add">添加任务</Button>
</Row> </Row>
<Table border :loading="loading" class="tableInfoBox" stripe :columns="columns" :data="data" sortable="custom" ref="table"></Table> <Table :loading="loading" class="tableInfoBox" stripe :columns="columns" :data="data" sortable="custom" ref="table"></Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page> <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
</Row> </Row>
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
handleFee: 0, handleFee: 0,
refundNums: 0, refundNums: 0,
transferPre: true, transferPre: true,
cancelPorder: true cancelPorder: true
}, },
searchForm: { searchForm: {
pageNumber: 1, pageNumber: 1,
...@@ -139,26 +139,32 @@ export default { ...@@ -139,26 +139,32 @@ export default {
message: "请输入手续费费用", message: "请输入手续费费用",
}, ] }, ]
}, },
columns: [ columns: [{
{
title: "ID", title: "ID",
key: "id", key: "id",
minWidth: 105, minWidth: 55,
}, },
{ {
title: "任务名称", title: "任务名称",
key: "name", key: "name",
minWidth: 105, minWidth: 185,
}, },
{ {
title: "任务内容", title: "任务内容",
key: "contentString", key: "contentString",
minWidth: 335, minWidth: 435,
render: (h, params) => {
return h("div", {
domProps: {
innerHTML: params.row.contentString
}
})
},
}, },
{ {
title: "状态", title: "状态",
key: "status", key: "status",
minWidth: 55, minWidth: 105,
render: (h, params) => { render: (h, params) => {
if (params.row.status == 'notexec') { if (params.row.status == 'notexec') {
return h("div", [ return h("div", [
...@@ -207,22 +213,22 @@ export default { ...@@ -207,22 +213,22 @@ export default {
{ {
title: "执行次数", title: "执行次数",
key: "execNums", key: "execNums",
minWidth: 55, minWidth: 85,
}, },
{ {
title: "创建人", title: "创建人",
key: "createBy", key: "createBy",
minWidth: 55, minWidth: 105,
}, },
{ {
title: "创建日期", title: "创建日期",
key: "createdAt", key: "createdAt",
minWidth: 125, minWidth: 175,
}, },
{ {
title: "更新日期", title: "更新日期",
key: "updatedAt", key: "updatedAt",
minWidth: 125, minWidth: 175,
}, },
{ {
title: "操作", title: "操作",
...@@ -235,17 +241,17 @@ export default { ...@@ -235,17 +241,17 @@ export default {
let edit = ""; let edit = "";
let del = ""; let del = "";
if (params.row.status != 'finish') { if (params.row.status != 'finish') {
execJob = h("span",[h( execJob = h("span", [h(
"a", { "a", {
on: { on: {
click: () => { click: () => {
this.exec(params.row); this.exec(params.row);
},
}, },
}, },
}, "手动执行"
"手动执行" ),
), h("divider", {
h("divider", {
props: { props: {
type: "vertical", type: "vertical",
}, },
...@@ -268,13 +274,13 @@ export default { ...@@ -268,13 +274,13 @@ export default {
}, },
}), }),
h( h(
"a", { "a", {
on: { on: {
click: () => { click: () => {
this.del(params.row); this.del(params.row);
},
}, },
}, }, "删除"
}, "删除"
), ),
h("divider", { h("divider", {
props: { props: {
...@@ -300,8 +306,7 @@ export default { ...@@ -300,8 +306,7 @@ export default {
}, },
} }
], ],
orderColumns: [ orderColumns: [{
{
title: "品牌", title: "品牌",
key: "bCnName", key: "bCnName",
minWidth: 145, minWidth: 145,
...@@ -535,7 +540,7 @@ export default { ...@@ -535,7 +540,7 @@ export default {
this.submitloading = true; this.submitloading = true;
// 添加 // 添加
if (this.type == 0) { if (this.type == 0) {
if(this.form.taskId){ if (this.form.taskId) {
this.form.taskId = ''; this.form.taskId = '';
} }
addSorderRefundTask(this.form).then((res) => { addSorderRefundTask(this.form).then((res) => {
...@@ -562,10 +567,10 @@ export default { ...@@ -562,10 +567,10 @@ export default {
} }
}); });
}, },
cleanAll(){ cleanAll() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.selectRowData = []; this.selectRowData = [];
this.searchData =[]; this.searchData = [];
}, },
exec(v) { exec(v) {
this.$Modal.confirm({ this.$Modal.confirm({
......
.url-remark {
font-size: 14px;
color: #515a6e;
display: block;
color: #9a9a9a;
margin-bottom: -16px;
font-style: italic;
}
\ No newline at end of file
<style lang="less">
@import "@/styles/table-common.less";
@import "./sorders-refund.less";
</style>
<template>
<div class="search">
<Card>
<Row>
<Button @click="add" type="primary" size="large" icon="md-add">添加任务</Button>
</Row>
<Table :loading="loading" class="tableInfoBox" stripe :columns="columns" :data="data" sortable="custom" ref="table"></Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
<Drawer title="任务添加" v-model="showAddSorderTask" width="720" draggable @on-close="closeDrawer">
<div :style="{ maxHeight: maxHeight }" class="drawer-content">
<Form ref="form" :model="form" :rules="formValidate" label-position="top">
<FormItem label="任务名称" prop="name">
<Input v-model="form.name" autocomplete="off" :maxlength="16" />
</FormItem>
<FormItem label="销售订单号" prop="orderNo">
<Button @click="searchSorderNo" type="primary" size="large" icon="md-search">查询</Button>
<Table class="tableInfoBox" v-model="selectRowVisible" :columns="selectRowColumns" :data="selectRowData" @on-selection-change="showSelect" sortable="custom" ref="table"></Table>
</FormItem>
<FormItem label="期货退货数量" prop="refundNums">
<Tooltip trigger="hover" placement="right">
<InputNumber :max="form.maxRefundNums" :min="1" v-model="form.futuresNum"></InputNumber>
</Tooltip>
</FormItem>
<FormItem label="手续费费用" prop="handleFee">
<Tooltip trigger="hover" placement="right">
<Input v-model="form.handleFee"></Input>
</Tooltip>
</FormItem>
<FormItem label="是否转预存" prop="transferPre">
<i-switch size="large" v-model="form.transferPre">
<span slot="open">转预存</span>
<span slot="close">退款</span>
</i-switch>
</FormItem>
</Form>
</div>
<div class="br">
<Button type="primary" :loading="submitLoading" @click="submit">提交</Button>
<Button @click="showAddSorderTask = false">取消</Button>
</div>
</Drawer>
<Modal draggable class="operation" title="销售订单" v-model="orderModalVisible" :mask-closable="false" :width="1500" :styles="{ top: '30px' }">
<Card>
<Form ref="searchSorderForm" :model="searchSorderForm" inline :label-width="70">
<FormItem label="用户名" prop="nickname">
<Input type="text" v-model="searchSorderForm.orderNo" clearable placeholder="订单编号" style="width: 200px" />
</FormItem>
<FormItem style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button>
</FormItem>
</Form>
<Table :loading="searchLoading" class="tableInfoBox" stripe :columns="orderColumns" :data="searchData" sortable="custom" ref="table"></Table>
</Card>
</Modal>
<Modal draggable class="operation" title="任务日志" v-model="logModalVisible" :mask-closable="false" :width="1500" :styles="{ top: '30px' }">
<Card>
<Table :show-header="false" :loading="searchLoading" class="tableInfoBox" stripe :columns="logColumns" :data="logData" sortable="custom" ref="table"></Table>
</Card>
</Modal>
</div>
</template>
<script>
import {
getRhawnSordersRefundTask,
getRhawnSordersDataDetail,
getRhawnSordersStock,
addRhawnSorderRefundTask,
execRhawnSordersRefundTask,
delRhawnSorderRefundTask,
getRhawnSorderRefundTaskLogs,
getRhawnSordersDetail,
editRhawnSorderRefundTask
} from "@/api/index";
import util from "@/libs/util.js";
export default {
name: "menu-manage",
components: {},
data() {
return {
loading: false,
searchLoading: false,
maxHeight: "500px",
type: 0,
form: {
name: '',
orderNo: '',
itemId: 0,
pId: 0,
handleFee: 0,
refundNums: [],
transferPre: true,
futuresNum: 0
},
searchForm: {
pageNumber: 1,
pageSize: 10,
page: 1,
},
searchSorderForm: {
pageNumber: 1,
pageSize: 10,
page: 1,
},
formValidate: {
// 表单验证规则
name: [{
required: true,
message: "请输入任务名称",
trigger: 'blur',
}, ],
orderNo: [{
required: true,
message: "请输入订单编号",
}, ],
futuresNum: [{
required: true,
message: "请输入退货数量",
}, ],
handleFee: [{
required: true,
message: "请输入手续费费用",
}, ]
},
columns: [{
title: "ID",
key: "id",
minWidth: 55,
},
{
title: "任务名称",
key: "name",
minWidth: 185,
},
{
title: "任务内容",
key: "contentString",
minWidth: 435,
render: (h, params) => {
return h("div", {
domProps: {
innerHTML: params.row.contentString
}
})
},
},
{
title: "状态",
key: "status",
minWidth: 105,
render: (h, params) => {
if (params.row.status == 'notexec') {
return h("div", [
h("Badge", {
props: {
status: "default",
text: "未执行",
},
}),
]);
} else if (params.row.status == 'running') {
return h("div", [
h("Badge", {
props: {
status: "processing",
text: "执行中",
},
}),
]);
} else if (params.row.status == 'error') {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "报错",
},
}),
]);
} else if (params.row.status == 'finish') {
return h("div", [
h("Badge", {
props: {
status: "success",
text: "已完成",
},
}),
]);
}
},
},
{
title: "错误信息",
key: "errorMessage",
minWidth: 325,
},
{
title: "执行次数",
key: "execNums",
minWidth: 85,
},
{
title: "创建人",
key: "createBy",
minWidth: 105,
},
{
title: "创建日期",
key: "createdAt",
minWidth: 175,
},
{
title: "更新日期",
key: "updatedAt",
minWidth: 175,
},
{
title: "操作",
key: "action",
width: 270,
align: "center",
fixed: "right",
render: (h, params) => {
let execJob = "";
let edit = "";
let del = "";
if (params.row.status != 'finish') {
execJob = h("span", [h(
"a", {
on: {
click: () => {
this.exec(params.row);
},
},
},
"手动执行"
),
h("divider", {
props: {
type: "vertical",
},
}),
]);
}
if (params.row.status == 'notexec') {
edit = h("span", [h(
"a", {
on: {
click: () => {
this.edit(params.row);
},
},
}, "编辑"
),
h("divider", {
props: {
type: "vertical",
},
}),
h(
"a", {
on: {
click: () => {
this.del(params.row);
},
},
}, "删除"
),
h("divider", {
props: {
type: "vertical",
},
}),
]);
}
return h("div", [
execJob,
edit,
h(
"a", {
on: {
click: () => {
this.showLog(params.row);
},
},
},
"查看日志"
)
]);
},
}
],
orderColumns: [{
title: "品牌",
key: "bCnName",
minWidth: 145,
},
{
title: "成品编号",
key: "pCode",
minWidth: 235,
},
{
title: "cas",
key: "cCas",
minWidth: 235,
},
{
title: "产品名称",
key: "pCnName",
minWidth: 125,
},
{
title: "销售价格",
key: "siPrice",
minWidth: 125,
},
{
title: "折扣价",
key: "siDiscount",
minWidth: 125,
},
{
title: "交期",
key: "siPTod",
minWidth: 125,
},
{
title: "数量",
key: "siNum",
minWidth: 125,
},
{
title: "小计",
key: "siAmount",
minWidth: 125,
},
{
title: "抵扣金额",
key: "siVamount",
minWidth: 125,
},
{
title: "备注",
key: "siNote",
minWidth: 125,
},
{
title: "操作",
key: "action",
width: 270,
align: "center",
fixed: 'right',
render: (h, params) => {
return h("div", [
h(
"a", {
on: {
click: () => {
this.selectRow(params.row);
},
},
},
"选择此项"
),
]);
},
}
],
selectRowColumns: [{
type: "selection",
width: 60,
align: "center",
},
{
title: "批次编号",
key: "pstkNo",
minWidth: 125,
},
{
title: "产品名称",
key: "pCnName",
minWidth: 125,
},
{
title: "发货数量",
key: "dpdNum",
minWidth: 125,
},
{
title: "退货数量",
key: "refundNums",
minWidth: 125,
fixed: "right",
render: (h, params) => {
let refundNums = parseInt(params.row.refundNums)
return h(
"InputNumber", {
props: {
type: 'text',
value: refundNums,
max: params.row.dpdNum,
min: 0
},
on: {
'on-change': e => {
this.changeRefundNums(params, e);
}
}
},
);
},
},
],
logColumns: [{
type: "index",
width: 60,
align: "center",
},
{
title: "日志内容故",
key: "content",
minWidth: 235,
},
],
submitLoading: false,
data: [],
selectRowData: [],
selectedOrderId: 0,
searchData: [],
logData: [],
total: 0,
showAddSorderTask: false,
orderModalVisible: false,
selectRowVisible: false,
logModalVisible: false,
stockModalVisible: false,
};
},
methods: {
init() {
this.getDataList();
},
searchSorderNo() {
this.searchLoading = false;
this.orderModalVisible = true;
},
handleSearch() {
this.searchSorderForm.pageNumber = 1;
this.searchSorderForm.pageSize = 10;
this.searchSorderForm.buttonAction = 'search'
this.getSorderDetail();
},
handleReset() {
this.$refs.searchSorderForm.resetFields();
this.searchSorderForm.pageNumber = 1;
this.searchSorderForm.pageSize = 10;
// 重新加载数据
this.getSorderDetail();
},
getDataList() {
this.loading = true;
getRhawnSordersRefundTask(this.searchForm).then((res) => {
this.loading = false;
if (res.status == 'success') {
this.data = res.data.list;
this.total = res.data.total;
if (this.data.length == 0 && this.searchForm.pageNumber > 1) {
this.searchForm.pageNumber -= 1;
this.getDataList();
}
}
});
},
getSorderDetail() {
this.searchLoading = true;
getRhawnSordersDataDetail({
'orderNo': this.searchSorderForm.orderNo
}).then((res) => {
this.searchLoading = false;
if (res.status == 'success') {
this.searchData = res.data;
if (this.searchData.length == 0 && this.searchSorderForm.pageNumber > 1) {
this.searchSorderForm.pageNumber -= 1;
this.searchSorderForm.page = res.data.page
this.getSorderDetail();
}
}
});
},
changeRefundNums(p, e) {
if (e != null) {
this.selectRowData[p.index].refundNums = e
}
},
selectRow(v) {
this.orderModalVisible = false
if (v) {
this.stockModalVisible = true
this.searchLoading = true;
if (this.selectedOrderId != v.soNo) {
this.selectRowData = []
this.selectedOrderId = v.soNo
}
getRhawnSordersStock({
'orderItemId': v.siId
}).then((res) => {
this.searchLoading = false;
if (res.status == 'success') {
let rowData = {}
if (res.data.length > 0) {
for (let row in res.data) {
rowData = res.data[row]
rowData.orderNo = v.soNo
rowData.pCode = v.pCode
rowData.pCnName = v.pCnName
rowData.refundNums = rowData.dpdNum
this.selectRowData.push(rowData)
}
}
this.form.orderNo = v.soNo
this.form.itemId = v.siId
this.form.pId = v.pId
this.selectRowVisible = true
}
});
}
},
showSelect(e) {
this.form.refundNums = []
if (e.length > 0) {
for (let row in e) {
if (e[row].refundNums > e[row].dpdNum) {
this.$Message.error("退货数量大于发货数量");
return false;
}
this.form.refundNums.push(e[row].pstkId + '|' + e[row].refundNums)
}
}
},
changePage(v) {
this.searchForm.pageNumber = v;
this.searchForm.page = v;
this.getDataList();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
add() {
this.showAddSorderTask = true;
},
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitloading = true;
// 添加
if (this.type == 0) {
if (this.form.taskId) {
this.form.taskId = '';
}
addRhawnSorderRefundTask(this.form).then((res) => {
this.submitloading = false;
if (res.status == 'success') {
this.$Message.success("操作成功");
this.$emit("on-submit", true);
this.getDataList()
}
});
} else {
editRhawnSorderRefundTask(this.form).then((res) => {
this.submitloading = false;
if (res.status == 'success') {
this.$Message.success("操作成功");
this.$emit("on-submit", true);
this.getDataList()
}
});
}
this.showAddSorderTask = false;
this.cleanAll()
}
});
},
cleanAll() {
this.$refs.form.resetFields();
this.selectRowData = [];
this.searchData = [];
},
exec(v) {
this.$Modal.confirm({
title: "确认手动执行",
content: "您确认要手动执行该任务? 执行后不能进行编辑及删除",
loading: true,
onOk: () => {
this.form.taskId = v.id
execRhawnSordersRefundTask(this.form).then((res) => {
this.submitLoading = false;
this.$Modal.remove();
if (res.status == 'success') {
this.$Message.success("操作成功");
this.$emit("on-submit", true);
this.showAddSorderTask = false;
}
this.getDataList()
});
},
});
},
del(v) {
this.$Modal.confirm({
title: "确认删除该记录",
content: "您确认要删除该任务? 执行后数据不可恢复",
loading: true,
onOk: () => {
this.form.taskId = v.id
delRhawnSorderRefundTask(this.form).then((res) => {
this.submitLoading = false;
this.$Modal.remove();
if (res.status == 'success') {
this.$Message.success("操作成功");
this.$emit("on-submit", true);
}
this.getDataList()
});
},
});
},
edit(v) {
// 转换null为""
for (let attr in v) {
if (v[attr] == null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
let content = JSON.parse(data.execContent)
this.$refs.form.resetFields();
this.form.taskId = data.id
this.form.name = data.name
this.form.futuresNum = parseInt(content.futures_num)
this.form.transferPre = content.transfer_pre == 1 ? true : false
this.form.cancelPorder = content.cancel_porder == 1 ? true : false
this.form.handleFee = parseInt(content.handle_fee)
this.form.orderNo = content.order_no
this.form.itemId = content.item_id
this.form.pId = content.p_id
this.selectedOrderId = this.form.orderNo
getRhawnSordersDetail({
'taskId': v.id
}).then((res) => {
this.submitLoading = false;
if (res.status == 'success') {
for (let index in res.data) {
res.data[index]._checked = true
this.selectRowData.push(res.data[index])
this.showSelect([res.data[index]])
}
}
})
this.type = 1;
this.showAddSorderTask = true;
},
showLog(v) {
this.searchLoading = true;
this.logModalVisible = true
getRhawnSorderRefundTaskLogs({
'taskId': v.id
}).then((res) => {
this.searchLoading = false;
if (res.status == 'success') {
this.logData = res.data;
}
});
},
closeDrawer() {
this.form = {}
this.selectRowData = []
}
},
mounted() {
// 计算高度
let height = document.documentElement.clientHeight;
this.maxHeight = Number(height - 287) + "px";
this.init()
},
};
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment