|
|
@@ -1,6 +1,17 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <my_form ref="form" :form="form" @isUncomplete="isUncomplete" requiredFieldOnly @interrupt="interrupt" />
|
|
|
+ <my_form ref="form" :form="form" @onUploading="onUploading" @isUncomplete="isUncomplete" requiredFieldOnly
|
|
|
+ @interrupt="interrupt" />
|
|
|
+ <view style="height: 70px;" />
|
|
|
+ <view class="footer">
|
|
|
+ <view class="add" @click="uncomplete || loading ? '' : submit()" :class="uncomplete ? 'forbidden' : ''"
|
|
|
+ hover-class=" navigator-hover">
|
|
|
+ <u-loading-icon v-if="loading" />
|
|
|
+ <block v-else>
|
|
|
+ 提交
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -9,12 +20,14 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
sa_storeid: 0,
|
|
|
- form: []
|
|
|
+ form: [],
|
|
|
+ uncomplete: true,
|
|
|
+ loading: false,
|
|
|
}
|
|
|
},
|
|
|
async onLoad() {
|
|
|
uni.setNavigationBarTitle({
|
|
|
- title: '新增人员'
|
|
|
+ title: '新增门店'
|
|
|
});
|
|
|
this.form = [{
|
|
|
key: "storename",
|
|
|
@@ -90,14 +103,38 @@ export default {
|
|
|
type: "route",
|
|
|
path: "/select/place/index",
|
|
|
label: "门店地址",
|
|
|
+ keys: ["latitude", "longitude", "province", "city", "county", "address"],
|
|
|
+ isRadio: true,
|
|
|
+ showValue: [],
|
|
|
isMust: true,//是否必填
|
|
|
value: {},
|
|
|
+ }, {
|
|
|
+ key: "attachmentids",
|
|
|
+ type: "upload",
|
|
|
+ label: "门店照片",
|
|
|
+ accept: "image",
|
|
|
+ placeholder: "仅单张",
|
|
|
+ ownertable: "temporary",
|
|
|
+ ownerid: 999,
|
|
|
+ usetype: 'default',
|
|
|
+ allowUpload: true,
|
|
|
+ allowDelete: true,
|
|
|
+ maxCount: 1,
|
|
|
+ value: []
|
|
|
}];
|
|
|
},
|
|
|
methods: {
|
|
|
isUncomplete(uncomplete) {
|
|
|
this.uncomplete = uncomplete;
|
|
|
},
|
|
|
+ onUploading(e) {
|
|
|
+ if (e) {
|
|
|
+ this.copyUncomplete = this.uncomplete;
|
|
|
+ this.uncomplete = true;
|
|
|
+ } else {
|
|
|
+ this.uncomplete = this.copyUncomplete;
|
|
|
+ }
|
|
|
+ },
|
|
|
interrupt(item, selected, index) {
|
|
|
console.log(item)
|
|
|
console.log(selected)
|
|
|
@@ -109,6 +146,11 @@ export default {
|
|
|
this.$refs.form.setItem(index, item)
|
|
|
this.$refs.form.setValue(index + 1, selected.phonenumber, true)
|
|
|
break;
|
|
|
+ case "selectMap":
|
|
|
+ item.showValue = [selected.name];
|
|
|
+ item.value = selected;
|
|
|
+ this.$refs.form.setItem(index, item, true)
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
},
|
|
|
@@ -116,49 +158,49 @@ export default {
|
|
|
this.loading = true;
|
|
|
let that = this;
|
|
|
this.$refs.form.submit().then(data => {
|
|
|
+ data.leader_hrid = data.leader_hrid.value;
|
|
|
this.$Http.basic({
|
|
|
"id": 20240410095302,
|
|
|
"content": {
|
|
|
"sa_storeid": this.sa_storeid,
|
|
|
...data
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- this.loading = false;
|
|
|
- console.log("加入团队", res)
|
|
|
+ }).then(async res => {
|
|
|
+ console.log("创建门店", res)
|
|
|
if (this.cutoff(res.msg)) return;
|
|
|
- this.loading = true;
|
|
|
- if (this.attachmentids.length) {
|
|
|
- this.uploadCallback(this.attachmentids, "sys_users", this.userid).then(s => {
|
|
|
- if (s) getUserMsg()
|
|
|
- });
|
|
|
- if (this.headportraits.length) this.$Http.basic({
|
|
|
- "classname": "system.attachment.Attachment",
|
|
|
- "method": "deleteFileLink",
|
|
|
- "content": {
|
|
|
- linksids: this.headportraits.map(v => v.linksid)
|
|
|
+ if (data.files.temporarys.length) await this.$Http.basic({
|
|
|
+ "classname": "system.attachment.Attachment",
|
|
|
+ "method": "createFileLink",
|
|
|
+ "content": {
|
|
|
+ ownertable: 'sa_store',
|
|
|
+ ownerid: res.data.sa_storeid,
|
|
|
+ usetype: 'default',
|
|
|
+ attachmentids: data.files.temporarys
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (data.files.linksids.length) await this.$Http.basic({
|
|
|
+ "classname": "system.attachment.Attachment",
|
|
|
+ "method": "deleteFileLink",
|
|
|
+ "content": {
|
|
|
+ linksids: data.files.linksids
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.loading = false;
|
|
|
+ uni.showModal({
|
|
|
+ title: '创建成功',
|
|
|
+ content: '门店新增成功!是否立即前往',
|
|
|
+ cancelText: '返回',
|
|
|
+ confirmText: '立即前往',
|
|
|
+ success: ({ confirm }) => {
|
|
|
+ if (confirm) {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/store/center/detail?id=' + res.data.sa_storeid,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.navigateBack();
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
- } else {
|
|
|
- getUserMsg()
|
|
|
- }
|
|
|
- function getUserMsg() {
|
|
|
- that.$Http.wechatLogin().then(token => {
|
|
|
- that.loading = false;
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '成功加入团队',
|
|
|
- showCancel: false,
|
|
|
- confirmText: '确定',
|
|
|
- confirmColor: '#C40C24',
|
|
|
- success: ({ confirm }) => {
|
|
|
- if (confirm) uni.redirectTo({
|
|
|
- url: '/pages/index/index',
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- }
|
|
|
+ },
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
@@ -183,4 +225,32 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.footer {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100vw;
|
|
|
+ height: 65px;
|
|
|
+ background: #FFFFFF;
|
|
|
+ box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 5px 10px;
|
|
|
+
|
|
|
+ .add {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 100%;
|
|
|
+ height: 45px;
|
|
|
+ background: #C30D23;
|
|
|
+ border-radius: 5px;
|
|
|
+ font-family: PingFang SC, PingFang SC;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .forbidden {
|
|
|
+ opacity: .6;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|