| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590 |
- <template>
- <!-- 营销-积分商品 -->
- <div>
- <Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
- <div class="new_card_pd">
- <!-- 查询条件 -->
- <Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
- :label-position="labelPosition" @submit.native.prevent>
- <!-- <FormItem label="创建时间:" label-for="user_time">
- <DatePicker
- :editable="false"
- @on-change="onchangeTime"
- :value="timeVal"
- format="yyyy/MM/dd"
- type="datetimerange"
- placement="bottom-start"
- placeholder="自定义时间"
- class="mr20 input-add"
- :options="options"
- ></DatePicker>
- </FormItem> -->
- <!-- <FormItem label="上架状态:">
- <Select
- placeholder="请选择"
- clearable
- class="input-add"
- v-model="tableFrom.is_show"
- >
- <Option value="1">上架</Option>
- <Option value="0">下架</Option>
- </Select>
- </FormItem> -->
- <FormItem label="仓库:" prop="pid" label-for="pid">
- <Select v-model="tableFrom.wid" @on-change="userSearchs" clearable class="input-add">
- <Option v-for="item in data1" :value="item.id" :key="item.id">
- {{ item.title }}
- </Option>
- </Select>
- </FormItem>
- <FormItem label="门店:">
- <Select v-model="tableFrom.store_id" clearable filterable @on-change="userSearchs"
- class="input-add">
- <Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
- </Option>
- </Select>
- </FormItem>
- <FormItem label="创建人:">
- <Select v-model="tableFrom.create_uid" clearable filterable @on-change="userSearchs"
- class="input-add">
- <Option v-for="item in authList" :value="item.id" :key="item.id">{{ item.staff_name }}
- </Option>
- </Select>
- </FormItem>
- <!-- <FormItem label="用户搜索:" label-for="store_name">
- <Input class="input-add mr14" placeholder="请输入用户昵称/手机号" v-model="tableFrom.key" />
- <Button type="primary" @click="tableSearchs()">查询</Button>
- </FormItem> -->
- <!-- <Button
- v-auth="['marketing-store_seckill-create']"
- type="primary"
- icon="md-add"
- @click="addMore"
- class="mr10"
- >批量添加积分商品</Button
- > -->
- <!--<Button v-auth="['export-storeSeckill']" class="export" icon="ios-share-outline" @click="exports">导出</Button>-->
- </Form>
- </div>
- </Card>
- <Card :bordered="false" dis-hover class="ivu-mt">
- <!-- 操作 -->
- <Button v-auth="['marketing-store_seckill-create']" type="primary" @click="add" class="mr10">添加要货</Button>
- <!-- 积分商品-表格 -->
- <Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
- no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
- <template slot-scope="{ row, index }" slot="image">
- <viewer>
- <div class="tabBox_img">
- <img v-lazy="row.avatar" />
- </div>
- </viewer>
- </template>
- <template slot-scope="{ row, index }" slot="create_time">
- <span> {{ row.create_time | formatDate }}</span>
- </template>
- <template slot-scope="{ row, index }" slot="auth_time">
- <span v-if="row.auth_time"> {{ row.auth_time | formatDate }}</span>
- </template>
- <template slot-scope="{ row, index }" slot="auser">
- <div>名称:{{row.auser.staff_name}}</div>
- <div>管理员ID:{{row.auser.admin_id}}</div>
- <div>ID:{{row.auser.id}}</div>
- <div>手机:{{row.auser.phone}}</div>
- </template>
- <template slot-scope="{ row, index }" slot="cuser">
- <div>名称:{{row.cuser.staff_name}}</div>
- <div>管理员ID:{{row.cuser.admin_id}}</div>
- <div>ID:{{row.cuser.id}}</div>
- <div>手机:{{row.cuser.phone}}</div>
- </template>
- <template slot-scope="{ row, index }" slot="ware">
- <div>名称:{{row.ware.title}}</div>
- <div>ID:{{row.ware.id}}</div>
- <div>手机:{{row.ware.phone}}</div>
- <div>地址:{{row.ware.detailed_address}}</div>
- </template>
- <template slot-scope="{ row, index }" slot="info">
- <!-- {{row.info}} -->
- <div v-for="item in row.info" class="info">
- <div>
- 商品名称:{{item.product_name}}
- </div>
- <div>
- 商品ID:{{item.product_id}}
- </div>
- <div>
- 数量:{{item.want_product_num*1}}{{' '}}{{item.unit_name}}
- </div>
- </div>
- </template>
- <template slot-scope="{ row, index }" slot="store">
- <viewer style="display: flex;">
- <div class="tabBox_img">
- <img v-lazy="row.store.image" />
- </div>
- <div>门店:{{row.store.name}}<br>ID:{{row.store.id}}</div>
- </viewer>
- </template>
- <template slot-scope="{ row, index }" slot="is_system">
- <span> {{ row.is_system ? '是': '否'}}</span>
- </template>
- <template slot-scope="{ row, index }" slot="is_show">
- <i-switch v-model="row.is_show" :value="row.is_show" :true-value="1" :false-value="0"
- @on-change="onchangeIsShow(row)" size="large">
- <span slot="open">上架</span>
- <span slot="close">下架</span>
- </i-switch>
- </template>
- <template slot-scope="{ row, index }" slot="status">
- <Tag color="default" v-if="row.status == 0">待审核</Tag>
- <Tag color="primary" v-if="row.status == 1">通过</Tag>
- <Tag color="success" v-if="row.status == 3">完成</Tag>
- <Tag color="error" v-if="row.status == -1">拒绝</Tag>
- <Tag color="warning" v-if="row.status == 2">部分完成</Tag>
- <Tag color="magenta" v-if="row.status == -2">无效</Tag>
- </template>
- <template slot-scope="{ row, index }" slot="action">
- <a @click="look(row)">详情</a>
- <template v-if="row.status == 0">
- <Divider type="vertical" />
- <a @click="edit(row)">编辑</a>
- <Divider type="vertical" />
- <a @click="pass(row)">审核</a>
- <Divider type="vertical" />
- <a @click="del(row, '删除要货单', index)">删除</a>
- </template>
-
- </template>
- </Table>
- <div class="acea-row row-right page">
- <Page :total="total" :current="tableFrom.page" show-elevator show-total @on-change="pageChange"
- :page-size="tableFrom.limit" />
- </div>
- </Card>
- <Modal
- v-model="modalpass"
- scrollable
- title="请修改内容"
- class="order_box"
- :closable="false"
- :mask-closable="false"
- >
- <Form
- ref="remarks"
- :model="remarks"
- :label-width="80"
- @submit.native.prevent
- >
- <FormItem label="审核人:">
- <!-- <Input
- v-model="remarks.mark"
- maxlength="200"
- show-word-limit
- type="textarea"
- placeholder="请填写备注~"
- style="width: 100%"
- /> -->
- <Select v-model="remarks.auth_uid" clearable filterable @on-change="userSearchse"
- class="input-add">
- <Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
- </Option>
- </Select>
- </FormItem>
- <FormItem label="状态:">
- <Select v-model="remarks.status" clearable filterable
- class="input-add">
- <Option :value="1" >通过</Option>
- <Option :value="-1" >拒绝</Option>
- <Option :value="2" >部分完成</Option>
- <Option :value="3" >完成</Option>
- <Option :value="-2" >无效</Option>
- </Select>
- </FormItem>
- </Form>
- <div slot="footer">
- <Button type="primary" @click="putRemark()">提交</Button>
- <Button @click="cancel()">取消</Button>
- </div>
- </Modal>
- </div>
- </template>
- <script>
- import {
- mapState
- } from "vuex";
- import {
- integralProductListApi,
- integralIsShowApi,
- storeSeckillApi,
- } from "@/api/marketing";
- import {
- getWantList,
- getUserInfo,
- getGodownList,
- getUserList,
- seveWant
- } from "@/api/erp";
- import {
- staffListInfo
- } from "@/api/store";
- import {
- formatDate
- } from "@/utils/validate";
- import timeOptions from "@/utils/timeOptions";
- import Setting from "@/setting";
- export default {
- name: "want",
- filters: {
- formatDate(time) {
- if (time !== 0) {
- let date = new Date(time * 1000);
- return formatDate(date, "yyyy-MM-dd");
- }
- },
- showStatus(status) {
- let str = ''
- switch (status) {
- case 0:
- str = '待审核';
- break;
- case -2:
- str = '无效';
- break;
- case -1:
- str = '拒绝';
- break;
- case 1:
- str = '通过';
- break;
- case 2:
- str = '部分完成';
- break;
- case 3:
- str = '完成';
- break;
- default:
- str = '';
- break;
- }
- return str
- }
- },
- data() {
- return {
- remarks: {
- id: 0,
- status: '',
- auth_uid: "",
- auth_admin_id: "",
- },
- modalpass:false,
- roterPre: Setting.roterPre,
- loading: false,
- options: timeOptions,
- columns1: [{
- title: "ID",
- key: "id",
- width: 80,
- },
- {
- title: "要货单号",
- key: "want_order_id",
- minWidth: 150,
- },
- {
- title: '商品信息',
- slot: 'info',
- minWidth: 300,
- },
- {
- title: "门店信息",
- slot: "store",
- minWidth: 200,
- },
- {
- title: "创建人",
- slot: "cuser",
- minWidth: 200,
- },
- {
- title: "仓库信息",
- slot: "ware",
- minWidth: 200,
- },
- {
- title: "审核人信息",
- slot: "auser",
- minWidth: 200,
- },
- {
- title: '审核时间',
- slot: 'auth_time',
- minWidth: 80,
- },
- {
- title: "状态",
- slot: "status",
- minWidth: 100,
- },
- {
- title: "创建时间",
- slot: "create_time",
- minWidth: 90,
- },
- {
- title: "操作",
- slot: "action",
- fixed: "right",
- width: 200,
- },
- ],
- tableList: [],
- timeVal: [],
- grid: {
- xl: 7,
- lg: 10,
- md: 12,
- sm: 24,
- xs: 24,
- },
- tableFrom: {
- // integral_time: "",
- // is_show: "",
- // store_name: "",
- // key: '',
- create_uid:"",
- store_id:"",
- wid:"",
- page: 1,
- limit: 15,
- },
- total: 0,
- staffData:[],
- data1:[],
- authList:[],
- authLists: []
- };
- },
- computed: {
- ...mapState("admin/layout", ["isMobile"]),
- labelWidth() {
- return this.isMobile ? undefined : 96;
- },
- labelPosition() {
- return this.isMobile ? "top" : "right";
- },
- },
- created() {
- this.getList();
- },
- mounted() {
- this.getGodownList()
- this.staffList()
- this.getUserList()
- },
- methods: {
- putRemark() {
- seveWant(this.remarks.id,this.remarks).then(res => {
- this.cancel()
- this.getList();
- })
-
- },
- cancel() {
- this.remarks = {
- id:0,
- status: '',
- auth_uid: "",
- auth_admin_id: "",}
- this.modalpass = false
- },
- getUserList() {
- getUserList().then(res => {
- // console.log(res);
- this.authList = res.data.data
- })
- },
- userSearchs(e) {
- this.tableFrom.page = 1;
- this.getList();
- },
- userSearchse(e) {
- let auth = this.authLists.find(item => item.id == e)
- console.log(auth,'auth');
- this.remarks.auth_admin_id = auth.admin_id
- },
- getGodownList() {
- getGodownList().then(res => {
- console.log(res);
- this.data1 = res.data.data
- })
- },
- staffList() {
- staffListInfo()
- .then((res) => {
- this.staffData = res.data;
- })
- .catch((err) => {
- this.$Message.error(err.msg);
- });
- },
- // 添加
- add() {
- this.$router.push({
- path: this.roterPre + "/erp/want_add?id=0"
- });
- },
- addMore() {
- this.$router.push({
- path: this.roterPre + "/marketing/store_integral/add_store_integral",
- });
- },
- orderList(row) {
- this.$router.push({
- path: this.roterPre + "/marketing/store_integral/order_list",
- query: {
- product_id: row.id,
- },
- });
- },
- // 导出
- exports() {
- let formValidate = this.tableFrom;
- let data = {
- start_status: formValidate.start_status,
- status: formValidate.status,
- store_name: formValidate.store_name,
- };
- storeSeckillApi(data)
- .then((res) => {
- location.href = res.data[0];
- })
- .catch((res) => {
- this.$Message.error(res.msg);
- });
- },
- // 编辑
- edit(row) {
- this.$router.push({
- path: this.roterPre + "/erp/want_add?id=" + row.id
- });
- },
- // 一键复制
- copy(row) {
- this.$router.push({
- path: this.roterPre + "/marketing/store_integral/create/" + row.id + "/1",
- });
- },
- // 删除
- del(row, tit, num) {
- let delfromData = {
- title: tit,
- num: num,
- url: `erp/want/del/${row.id}`,
- method: "DELETE",
- ids: "",
- };
- this.$modalSure(delfromData)
- .then((res) => {
- this.$Message.success(res.msg);
- this.tableList.splice(num, 1);
- if (!this.tableList.length) {
- this.tableFrom.page =
- this.tableFrom.page == 1 ? 1 : this.tableFrom.page - 1;
- }
- this.getList();
- })
- .catch((res) => {
- this.$Message.error(res.msg);
- });
- },
- pass(row) {
- let qdata = {}
- if(row.wid) {
- qdata.wid = row.wid
- }else {
- qdata.store_id = row.store_id
- }
- this.authLists = []
- this.remarks.id = row.id
- getUserList(qdata).then(res => {
- this.authLists = res.data.data
- this.modalpass = true;
- })
- },
- // 列表
- getList() {
- this.loading = true;
- // this.tableFrom.start_status = this.tableFrom.start_status || "";
- // this.tableFrom.is_show = this.tableFrom.is_show || "";
- getWantList(this.tableFrom)
- .then(async (res) => {
- let data = res.data;
- this.tableList = data.data;
- this.total = data.count;
- this.loading = false;
- })
- .catch((res) => {
- this.loading = false;
- this.$Message.error(res.msg);
- });
- },
- pageChange(index) {
- this.tableFrom.page = index;
- this.getList();
- },
- // 表格搜索
- tableSearchs() {
- this.tableFrom.page = 1;
- this.getList();
- },
- // 具体日期
- onchangeTime(e) {
- this.timeVal = e;
- this.tableFrom.integral_time = this.timeVal[0] ? this.timeVal.join("-") : "";
- },
- // 修改是否显示
- onchangeIsShow(row) {
- let data = {
- id: row.id,
- is_show: row.is_show,
- };
- integralIsShowApi(data)
- .then(async (res) => {
- this.$Message.success(res.msg);
- })
- .catch((res) => {
- this.$Message.error(res.msg);
- });
- },
-
- },
- };
- </script>
- <style scoped lang="stylus">
- .tabBox_img {
- width: 36px;
- height: 36px;
- border-radius: 4px;
- cursor: pointer;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .info {
- padding-top: 10px;
- border-bottom: 1px dashed #515a6e;
- &:last-of-type {
- border: none;
- }
- }
- </style>
|