|
|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
<script>
|
|
|
|
|
import {itemAction,itemPreAction} from '@/api/order'
|
|
|
|
|
|
|
|
|
|
import {index as merchantIndex} from '@/api/merchant'
|
|
|
|
|
import {index as productIndex} from '@/api/product'
|
|
|
|
|
import { Message } from 'element-ui'
|
|
|
|
|
export default {
|
|
|
|
|
props:{
|
|
|
|
|
@ -21,7 +24,11 @@ export default {
|
|
|
|
|
|
|
|
|
|
form:{
|
|
|
|
|
follow:{
|
|
|
|
|
content:''
|
|
|
|
|
content:'',
|
|
|
|
|
merchant_id:"",
|
|
|
|
|
product_id:"",
|
|
|
|
|
merchant_name:"",
|
|
|
|
|
product_name:"",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -48,8 +55,56 @@ export default {
|
|
|
|
|
</Button>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleSelectProduct(item) {
|
|
|
|
|
this.form.follow.product_id = item.id;
|
|
|
|
|
},
|
|
|
|
|
querySearchAsyncProduct(queryString,cb){
|
|
|
|
|
productIndex({
|
|
|
|
|
name: queryString,
|
|
|
|
|
merchant_id:this.form.follow.merchant_id,
|
|
|
|
|
page_size: 999
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
var data = res.rows;
|
|
|
|
|
let _data=[];
|
|
|
|
|
for (var m of data) {
|
|
|
|
|
_data.push(
|
|
|
|
|
{
|
|
|
|
|
value:m.name,
|
|
|
|
|
id:m.id
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
cb(_data)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleSelect(item) {
|
|
|
|
|
console.log(item)
|
|
|
|
|
this.form.follow.merchant_id = item.id;
|
|
|
|
|
this.form.follow.product_name="";
|
|
|
|
|
this.form.follow.product_id="";
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
querySearchAsync(queryString,cb){
|
|
|
|
|
merchantIndex({
|
|
|
|
|
keyword: queryString,
|
|
|
|
|
page_size: 999
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
var data = res.data;
|
|
|
|
|
let _data=[];
|
|
|
|
|
for (var m of data) {
|
|
|
|
|
_data.push(
|
|
|
|
|
{
|
|
|
|
|
value:m.name,
|
|
|
|
|
id:m.id
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
cb(_data)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
contentRender(){
|
|
|
|
|
if(this.action=="assign"){
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<div style={{'display':'flex'}}>
|
|
|
|
|
@ -57,11 +112,54 @@ export default {
|
|
|
|
|
<div>{this.content.vo?.order?.order_name}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="action-form">
|
|
|
|
|
<div class="action-form-label">请输入内容</div>
|
|
|
|
|
<div class="action-form-item">
|
|
|
|
|
<div class="action-form-label">商家</div>
|
|
|
|
|
|
|
|
|
|
<div class="action-form-content">
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-autocomplete
|
|
|
|
|
style={{'width':'240px'}}
|
|
|
|
|
v-model={this.form.follow.merchant_name}
|
|
|
|
|
fetch-suggestions={this.querySearchAsync}
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请输入选择商家"
|
|
|
|
|
on={{
|
|
|
|
|
['select']:(e)=>{
|
|
|
|
|
this.handleSelect(e);
|
|
|
|
|
}
|
|
|
|
|
}}></el-autocomplete>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="action-form-item">
|
|
|
|
|
<div class="action-form-label">产品</div>
|
|
|
|
|
|
|
|
|
|
<div class="action-form-content">
|
|
|
|
|
|
|
|
|
|
<el-autocomplete
|
|
|
|
|
style={{'width':'240px'}}
|
|
|
|
|
clearable
|
|
|
|
|
v-model={this.form.follow.product_name}
|
|
|
|
|
fetch-suggestions={this.querySearchAsyncProduct}
|
|
|
|
|
placeholder="请输入选择产品"
|
|
|
|
|
on={{
|
|
|
|
|
['select']:(e)=>{
|
|
|
|
|
this.handleSelectProduct(e)
|
|
|
|
|
}
|
|
|
|
|
}}></el-autocomplete>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="action-form-item">
|
|
|
|
|
<div class="action-form-label">内容</div>
|
|
|
|
|
|
|
|
|
|
<div class="action-form-content">
|
|
|
|
|
<el-input
|
|
|
|
|
style={{'width':'340px'}}
|
|
|
|
|
type="textarea"
|
|
|
|
|
rows='2'
|
|
|
|
|
clearable
|
|
|
|
|
size='small'
|
|
|
|
|
placeholder="请输入内容"
|
|
|
|
|
value={this.form.follow.content}
|
|
|
|
|
on={{
|
|
|
|
|
['input']:(e)=>{
|
|
|
|
|
@ -71,13 +169,55 @@ export default {
|
|
|
|
|
</el-input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>)
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<div style={{'display':'flex'}}>
|
|
|
|
|
<div>产品名称</div>
|
|
|
|
|
<div>{this.content.vo?.order?.order_name}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="action-form">
|
|
|
|
|
<div class="action-form-item">
|
|
|
|
|
<div class="action-form-label">内容</div>
|
|
|
|
|
|
|
|
|
|
<div class="action-form-content">
|
|
|
|
|
<el-input
|
|
|
|
|
style={{'width':'240px'}}
|
|
|
|
|
size='small' type="textarea"
|
|
|
|
|
rows='2'
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请输入内容"
|
|
|
|
|
value={this.form.follow.content}
|
|
|
|
|
on={{
|
|
|
|
|
['input']:(e)=>{
|
|
|
|
|
this.form.follow.content = e
|
|
|
|
|
}
|
|
|
|
|
}}>
|
|
|
|
|
</el-input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
actionPreClick(action){
|
|
|
|
|
this.action = action
|
|
|
|
|
this.action = action;
|
|
|
|
|
if(this.row.merchant){
|
|
|
|
|
this.form.follow.merchant_id=this.row.merchant.id;
|
|
|
|
|
this.form.follow.merchant_name=this.row.merchant.name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.row.product){
|
|
|
|
|
this.form.follow.product_id=this.row.product.id;
|
|
|
|
|
this.form.follow.product_name=this.row.product.name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
itemPreAction({
|
|
|
|
|
item_id:this.row.id,
|
|
|
|
|
action
|
|
|
|
|
@ -90,6 +230,15 @@ export default {
|
|
|
|
|
actionClick(){
|
|
|
|
|
let data ;
|
|
|
|
|
switch (this.action){
|
|
|
|
|
case "assign":
|
|
|
|
|
data = {
|
|
|
|
|
item_id:this.row.id,
|
|
|
|
|
action:this.action,
|
|
|
|
|
remark:this.form.follow.content,
|
|
|
|
|
merchant_id:this.form.follow.merchant_id,
|
|
|
|
|
product_id:this.form.follow.product_id,
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
data = {
|
|
|
|
|
item_id:this.row.id,
|
|
|
|
|
@ -147,14 +296,17 @@ export default {
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.action-form{
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
&-item{
|
|
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
&-label{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
&-content{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
padding: 6px 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|