|
@@ -17,8 +17,20 @@
|
|
|
<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>
|
|
|
+ <p>
|
|
|
+ 状态:{{
|
|
|
+ item.status == '0'
|
|
|
+ ? '正在洽谈'
|
|
|
+ : item.status == '1'
|
|
|
+ ? '达成意向'
|
|
|
+ : item.status == '2'
|
|
|
+ ? '我的交易'
|
|
|
+ : item.status == '4'
|
|
|
+ ? '合同审核中'
|
|
|
+ : '未识别'
|
|
|
+ }}
|
|
|
+ </p>
|
|
|
+ <el-button type="primary" @click="transBtn(item)" size="mini" v-if="item.status == '1'">交易完成</el-button>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -39,13 +51,14 @@
|
|
|
<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 label="购买人姓名" label-width="120px" prop="username">
|
|
|
+ <el-input v-model="form.username" 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 label="营销人姓名" label-width="120px" prop="market_username">
|
|
|
+ <el-input v-model="form.market_username" autocomplete="off" placeholder="请输入营销人姓名"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="描述" label-width="120px" prop="description">
|
|
|
+ <el-input v-model="form.description" maxlength="300" show-word-limit type="textarea" autocomplete="off" placeholder="请输入描述"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer" style="text-align:center;">
|
|
@@ -59,6 +72,8 @@
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: transaction } = createNamespacedHelpers('transaction');
|
|
|
+const { mapActions: productpact } = createNamespacedHelpers('productpact');
|
|
|
+
|
|
|
export default {
|
|
|
name: 'intenList',
|
|
|
props: {},
|
|
@@ -97,34 +112,39 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...transaction({ transactionList: 'query', transactiondtetle: 'delete', shenheupdate: 'update' }),
|
|
|
+ ...productpact({ productpactCreate: 'create' }),
|
|
|
// 列表
|
|
|
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);
|
|
|
+ const arr = await this.transactionList({ skip, limit, market_userid, status: 4, ...info });
|
|
|
+ var newData = res.data.concat(arr.data);
|
|
|
+ if (this.$checkRes(newData)) {
|
|
|
+ this.$set(this, `list`, newData);
|
|
|
+ this.$set(this, `total`, newData.length);
|
|
|
}
|
|
|
},
|
|
|
// 交易信息提交打开
|
|
|
transBtn(item) {
|
|
|
- this.$set(this.form, `product_name`, item.product_name);
|
|
|
+ this.$set(this, `form`, item);
|
|
|
this.dialogFormVisible = true;
|
|
|
},
|
|
|
// 交易信息提交
|
|
|
- formSubmit(formName) {
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- console.log(this.form);
|
|
|
+ async formSubmit() {
|
|
|
+ this.form.status = '0';
|
|
|
+ this.form.transaction_id = this.form.id;
|
|
|
+ const res = await this.productpactCreate(this.form);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.form.status = '4';
|
|
|
+ const arr = await this.shenheupdate(this.form);
|
|
|
+ if (this.$checkRes(arr)) {
|
|
|
this.$message({
|
|
|
message: '提交交易成功,等待管理员审核,方可交易完成',
|
|
|
type: 'success',
|
|
|
});
|
|
|
- } else {
|
|
|
- return false;
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
this.dialogFormVisible = false;
|
|
|
},
|
|
|
// 取消申请
|