123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <template>
- <view>
- <my_form ref="form" :form="form" @isUncomplete="isUncomplete" requiredFieldOnly @interrupt="interrupt" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- sa_storeid: 0,
- form: []
- }
- },
- async onLoad() {
- uni.setNavigationBarTitle({
- title: '新增人员'
- });
- this.form = [{
- key: "storename",
- type: "text",
- label: "门店名称",
- isMust: true,//是否必填
- value: "",
- }, {
- key: "area",
- type: "text",
- label: "面积(m²)",
- isMust: true,//是否必填
- value: "",
- inputmode: 'digit',
- }, {
- key: "leader_hrid",
- type: "route",
- path: "/team/userCenter/selectUser?title=选择负责人",
- isRadio: true,
- label: "负责人姓名",
- isMust: true,//是否必填
- value: [],
- showValue: [],
- interrupt: true
- }, {
- key: "phonenumber",
- type: "text",
- label: "负责人电话",
- isMust: true,//是否必填
- value: "",
- inputmode: 'number',
- disabled: true,
- verify: [this.getReg("phonenumber")]
- }, {
- key: "sale_phonenmber",
- type: "text",
- label: "门店售前电话",
- isMust: false,//是否必填
- value: "",
- inputmode: 'number',
- verify: [this.getReg("phonenumber")]
- }, {
- key: "service_phonenmber",
- type: "text",
- label: "门店售后电话",
- isMust: false,//是否必填
- value: "",
- inputmode: 'number',
- verify: [this.getReg("phonenumber")]
- }, {
- key: "storetype",
- type: "radio",
- label: "门店类型",
- value: "直营",
- options: [{
- label: "直营",
- name: "直营",
- marginRight: 60
- }, {
- label: "分销",
- name: "分销",
- }]
- }, {
- key: "markettype",
- type: "customClass",
- label: "门店卖场类型",
- isMust: false,//是否必填
- isMultipleChoice: false,//是否多选
- value: '',// 多选[] 单选 ""
- list: await this.getCustomClass('storetype')
- }, {
- key: "selectMap",
- type: "route",
- path: "/select/place/index",
- label: "门店地址",
- isMust: true,//是否必填
- value: {},
- }];
- },
- methods: {
- isUncomplete(uncomplete) {
- this.uncomplete = uncomplete;
- },
- interrupt(item, selected, index) {
- console.log(item)
- console.log(selected)
- console.log(index)
- switch (item.key) {
- case "leader_hrid":
- item.showValue = [selected.name];
- item.value = [selected.sys_enterprise_hrid];
- this.$refs.form.setItem(index, item)
- this.$refs.form.setValue(index + 1, selected.phonenumber, true)
- break;
- }
- },
- submit() {
- this.loading = true;
- let that = this;
- this.$refs.form.submit().then(data => {
- this.$Http.basic({
- "id": 20240410095302,
- "content": {
- "sa_storeid": this.sa_storeid,
- ...data
- }
- }).then(res => {
- this.loading = false;
- 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)
- }
- })
- } 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',
- })
- }
- });
- })
- }
- })
- })
- },
- },
- onShow() {
- /* let a11 = {
- address: "浙江省嘉兴市南湖区望湖路585号",
- city: "嘉兴市",
- county: "南湖区",
- district: "南湖区",
- latitude: 30.74803,
- longitude: 120.786539,
- name: "翡翠花园",
- province: "浙江省"
- }
- if (location) {
- location.county = location.district;
- this.location = location;
- this.$refs.form.setValue(this.form.findIndex(v => v.label == '门店地址'), location.name || this.getCity(location))
- } */
- }
- }
- </script>
- <style></style>
|