|
|
@@ -8,7 +8,6 @@
|
|
|
:rules="ruleValidate" @submit.native.prevent>
|
|
|
<Row type="flex" :gutter="24">
|
|
|
<Col span="24">
|
|
|
- <Col v-bind="grid">
|
|
|
<FormItem label="头像:" prop="image">
|
|
|
<div class="picBox" @click="modalPicTap('image')">
|
|
|
<div class="pictrue" v-if="formItem.avatar"><img v-lazy="formItem.avatar"></div>
|
|
|
@@ -18,30 +17,28 @@
|
|
|
</div>
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- </Col>
|
|
|
<Col span="24">
|
|
|
- <Col v-bind="grid">
|
|
|
<FormItem label="姓名:" prop="name" label-for="name">
|
|
|
<Input v-model="formItem.name" placeholder="请输入姓名" />
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- </Col>
|
|
|
<Col span="24">
|
|
|
- <Col v-bind="grid">
|
|
|
<FormItem label="别名:" prop="name" label-for="alias">
|
|
|
<Input v-model="formItem.alias" placeholder="请输入别名" />
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- </Col>
|
|
|
<Col span="24">
|
|
|
- <Col v-bind="grid">
|
|
|
<FormItem label="手机号:" label-for="mobile" prop="mobile">
|
|
|
<Input v-model="formItem.mobile" placeholder="请输入手机号" />
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
+ <Col span="24">
|
|
|
+ <FormItem label="绑定用户:" label-for="mobile" prop="mobile">
|
|
|
+ <Button v-if="checkUser.nickname || checkUser.phone" style="margin-right: 20rpx;">昵称:{{checkUser.nickname || '暂无'}} 手机号:{{checkUser.phone || '暂无'}}</Button>
|
|
|
+ <Button type="primary" @click="chooseUser" >选择员工</Button>
|
|
|
+ </FormItem>
|
|
|
</Col>
|
|
|
<Col span="24" class="mt20">
|
|
|
- <Col v-bind="grid">
|
|
|
<FormItem label="性别:">
|
|
|
<RadioGroup v-model="formItem.gender">
|
|
|
<Radio :label="0">
|
|
|
@@ -55,23 +52,17 @@
|
|
|
</RadioGroup>
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- </Col>
|
|
|
<Col span="24">
|
|
|
- <Col v-bind="grid">
|
|
|
<FormItem label="职务:" label-for="position" prop="position">
|
|
|
<Input v-model="formItem.position" placeholder="请输入职务" />
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- </Col>
|
|
|
<Col span="24">
|
|
|
- <Col v-bind="grid">
|
|
|
<FormItem label="住址:" label-for="address" prop="address">
|
|
|
<Input v-model="formItem.address" placeholder="请输入住址" />
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- </Col>
|
|
|
<Col span="24">
|
|
|
- <Col v-bind="grid">
|
|
|
<FormItem label="部门:" label-for="main_department" prop="main_department">
|
|
|
<el-cascader placeholder="请选择部门" :options="departmentList"
|
|
|
:value="formItem.main_department" v-width="320"
|
|
|
@@ -79,7 +70,6 @@
|
|
|
@change="changeBm"></el-cascader>
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- </Col>
|
|
|
</Row>
|
|
|
<Row style="justify-content: space-around;">
|
|
|
<Col>
|
|
|
@@ -91,38 +81,21 @@
|
|
|
</Card>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
- <Modal
|
|
|
- v-model="modalPic"
|
|
|
- width="960px"
|
|
|
- scrollable
|
|
|
- footer-hide
|
|
|
- closable
|
|
|
- title="上传头像"
|
|
|
- :mask-closable="false"
|
|
|
- :z-index="1"
|
|
|
- >
|
|
|
- <uploadPictures
|
|
|
- :isChoice="isChoice"
|
|
|
- @getPic="getPic"
|
|
|
- :gridBtn="gridBtn"
|
|
|
- :gridPic="gridPic"
|
|
|
- v-if="modalPic"
|
|
|
- ></uploadPictures>
|
|
|
+ <Modal v-model="modalPic" width="960px" scrollable footer-hide closable title="上传头像" :mask-closable="false"
|
|
|
+ :z-index="1">
|
|
|
+ <uploadPictures :isChoice="isChoice" @getPic="getPic" :gridBtn="gridBtn" :gridPic="gridPic" v-if="modalPic">
|
|
|
+ </uploadPictures>
|
|
|
+ </Modal>
|
|
|
+ <Modal v-model="modals" title="用户列表" footerHide class="paymentFooter" scrollable width="900">
|
|
|
+ <user-list ref="userList" :goodsType="1" v-if="modals" @getUserId="getUserId" :serviceCard="1"></user-list>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- // import { keyApi} from '@/api/setting';
|
|
|
import uploadPictures from "@/components/uploadPictures";
|
|
|
- import goodsList from '@/components/goodsList'
|
|
|
+ import userList from "@/components/userList"
|
|
|
import {
|
|
|
- keyApi,
|
|
|
- storeGetInfoApi,
|
|
|
- cityApi,
|
|
|
- storeUpdateApi,
|
|
|
- cascaderList,
|
|
|
- staffListInfo,
|
|
|
getDepartmentList,
|
|
|
addYg,
|
|
|
editYg
|
|
|
@@ -136,8 +109,8 @@
|
|
|
export default {
|
|
|
name: 'systemSt',
|
|
|
components: {
|
|
|
- goodsList,
|
|
|
- uploadPictures
|
|
|
+ uploadPictures,
|
|
|
+ userList
|
|
|
},
|
|
|
props: {},
|
|
|
data() {
|
|
|
@@ -158,16 +131,17 @@
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
+ checkUser: {}, //选择的用户
|
|
|
+ modals: false, //用户弹窗
|
|
|
isEdit: 0, //0->添加 1->编辑
|
|
|
- staffData: [],
|
|
|
goodsList: [],
|
|
|
- modals: false,
|
|
|
treeSelect: [],
|
|
|
modalErp: false,
|
|
|
openErp: false,
|
|
|
isTemplate: false,
|
|
|
title: '',
|
|
|
formItem: {
|
|
|
+ uid: '',
|
|
|
name: '',
|
|
|
avatar: '',
|
|
|
mobile: '',
|
|
|
@@ -228,7 +202,8 @@
|
|
|
pid: 0,
|
|
|
isApi: 0,
|
|
|
add: 0,
|
|
|
- departmentList: []
|
|
|
+ departmentList: [],
|
|
|
+ isMobile: false,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -250,9 +225,6 @@
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState('admin/layout', [
|
|
|
- 'isMobile'
|
|
|
- ]),
|
|
|
labelWidth() {
|
|
|
return this.isMobile ? undefined : 120;
|
|
|
},
|
|
|
@@ -262,9 +234,15 @@
|
|
|
},
|
|
|
mounted: function() {},
|
|
|
methods: {
|
|
|
- handleRemove() {
|
|
|
- this.formValidate.avatar = '';
|
|
|
- // this.$refs.formValidate.validateField('image');
|
|
|
+ //获取用户id
|
|
|
+ getUserId(row) {
|
|
|
+ this.modals = false
|
|
|
+ this.formItem.uid = row.uid
|
|
|
+ this.checkUser = row
|
|
|
+ console.log(row, '用户id')
|
|
|
+ },
|
|
|
+ chooseUser() {
|
|
|
+ this.modals = true
|
|
|
},
|
|
|
changeBm(res) {
|
|
|
console.log(res);
|
|
|
@@ -277,54 +255,6 @@
|
|
|
this.departmentList = res.data
|
|
|
})
|
|
|
},
|
|
|
- userSearchs() {
|
|
|
- // this.orderData.page = 1;
|
|
|
- // this.searchList();
|
|
|
- },
|
|
|
-
|
|
|
- //对象数组去重;
|
|
|
- unique(arr) {
|
|
|
- const res = new Map();
|
|
|
- return arr.filter((arr) => !res.has(arr.product_id) && res.set(arr.product_id, 1))
|
|
|
- },
|
|
|
- getGoodsId(data) {
|
|
|
- let list = this.goodsList.concat(data);
|
|
|
- let uni = this.unique(list);
|
|
|
- this.goodsList = uni;
|
|
|
- this.$nextTick(res => {
|
|
|
- setTimeout(() => {
|
|
|
- this.modals = false
|
|
|
- }, 300)
|
|
|
- })
|
|
|
- },
|
|
|
- bindDelete(index) {
|
|
|
- this.goodsList.splice(index, 1)
|
|
|
- },
|
|
|
- // 门店分类;
|
|
|
- goodsCategory() {
|
|
|
- cascaderList(1).then(res => {
|
|
|
- this.treeSelect = res.data;
|
|
|
- }).catch(res => {
|
|
|
- this.$Message.error(res.msg);
|
|
|
- })
|
|
|
- },
|
|
|
- getProductId(id) {
|
|
|
- this.formItem.erp_shop_id = id;
|
|
|
- this.modalErp = false;
|
|
|
- this.$refs.formItem.validateField("erp_shop_id");
|
|
|
- },
|
|
|
- tapErp() {
|
|
|
- this.$refs.refErp.currentid = this.formItem.erp_shop_id;
|
|
|
- this.modalErp = true;
|
|
|
- this.$refs.formItem.validateField("erp_shop_id");
|
|
|
- },
|
|
|
- getErpConfig() {
|
|
|
- erpConfig().then(res => {
|
|
|
- this.openErp = res.data.open_erp;
|
|
|
- }).catch(err => {
|
|
|
- this.$Message.error(err.msg);
|
|
|
- })
|
|
|
- },
|
|
|
clearFrom() {
|
|
|
this.goodsList = [];
|
|
|
this.formItem = {
|
|
|
@@ -340,7 +270,6 @@
|
|
|
this.isApi = 0;
|
|
|
},
|
|
|
cancel() {
|
|
|
- console.log('关闭');
|
|
|
this.isTemplate = false;
|
|
|
this.clearFrom();
|
|
|
},
|
|
|
@@ -353,7 +282,6 @@
|
|
|
getPic(pc) {
|
|
|
this.formItem.avatar = pc.att_dir;
|
|
|
this.modalPic = false;
|
|
|
- // this.$refs.formItem.validateField("avatar")
|
|
|
},
|
|
|
// 提交
|
|
|
handleSubmit(name) {
|