|
@@ -2,21 +2,23 @@
|
|
|
<zj-page-container>
|
|
|
<zj-page-fill class="neibuview">
|
|
|
<zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules">
|
|
|
- <zj-form-module title="商品详情" :form-data="formData" :form-items="formItems" label-width="80px" :column="3">
|
|
|
+ <zj-form-module title="商品详情" :form-data="formData" :form-items="formItems" label-width="80px">
|
|
|
</zj-form-module>
|
|
|
<zj-form-module title="出售信息" class="my-module" :form-data="formData.order" :form-items="formItems2"
|
|
|
- label-width="80px" :column="3" />
|
|
|
+ label-width="0px"/>
|
|
|
+ <zj-form-module title="查看留言" class="my-module" :form-data="formData.order" :form-items="formItems3"
|
|
|
+ label-width="0px"/>
|
|
|
</zj-form-container>
|
|
|
</zj-page-fill>
|
|
|
<div style="box-sizing: border-box; padding: 10px; text-align: right;">
|
|
|
<el-button type="primary" size="small" @click="handleSubmit">保存</el-button>
|
|
|
- <el-button v-if="formData.id && ~['OFF'].indexOf(formData.status)" type="primary" size="small"
|
|
|
+ <el-button v-if="formData.id && ~['SALE'].indexOf(formData.status)" type="primary" size="small"
|
|
|
@click="copyGoods">克隆商品</el-button>
|
|
|
<el-button v-if="formData.id && ~['ON'].indexOf(formData.status)" type="primary" size="small"
|
|
|
@click="setStatus('OFF')">下架</el-button>
|
|
|
- <el-button v-if="formData.id && ~['ON', 'SALE'].indexOf(formData.status)" type="primary" size="small"
|
|
|
+ <el-button v-if="formData.id && ~['ON', 'OFF'].indexOf(formData.status)" type="primary" size="small"
|
|
|
@click="handleSubmit">转销售</el-button>
|
|
|
- <el-button v-if="formData.id && ~['SALE'].indexOf(formData.status)" type="primary" size="small"
|
|
|
+ <el-button v-if="formData.id && ~['OFF'].indexOf(formData.status)" type="primary" size="small"
|
|
|
@click="setStatus('ON')">重新上架</el-button>
|
|
|
<el-button size="small" @click="handleClose">取消</el-button>
|
|
|
</div>
|
|
@@ -25,7 +27,7 @@
|
|
|
|
|
|
<script>
|
|
|
import ImageUpload from '@/components/Common/image-upload.vue'
|
|
|
-import { esGoodsDetail, esGoodsCopy, esGoodsBatchUpdateStatus } from '@/api/commodityManagement'
|
|
|
+import { esGoodsDetail, esGoodsCopy, esGoodsBatchUpdateStatus, esGoodsReply } from '@/api/commodityManagement'
|
|
|
export default {
|
|
|
components: { ImageUpload },
|
|
|
props: {
|
|
@@ -65,74 +67,77 @@ export default {
|
|
|
},
|
|
|
formRules: {},
|
|
|
publishStatus: [
|
|
|
- { label: '下架', value: "SALE" },
|
|
|
+ { label: '下架', value: "OFF" },
|
|
|
{ label: '上架', value: "ON" },
|
|
|
- { label: '已卖出', value: "OFF" },
|
|
|
+ { label: '已卖出', value: "SALE" },
|
|
|
],
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ disabled(){
|
|
|
+ return this.detailId? !~['ON', 'OFF'].indexOf(this.formData?.status) : false
|
|
|
+ },
|
|
|
formItems() {
|
|
|
return [
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 12,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '商品分类', prop: 'categoryName' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-radio',
|
|
|
options: this.publishStatus,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
md: 12,
|
|
|
formItemAttributes: { label: '发布状态', prop: 'status' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 12,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '商品名称', prop: 'goodsName' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 12,
|
|
|
- attributes: { disabled: true, type: 'textarea' },
|
|
|
+ attributes: { disabled: this.disabled, type: 'textarea' },
|
|
|
formItemAttributes: { label: '商品描述', prop: 'goodsNote' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 6,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '商品价格', prop: 'price' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 6,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '上架数量', prop: 'qty' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 6,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '商品品牌', prop: 'brand' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 6,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '功率(W)', prop: 'power' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 6,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '制造日期', prop: 'makeDate' }
|
|
|
},
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 6,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '联系电话', prop: 'linkPhone' }
|
|
|
},
|
|
|
{
|
|
@@ -143,7 +148,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
name: 'slot-component',
|
|
|
- md: 24,
|
|
|
+ md: 6,
|
|
|
attributes: { disabled: true, placeholder: '' },
|
|
|
formItemAttributes: { label: '留言量', prop: '' },
|
|
|
render: (h, { props }) => {
|
|
@@ -167,13 +172,13 @@ export default {
|
|
|
{ label: '五级能效', value: "五级能效" },
|
|
|
],
|
|
|
md: 24,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '能效标识', prop: 'mark' }
|
|
|
},
|
|
|
{
|
|
|
name: 'slot-component',
|
|
|
md: 24,
|
|
|
- attributes: { disabled: true },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
formItemAttributes: { label: '商品图片', prop: 'imgList' },
|
|
|
render: (h, { props }) => {
|
|
|
return (<div>
|
|
@@ -187,8 +192,8 @@ export default {
|
|
|
return [{
|
|
|
name: 'slot-component',
|
|
|
md: 24,
|
|
|
- attributes: { disabled: true },
|
|
|
- formItemAttributes: { label: '', prop: '' },
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
+ formItemAttributes: { label: '', prop: '', 'label-width': '0px' },
|
|
|
render: (h, { props }) => {
|
|
|
var { formData } = props
|
|
|
console.log(formData, 999)
|
|
@@ -258,7 +263,99 @@ export default {
|
|
|
</div>)
|
|
|
}
|
|
|
}]
|
|
|
- }
|
|
|
+ },
|
|
|
+ formItems3() {
|
|
|
+ return [{
|
|
|
+ name: 'slot-component',
|
|
|
+ md: 24,
|
|
|
+ attributes: { disabled: this.disabled },
|
|
|
+ formItemAttributes: { label: '', prop: 'messageList', 'label-width': '0px' },
|
|
|
+ render: (h, { props }) => {
|
|
|
+ var { formData } = props
|
|
|
+ return <div>
|
|
|
+ <zj-table
|
|
|
+ columns={[
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '留言人名称',
|
|
|
+ prop: 'createBy'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '留言内容',
|
|
|
+ prop: 'content'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '留言时间',
|
|
|
+ prop: 'createTime'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '回复人名称',
|
|
|
+ prop: 'replyBy'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '回复内容',
|
|
|
+ prop: 'replyContent'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '回复时间',
|
|
|
+ prop: 'replyTime'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '操作',
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div style="padding-left:10px">
|
|
|
+ <el-button type="text" onClick={() => {
|
|
|
+ this.$prompt('留言回复', '回复', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ inputType: "textarea"
|
|
|
+ }).then(({ value }) => {
|
|
|
+ if(value){
|
|
|
+ esGoodsReply({
|
|
|
+ id:this.detailId,
|
|
|
+ messageId:row.id,
|
|
|
+ content:value
|
|
|
+ }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: `设置成功!` })
|
|
|
+ esGoodsDetail({ id: this.detailId }).then(res2 => {
|
|
|
+ this.formData = {
|
|
|
+ ...res2.data,
|
|
|
+ imgList: res2.data.imgList.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ imgUrl: item.imgUrl
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }}>回复</el-button>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ tableData={this.formData.messageList}
|
|
|
+ >
|
|
|
+ </zj-table>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
detailId: {
|