往来单位

master
anthonyywj2 3 years ago
parent 49438d04cb
commit 54ffff5b38

3878
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -34,5 +34,18 @@ export function linkPlatform(query) {
}); });
} }
export function getPlatformBusTypes(query) {
return axios({
url: "/udims/platform/getPlatformBusTypes",
method: "get",
params: query
});
}

@ -135,3 +135,13 @@ export function orderDetail(query) {
) )
} }
export function updateSpms(query) {
return axios(
{
url: "/warehouse/inout/order/updateSpms",
method: "post",
data: query
}
);
}

@ -14,10 +14,12 @@
@click="onReset" @click="onReset"
></el-button> ></el-button>
<el-button type="primary" icon="search" @click="getList" <el-button type="primary" icon="search" @click="getList"
>查询</el-button >查询
</el-button
> >
<el-button type="primary" icon="search" @click="handleAddClick" <el-button type="primary" icon="search" @click="handleAddClick"
>添加往来单位信息</el-button >添加往来单位信息
</el-button
> >
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
@ -54,19 +56,22 @@
type="text" type="text"
size="small" size="small"
@click.native.stop="handleModifyClick(scope.row)" @click.native.stop="handleModifyClick(scope.row)"
>编辑</el-button >编辑
</el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="handleLinkClick(scope.row)" @click.native.stop="handleLinkClick(scope.row)"
>关联自助平台</el-button >关联自助平台
</el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="deleteDialog(scope.row)" @click.native.stop="deleteDialog(scope.row)"
>删除</el-button >删除
</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
@ -141,45 +146,146 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="cancelDialog" size="small">取消</el-button> <el-button @click.native="cancelDialog" size="small">取消</el-button>
<el-button type="primary" size="small" @click.native="formSubmit()" <el-button type="primary" size="small" @click.native="formSubmit()"
>提交</el-button >提交
</el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
:title="editTypeMap[editType]" :title="editTypeMap[editType]"
:visible.sync="editLoginVisible" :visible.sync="editLoginVisible"
width="60%" width="70%"
> >
<el-form :model="editLogin" ref="editLogin" :rules="platformRules"> <el-form :model="editLogin" ref="editSumit" :rules="platformRules">
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex"> <el-col :span="14" class="el-col" type="flex">
<div class="edit-text"> <div class="edit-text">
<el-form-item label="自助平台名称:" prop="platformId"> <!-- <el-form-item label="自助平台名称:" prop="platformId">-->
<!-- <el-select-->
<!-- v-model="editLogin.platformId"-->
<!-- style="width: 70%"-->
<!-- @change="intentPlatform"-->
<!-- placeholder="请选择自助平台"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in platformList"-->
<!-- :key="item.platformId"-->
<!-- :label="item.name"-->
<!-- :value="item.id"-->
<!-- >-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="自助平台名称" prop="thirdId">
<el-input
v-model="editLogin.platformName"
style="width: 70%"
size="small"
></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="4" class="el-col" type="flex" style="margin-top: 10px">
<el-button type="primary" icon="search" @click="handSelectPlat" size="mini"
>选择自助平台
</el-button
>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="18" class="el-col" type="flex">
<div class="text item">
<el-form-item label="本平台单据类型:" prop="targetAction">
<el-select <el-select
v-model="editLogin.platformId" v-model="editLogin.sourceAction"
style="width: 94%" style="width: 70%"
disabled
@change="intentPlatform" @change="intentPlatform"
placeholder="请选择自助平台" placeholder="请选择本平台单据类型"
> >
<el-option <el-option
v-for="item in platformList" v-for="item in busTypes"
:key="item.platformId" :key="item.action"
:label="item.name" :label="item.name"
:value="item.id" :value="item.action"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
</el-col> </el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="18" class="el-col" type="flex">
<div class="text item">
<el-form-item label="自助平台单据类型:" prop="targetAction">
<el-select
v-model="editLogin.targetAction"
style="width: 70%"
@change="intentPlatform"
placeholder="请选择自助平台单据类型"
>
<el-option
v-for="item in platTypes"
:key="item.action"
:label="item.name"
:value="item.action"
>
</el-option>
</el-select>
</el-form-item>
</div>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native.stop="cancelEditDialog" size="small">取消</el-button>
<el-button type="primary" size="small" @click.native="editSubmit()"
>提交
</el-button
>
</div>
</el-dialog>
<el-dialog title="选择自助平台" :visible.sync="platformVisible" width="35%">
<el-table
v-loading="loading"
@row-click="intentPlatform"
:data="platformList"
style="width: 100%"
>
<el-table-column
label="序号"
type="index"
width="80"
></el-table-column>
<el-table-column
label="自助平台名称"
prop="name"
width="140"
></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="loginDialog(scope.row)"
>选入
</el-button
>
</template>
</el-table-column>
</el-table>
</el-dialog>
</el-row> <el-dialog title="权限验证" :visible.sync="loginDialogVisible" ref="editLogin" width="35%">
<el-form>
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex"> <el-col :span="18" class="el-col" type="flex">
<div class="text item"> <div class="text item">
<el-form-item label="账号:" prop="platformUsername"> <el-form-item label="账号:" prop="platformUsername">
<el-input <el-input
:disabled="platformEdit"
v-model="editLogin.platformUsername" v-model="editLogin.platformUsername"
style="width: 80%" style="width: 80%"
size="small" size="small"
@ -190,47 +296,31 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex"> <el-col :span="18" class="el-col" type="flex">
<div class="text item"> <div class="text item">
<el-form-item label="密码:" prop="platformPassword"> <el-form-item label="密码:" prop="platformPassword">
<el-input <el-input
:disabled="platformEdit"
v-model="editLogin.platformPassword" v-model="editLogin.platformPassword"
style="width: 80%" style="width: 80%"
size="small" size="small"
type="password"
@input="change()" @input="change()"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native.stop="cancelDialog" size="small">取消</el-button> <el-button @click.native.stop="cancelDialog" size="small">取消</el-button>
<el-button type="primary" size="small" @click.native="linkSubmit()" <el-button type="primary" size="small" @click.native="linkSubmit()"
>提交</el-button >提交
</el-button
> >
</div> </div>
</el-dialog>
<el-dialog title="选择自助平台" :visible.sync="platformVisible" width="35%">
<el-table
v-loading="loading"
@row-click="intentPlatform"
:data="platformList"
style="width: 100%"
>
<el-table-column
label="序号"
type="index"
width="80"
></el-table-column>
<el-table-column
label="自助平台名称"
prop="name"
width="140"
></el-table-column>
</el-table>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -243,9 +333,11 @@ import {
deleteUnitMaintain, deleteUnitMaintain,
} from "../../api/receipts/unitMaintain"; } from "../../api/receipts/unitMaintain";
import { import {
getPlatform, getPlatform, getPlatformBusTypes,
linkPlatform, linkPlatform,
} from "../../api/auth/platform"; } from "../../api/auth/platform";
import {getBusType} from "@/api/warehouse/BusRole";
export default { export default {
data() { data() {
return { return {
@ -269,6 +361,8 @@ export default {
appid: null, appid: null,
appKey: null, appKey: null,
sceretKey: null, sceretKey: null,
targetAction: null,
sourceAction: null,
}, },
editPlatfromQuery: { editPlatfromQuery: {
id: null, id: null,
@ -279,32 +373,32 @@ export default {
editLoginVisible: false, editLoginVisible: false,
checked: false, checked: false,
editDialogVisible: false, editDialogVisible: false,
loginDialogVisible: false,
list: [], list: [],
platformList: [], platformList: [],
platTypes: [],
busTypes: [],
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
platformEdit: false,
rules: { rules: {
name: [ name: [
{ required: true, message: "请输入往来单位名称", trigger: "change" }, {required: true, message: "请输入往来单位名称", trigger: "change"},
], ],
spell: [ spell: [
{ required: true, message: "请输入往来单位简写", trigger: "change" }, {required: true, message: "请输入往来单位简写", trigger: "change"},
], ],
creditNo: [ creditNo: [
{ required: true, message: "请输入社会信用号", trigger: "change" }, {required: true, message: "请输入社会信用号", trigger: "change"},
], ],
}, },
platformRules: { platformRules: {
platformId: [ platformId: [
{ required: true, message: "请选择自助平台", trigger: "change" }, {required: true, message: "请选择自助平台", trigger: "change"},
], ],
userName: [ targetAction: [
{ required: true, message: "请输入账号", trigger: "change" }, {required: true, message: "请选择目标单据类型", trigger: "change"},
], ],
password: [
{ required: true, message: "请输入密码", trigger: "change" },
],
}, },
editType: 0, editType: 0,
editTypeMap: { editTypeMap: {
@ -370,23 +464,45 @@ export default {
}); });
} }
}) })
.catch(() => {}); .catch(() => {
});
}, },
cancelDialog() { cancelDialog() {
this.editDialogVisible = false; this.editDialogVisible = false;
this.editLoginVisible = false; this.loginDialogVisible = false;
this.platformVisible = false;
}, },
handleModifyClick(row) { handleModifyClick(row) {//
this.editType = 1; this.editType = 1;
this.editDialogVisible = true; this.editDialogVisible = true;
this.editQuery = row; this.editQuery = row;
}, },
handleLinkClick(row) { handleLinkClick(row) { //
this.platformEdit = false;
this.editType = 2; this.editType = 2;
this.editLogin = {
id: row.id,
platformId: row.platformId,
targetAction: row.targetAction,
sourceAction: row.sourceAction,
platformName:row.platformName,
};
if (row.secretKey == null) {
this.platformEdit = false;
}
this.editLogin.sourceAction = "SalesWareHouseOut";
this.getPlatformType(row.unitId);
this.editLoginVisible = true; this.editLoginVisible = true;
this.editLogin = row; },
handSelectPlat() {
this.platformVisible = true;
},
loginDialog(row) {
this.loginDialogVisible = true;
this.editLogin.platformId = row.id;
}, },
handleAddClick() { handleAddClick() {
this.editType = 0; this.editType = 0;
@ -432,7 +548,8 @@ export default {
this.$message.error(response.message); this.$message.error(response.message);
} }
}) })
.catch(() => {}); .catch(() => {
});
} else { } else {
modifyUnit(this.editQuery) modifyUnit(this.editQuery)
.then((response) => { .then((response) => {
@ -447,7 +564,8 @@ export default {
this.$message.error(response.message); this.$message.error(response.message);
} }
}) })
.catch(() => {}); .catch(() => {
});
} }
} }
}); });
@ -464,31 +582,52 @@ export default {
.then(() => { .then(() => {
this.deleteUnit(rowId); this.deleteUnit(rowId);
}) })
.catch(() => {}); .catch(() => {
});
}, },
linkSubmit() { linkSubmit() {
this.$refs["editLogin"].validate((valid) => {
if (valid) {
linkPlatform(this.editLogin) linkPlatform(this.editLogin)
.then((response) => { .then((response) => {
if (response.code == 20000) { if (response.code == 20000) {
this.getList();
this.$message({ this.$message({
type: "success", type: "success",
message: "关联成功", message: "关联成功",
}); });
this.cancelDialog(); this.cancelDialog();
this.getPlatformType();
} else { } else {
this.$message.error(response.message); this.$message.error(response.message);
} }
}) })
.catch(() => {}); .catch(() => {
});
},
editSubmit() {
modifyUnit(this.editLogin)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "修改成功",
});
this.editLoginVisible = false;
} else {
this.$message.error(response.message);
} }
})
.catch(() => {
}); });
}, },
cancelEditDialog() {
exportTxt() {}, this.editLoginVisible = false;
},
exportTxt() {
},
handleSelectionChange(val) { handleSelectionChange(val) {
console.log("----" + val); console.log("----" + val);
@ -499,11 +638,33 @@ export default {
this.query.page = val; this.query.page = val;
this.getList(); this.getList();
}, },
getPlatformType(id) {
let query = {unitId: id};
getPlatformBusTypes(query)
.then((response) => {
this.platTypes = response.data.list || [];
})
.catch(() => {
});
},
getBusType() {
let query = {};
getBusType(query)
.then((response) => {
this.busTypes = response.data.list || [];
})
.catch(() => {
});
},
},
mounted() {
}, },
mounted() {},
created() { created() {
this.getList(); this.getList();
this.getPlatformList(); this.getPlatformList();
this.getBusType();
var pinyin = require("pinyin"); var pinyin = require("pinyin");
console.log( console.log(
pinyin("中心", { pinyin("中心", {

@ -176,6 +176,15 @@
>删除 >删除
</el-button </el-button
> >
<el-button
type="text"
size="small"
:disabled="scope.row.uploadStatus == 1"
@click.native.stop="uploadSpms(scope.row)"
>提交
</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -309,7 +318,7 @@
</template> </template>
<script> <script>
import { import {
filterCode, filterCode,
codeList, codeList,
findAllByOrderId, findAllByOrderId,
@ -319,22 +328,22 @@
updateExportStatus, updateExportStatus,
uploadOrder, uploadOrder,
mergeOrder, mergeOrder,
orderDetail, orderDetail, updateSpms
} from "../../api/warehouse/order"; } from "../../api/warehouse/order";
import {unitListBykey} from "../../api/warehouse/unit"; import {unitListBykey} from "../../api/warehouse/unit";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import {saveAs} from "file-saver"; import {saveAs} from "file-saver";
import codeDetail from "./code"; import codeDetail from "./code";
import {getBusType} from "../../api/warehouse/BusRole"; import {getBusType} from "../../api/warehouse/BusRole";
const formJson = { const formJson = {
site_id: "", site_id: "",
site_name: "", site_name: "",
describe: "", describe: "",
ads: [], ads: [],
}; };
export default { export default {
props: { props: {
isSelect: { isSelect: {
type: Boolean, type: Boolean,
@ -521,6 +530,26 @@
.catch(() => { .catch(() => {
}); });
}, },
uploadSpms(row) {
let orderIds = [];
orderIds.push(row.orderId);
let query = {orderIds: orderIds};
updateSpms(query)
.then((response) => {
if (response.code == 20000) {
this.$message.success(response.data);
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
},
mergesOrders() { mergesOrders() {
var repeatData = this.multipleSelection; var repeatData = this.multipleSelection;
if (repeatData.length <= 1) { if (repeatData.length <= 1) {
@ -580,7 +609,7 @@
this.list = response.data.list || []; this.list = response.data.list || [];
this.detailList = []; this.detailList = [];
this.total = response.data.total || 0; this.total = response.data.total || 0;
console.log(this.total+"0000000000000000000"); console.log(this.total + "0000000000000000000");
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
@ -926,16 +955,16 @@
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end]; this.actDateRange = [start, end];
}, },
}; };
</script> </script>
<style> <style>
.el-table .warning-row { .el-table .warning-row {
background: #ffb5b5; background: #ffb5b5;
} }
.el-table .success-row { .el-table .success-row {
background: #ffffff; background: #ffffff;
} }
</style> </style>

Loading…
Cancel
Save