|
@@ -1,20 +1,147 @@
|
|
|
<template>
|
|
|
<div id="intenList">
|
|
|
- <p>我的意向</p>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <span>{{ item.product_name }}</span>
|
|
|
+ <span>{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="down">
|
|
|
+ <el-col :span="6" class="product">
|
|
|
+ <p>营销人名称:{{ item.market_username }}</p>
|
|
|
+ <p>购买人名称:{{ item.username }}</p>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="descr">
|
|
|
+ <p>说明:</p>
|
|
|
+ <p>{{ item.desrciption }}</p>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" class="status">
|
|
|
+ <p>状态:{{ item.status == '0' ? '正在洽谈' : item.status == '1' ? '达成意向' : item.status == '2' ? '我的交易' : '未识别' }}</p>
|
|
|
+ <el-button type="primary" @click="transBtn(item)" size="mini">交易完成</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="page">
|
|
|
+ <el-pagination
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ :page-size="pageSize"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-dialog title="填写交易信息" :visible.sync="dialogFormVisible" :before-close="handleClose">
|
|
|
+ <el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
|
|
+ <el-form-item label="产品名称" label-width="120px" prop="product_name">
|
|
|
+ <el-input v-model="form.product_name" autocomplete="off" placeholder="请输入产品名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品单价" label-width="120px" prop="price">
|
|
|
+ <el-input v-model="form.price" autocomplete="off" placeholder="请输入产品单价"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品单位" label-width="120px" prop="priceunit">
|
|
|
+ <el-select v-model="form.priceunit" placeholder="请选择产品单位">
|
|
|
+ <el-option v-for="(item, index) in priceunit_list" :key="index" :label="item.name" :value="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer" style="text-align:center;">
|
|
|
+ <el-button @click="resetBtn">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="formSubmit('form')">交易信息提交</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
|
|
|
export default {
|
|
|
name: 'intenList',
|
|
|
props: {},
|
|
|
components: {},
|
|
|
data: function() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ currentPage: 0,
|
|
|
+ pageSize: 6,
|
|
|
+ skip: '',
|
|
|
+ // 填写交易信息
|
|
|
+ dialogFormVisible: false,
|
|
|
+ form: {},
|
|
|
+ rules: {
|
|
|
+ product_name: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
|
|
|
+ price: [{ required: true, message: '请输入产品单位', trigger: 'blur' }],
|
|
|
+ priceunit: [{ required: true, message: '请选择产品单位', trigger: 'change' }],
|
|
|
+ },
|
|
|
+ // 单位
|
|
|
+ priceunit_list: [
|
|
|
+ {
|
|
|
+ name: '公斤',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '套',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '件',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.searchInfo();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...transaction({ transactionList: 'query', transactiondtetle: 'delete', shenheupdate: 'update' }),
|
|
|
+ // 列表
|
|
|
+ async searchInfo({ skip = 0, limit = 6, ...info } = {}) {
|
|
|
+ let market_userid = this.user.uid;
|
|
|
+ skip = this.skip;
|
|
|
+ const res = await this.transactionList({ skip, limit, market_userid, status: 1, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 交易信息提交打开
|
|
|
+ transBtn(item) {
|
|
|
+ this.$set(this.form, `product_name`, item.product_name);
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ },
|
|
|
+ // 交易信息提交
|
|
|
+ formSubmit(formName) {
|
|
|
+ this.$refs[formName].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ console.log(this.form);
|
|
|
+ this.$message({
|
|
|
+ message: '提交交易成功,等待管理员审核,方可交易完成',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ },
|
|
|
+ // 取消申请
|
|
|
+ resetBtn() {
|
|
|
+ this.form = {};
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ },
|
|
|
+ handleClose(done) {
|
|
|
+ this.resetBtn();
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ // 分页
|
|
|
+ handleCurrentChange(currentPage) {
|
|
|
+ this.$set(this, `skip`, (currentPage - 1) * this.pageSize);
|
|
|
+ this.searchInfo();
|
|
|
+ },
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
pageTitle() {
|
|
@@ -27,4 +154,72 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.textOver {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+.list {
|
|
|
+ height: 185px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ margin: 0 0 15px 0;
|
|
|
+ .top {
|
|
|
+ height: 45px;
|
|
|
+ line-height: 45px;
|
|
|
+ background-color: #fafafa;
|
|
|
+ span:first-child {
|
|
|
+ float: left;
|
|
|
+ width: 74%;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #888;
|
|
|
+ padding: 0 15px;
|
|
|
+ }
|
|
|
+ span:last-child {
|
|
|
+ float: right;
|
|
|
+ width: 20%;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #888;
|
|
|
+ padding: 0 15px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .down {
|
|
|
+ padding: 18px;
|
|
|
+ .product {
|
|
|
+ height: 100px;
|
|
|
+ overflow: hidden;
|
|
|
+ padding: 15px;
|
|
|
+ border-right: 1px dashed #ccc;
|
|
|
+ p {
|
|
|
+ font-size: 14px;
|
|
|
+ padding: 0 0 10px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .descr {
|
|
|
+ height: 100px;
|
|
|
+ overflow: hidden;
|
|
|
+ font-size: 14px;
|
|
|
+ padding: 0 10px;
|
|
|
+ border-right: 1px dashed #ccc;
|
|
|
+ }
|
|
|
+ .status {
|
|
|
+ height: 100px;
|
|
|
+ text-align: center;
|
|
|
+ p {
|
|
|
+ height: 50px;
|
|
|
+ line-height: 50px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #2d64b3;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.info {
|
|
|
+ padding: 0 0 15px 0;
|
|
|
+}
|
|
|
+.page {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+</style>
|