|
@@ -2,8 +2,15 @@
|
|
|
<el-dialog
|
|
|
:title="!dataForm.id ? '新增' : '修改'"
|
|
|
:close-on-click-modal="false"
|
|
|
- :visible.sync="visible">
|
|
|
- <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
|
|
+ :visible.sync="visible"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :model="dataForm"
|
|
|
+ :rules="dataRule"
|
|
|
+ ref="dataForm"
|
|
|
+ @keyup.enter.native="dataFormSubmit()"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
<el-form-item label="店铺名称" prop="name">
|
|
|
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
|
|
</el-form-item>
|
|
@@ -14,10 +21,21 @@
|
|
|
<el-input v-model="dataForm.secret" placeholder="secret"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="SESSION" prop="sessionKey">
|
|
|
- <el-input v-model="dataForm.sessionKey" placeholder="sessionkey"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="dataForm.sessionKey"
|
|
|
+ placeholder="sessionkey"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="vendor" prop="vendor">
|
|
|
+ <el-input v-model="dataForm.vendor" placeholder="vendor"></el-input>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item label="所属机构">
|
|
|
- <el-popover ref="dtListPopover" placement="bottom-start" trigger="click">
|
|
|
+ <el-popover
|
|
|
+ ref="dtListPopover"
|
|
|
+ placement="bottom-start"
|
|
|
+ trigger="click"
|
|
|
+ >
|
|
|
<el-tree
|
|
|
:data="dtList"
|
|
|
:props="dtListTreeProps"
|
|
@@ -39,7 +57,10 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所属平台" prop="pfName">
|
|
|
- <el-select v-model="dataForm.blonPlantform" placeholder="请选择所属平台">
|
|
|
+ <el-select
|
|
|
+ v-model="dataForm.blonPlantform"
|
|
|
+ placeholder="请选择所属平台"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in pfs"
|
|
|
:key="item.id"
|
|
@@ -50,10 +71,16 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="回调用户名" prop="aliCbUser">
|
|
|
- <el-input v-model="dataForm.aliCbUser" placeholder="飞猪回调接口用户"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="dataForm.aliCbUser"
|
|
|
+ placeholder="飞猪回调接口用户"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="回调密码" prop="aliCbUserPass">
|
|
|
- <el-input v-model="dataForm.aliCbUserPass" placeholder="飞猪回调接口用户密码"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="dataForm.aliCbUserPass"
|
|
|
+ placeholder="飞猪回调接口用户密码"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -64,137 +91,144 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { treeDataTranslate } from '@/utils'
|
|
|
+import { treeDataTranslate } from "@/utils";
|
|
|
export default {
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
dataForm: {
|
|
|
id: 0,
|
|
|
- name: '',
|
|
|
- appKey: '',
|
|
|
- secret: '',
|
|
|
- sessionKey: '',
|
|
|
- blonPlantform: '',
|
|
|
- dtId: '',
|
|
|
- aliCbUser: '',
|
|
|
- aliCbUserPass: '',
|
|
|
- pfName: '',
|
|
|
- dtName: ''
|
|
|
+ name: "",
|
|
|
+ appKey: "",
|
|
|
+ secret: "",
|
|
|
+ sessionKey: "",
|
|
|
+ vendor: null,
|
|
|
+ blonPlantform: "",
|
|
|
+ dtId: "",
|
|
|
+ aliCbUser: "",
|
|
|
+ aliCbUserPass: "",
|
|
|
+ pfName: "",
|
|
|
+ dtName: ""
|
|
|
},
|
|
|
dtListTreeProps: {
|
|
|
- label: 'name',
|
|
|
- children: 'children'
|
|
|
+ label: "name",
|
|
|
+ children: "children"
|
|
|
},
|
|
|
pfs: [],
|
|
|
dts: [],
|
|
|
dtList: [],
|
|
|
dataRule: {
|
|
|
- name: [
|
|
|
- { required: true, message: '名称不能为空', trigger: 'blur' }
|
|
|
- ],
|
|
|
+ name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
|
|
appKey: [
|
|
|
- { required: true, message: 'APPKEY不能为空', trigger: 'blur' }
|
|
|
+ { required: true, message: "APPKEY不能为空", trigger: "blur" }
|
|
|
],
|
|
|
secret: [
|
|
|
- { required: true, message: 'SECRET不能为空', trigger: 'blur' }
|
|
|
+ { required: true, message: "SECRET不能为空", trigger: "blur" }
|
|
|
],
|
|
|
sessionKey: [
|
|
|
- { required: true, message: 'SESSION不能为空', trigger: 'blur' }
|
|
|
+ { required: true, message: "SESSION不能为空", trigger: "blur" }
|
|
|
]
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
methods: {
|
|
|
// 所属銷售平台
|
|
|
pfChangeHandel(value) {
|
|
|
- this.dataForm.blonPlantform = value.id
|
|
|
- this.dataForm.pfName = value.label
|
|
|
+ this.dataForm.blonPlantform = value.id;
|
|
|
+ this.dataForm.pfName = value.label;
|
|
|
},
|
|
|
// 分销商树选中
|
|
|
dtListTreeCurrentChange(data, node) {
|
|
|
- this.dataForm.dtId = data.id
|
|
|
- this.dataForm.dtName = data.name
|
|
|
+ this.dataForm.dtId = data.id;
|
|
|
+ this.dataForm.dtName = data.name;
|
|
|
},
|
|
|
// 分销商设置当前选中节点
|
|
|
dtListTreeSetCurrentNode() {
|
|
|
if (this.dataForm.dtId != null) {
|
|
|
- this.$refs.dtTree.setCurrentKey(this.dataForm.dtId)
|
|
|
- this.dataForm.dtName = (this.$refs.dtTree.getCurrentNode() || {})['name']
|
|
|
+ this.$refs.dtTree.setCurrentKey(this.dataForm.dtId);
|
|
|
+ this.dataForm.dtName = (this.$refs.dtTree.getCurrentNode() || {})[
|
|
|
+ "name"
|
|
|
+ ];
|
|
|
}
|
|
|
},
|
|
|
- init (id) {
|
|
|
- this.dataForm.id = id || 0
|
|
|
+ init(id) {
|
|
|
+ this.dataForm.id = id || 0;
|
|
|
this.$http({
|
|
|
- url: this.$http.adornUrl('/op/group/dtpf'),
|
|
|
- method: 'get'
|
|
|
- }).then(({ data }) => {
|
|
|
- this.dtList = treeDataTranslate(data.dts, 'id')
|
|
|
- this.pfs = data.spfs
|
|
|
- if (this.pfs.length > 0) {
|
|
|
- this.dataForm.blonPlantform = this.pfs[0].id
|
|
|
- }
|
|
|
- }).then(() => {
|
|
|
- this.visible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['dataForm'].resetFields()
|
|
|
- if (this.dataForm.id) {
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl(`/dt/store/info/${this.dataForm.id}`),
|
|
|
- method: 'get',
|
|
|
- params: this.$http.adornParams()
|
|
|
- }).then(({data}) => {
|
|
|
- if (data && data.code === 0) {
|
|
|
- this.dataForm.name = data.store.name
|
|
|
- this.dataForm.appKey = data.store.appKey
|
|
|
- this.dataForm.secret = data.store.secret
|
|
|
- this.dataForm.sessionKey = data.store.sessionKey
|
|
|
- this.dataForm.blonPlantform = data.store.blonPlantform
|
|
|
- this.dataForm.dtId = data.store.dtId
|
|
|
- this.dataForm.aliCbUser = data.store.aliCbUser
|
|
|
- this.dataForm.aliCbUserPass = data.store.aliCbUserPass
|
|
|
- }
|
|
|
- })
|
|
|
+ url: this.$http.adornUrl("/op/group/dtpf"),
|
|
|
+ method: "get"
|
|
|
+ })
|
|
|
+ .then(({ data }) => {
|
|
|
+ this.dtList = treeDataTranslate(data.dts, "id");
|
|
|
+ this.pfs = data.spfs;
|
|
|
+ if (this.pfs.length > 0) {
|
|
|
+ this.dataForm.blonPlantform = this.pfs[0].id;
|
|
|
}
|
|
|
})
|
|
|
- })
|
|
|
+ .then(() => {
|
|
|
+ this.visible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs["dataForm"].resetFields();
|
|
|
+ if (this.dataForm.id) {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/dt/store/info/${this.dataForm.id}`),
|
|
|
+ method: "get",
|
|
|
+ params: this.$http.adornParams()
|
|
|
+ }).then(({ data }) => {
|
|
|
+ if (data && data.code === 0) {
|
|
|
+ this.dataForm.name = data.store.name;
|
|
|
+ this.dataForm.appKey = data.store.appKey;
|
|
|
+ this.dataForm.secret = data.store.secret;
|
|
|
+ this.dataForm.sessionKey = data.store.sessionKey;
|
|
|
+ this.dataForm.vendor = data.store.vendor;
|
|
|
+ this.dataForm.blonPlantform = data.store.blonPlantform;
|
|
|
+ this.dataForm.dtId = data.store.dtId;
|
|
|
+ this.dataForm.aliCbUser = data.store.aliCbUser;
|
|
|
+ this.dataForm.aliCbUserPass = data.store.aliCbUserPass;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
// 表单提交
|
|
|
- dataFormSubmit () {
|
|
|
- this.$refs['dataForm'].validate((valid) => {
|
|
|
+ dataFormSubmit() {
|
|
|
+ this.$refs["dataForm"].validate(valid => {
|
|
|
if (valid) {
|
|
|
this.$http({
|
|
|
- url: this.$http.adornUrl(`/dt/store/${!this.dataForm.id ? 'save' : 'update'}`),
|
|
|
- method: 'post',
|
|
|
+ url: this.$http.adornUrl(
|
|
|
+ `/dt/store/${!this.dataForm.id ? "save" : "update"}`
|
|
|
+ ),
|
|
|
+ method: "post",
|
|
|
data: this.$http.adornData({
|
|
|
- 'id': this.dataForm.id || undefined,
|
|
|
- 'name': this.dataForm.name,
|
|
|
- 'appKey': this.dataForm.appKey,
|
|
|
- 'secret': this.dataForm.secret,
|
|
|
- 'sessionKey': this.dataForm.sessionKey,
|
|
|
- 'blonPlantform': this.dataForm.blonPlantform,
|
|
|
- 'dtId': this.dataForm.dtId,
|
|
|
- 'aliCbUser': this.dataForm.aliCbUser,
|
|
|
- 'aliCbUserPass': this.dataForm.aliCbUserPass,
|
|
|
+ id: this.dataForm.id || undefined,
|
|
|
+ name: this.dataForm.name,
|
|
|
+ appKey: this.dataForm.appKey,
|
|
|
+ secret: this.dataForm.secret,
|
|
|
+ sessionKey: this.dataForm.sessionKey,
|
|
|
+ vendor: this.dataForm.vendor,
|
|
|
+ blonPlantform: this.dataForm.blonPlantform,
|
|
|
+ dtId: this.dataForm.dtId,
|
|
|
+ aliCbUser: this.dataForm.aliCbUser,
|
|
|
+ aliCbUserPass: this.dataForm.aliCbUserPass
|
|
|
})
|
|
|
- }).then(({data}) => {
|
|
|
+ }).then(({ data }) => {
|
|
|
if (data && data.code === 0) {
|
|
|
this.$message({
|
|
|
- message: '操作成功',
|
|
|
- type: 'success',
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
duration: 1500,
|
|
|
onClose: () => {
|
|
|
- this.visible = false
|
|
|
- this.$emit('refreshDataList')
|
|
|
+ this.visible = false;
|
|
|
+ this.$emit("refreshDataList");
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.$message.error(data.msg)
|
|
|
+ this.$message.error(data.msg);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|