Commit 72cb2989 by liuliufashi

update

parent 9c547acb
No preview for this file type
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
<div class="title">商品基础信息</div> <div class="title">商品基础信息</div>
<a-form style="margin-top: 30px" :model="formState" name="basic" :label-col="{ span: 1 }" :wrapper-col="{ span: 8 }" <a-form style="margin-top: 30px" :model="formState" name="basic" :label-col="{ span: 1 }" :wrapper-col="{ span: 8 }"
autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed"> autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed">
<a-form-item label="商品名称" name="subject" :rules="rulesRef.subject" labelAlign="left" :label-col="{ span: 1 }"> <a-form-item label="商品名称" name="subject" :rules="rulesRef.subject" labelAlign="left" :label-col="{ span: 2 }">
<a-input v-model:value="formState.subject" /> <a-input v-model:value="formState.subject" />
</a-form-item> </a-form-item>
<a-form-item label="商品简介" name="shortname" :rules="rulesRef.shortname" labelAlign="left" :label-col="{ span: 1 }"> <a-form-item label="商品简介" name="shortname" :rules="rulesRef.shortname" labelAlign="left" :label-col="{ span: 2}">
<a-input v-model:value="formState.shortname" /> <a-input v-model:value="formState.shortname" />
</a-form-item> </a-form-item>
<a-form-item label=" 商品示图" name="picurl" :rules="rulesRef.picurl" :wrapper-col="{ offset: 0, span: 8 }" class="Up" <a-form-item label=" 商品示图" name="picurl" :rules="rulesRef.picurl" :wrapper-col="{ offset: 0, span: 8 }" class="Up"
labelAlign="left" :label-col="{ span: 1 }"> labelAlign="left" :label-col="{ span: 2 }">
<div class="clearfix"> <div class="clearfix">
<a-upload class="clearfix-up" v-model:file-list="fileList" action="http://43.142.42.187:8899/file/upload" list-type="picture-card" <a-upload class="clearfix-up" v-model:file-list="fileList" action="http://43.142.42.187:8899/file/upload" list-type="picture-card"
:maxCount="1" @preview="handlePreview" @change="handleChange" :before-upload="beforeUpload"> :maxCount="1" @preview="handlePreview" @change="handleChange" :before-upload="beforeUpload">
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item label="商品详情" name="body" labelAlign="left" :label-col="{ span: 1 }"> <a-form-item label="商品详情" name="body" labelAlign="left" :label-col="{ span: 2 }">
<div style="position: relative;"> <div style="position: relative;">
<div style="position: absolute;right: 19%;height: 30px;width: 30px;"> <div style="position: absolute;right: 19%;height: 30px;width: 30px;">
<a-upload class="clearfix-up-1" action="http://43.142.42.187:8899/file/upload" list-type="picture-card" :maxCount="1" <a-upload class="clearfix-up-1" action="http://43.142.42.187:8899/file/upload" list-type="picture-card" :maxCount="1"
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</div> </div>
</a-form-item> </a-form-item>
<a-form-item name="price" :wrapper-col="{ offset: 0, span: 2 }" label="商品售价" <a-form-item name="price" :wrapper-col="{ offset: 0, span: 2 }" label="商品售价"
:rules="[{ required: true, message: '请输入输入价格' }]" labelAlign="left" :label-col="{ span: 1 }"> :rules="[{ required: true, message: '请输入输入价格' }]" labelAlign="left" :label-col="{ span: 2 }">
<div> <div>
<a-radio-group v-model:value="value" @change="onSelectPlain"> <a-radio-group v-model:value="value" @change="onSelectPlain">
<a-radio value="0">免费</a-radio> <a-radio value="0">免费</a-radio>
...@@ -65,21 +65,22 @@ ...@@ -65,21 +65,22 @@
</div> </div>
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{ offset: 1, span: 7 }" v-if="value == 1"> <a-form-item :wrapper-col="{ offset: 2, span: 7 }" v-if="value == 1">
<div style="display:flex;"> <div style="display:flex;">
<div style="margin-right:20px">划线价</div> <div style="margin-right:20px">划线价</div>
<a-input-number v-model:value="formState.markingprice" style="width: 200px" :min="0" <a-input-number v-model:value="formState.markingprice" style="width: 200px" :min="0"
string-mode /> string-mode />
</div> </div>
</a-form-item> </a-form-item>
<a-form-item name="price" :wrapper-col="{ offset: 1, span: 7 }" v-if="value == 1" <a-form-item name="price" :wrapper-col="{ offset: 2, span: 7 }" v-if="value == 1"
:rules="[{ required: true, message: '请输入商品价格!' }]"> :rules="[{ required: true, message: '请输入商品价格!' }]" :label-col="{ span: 2 }">
<div style="display:flex;"> <div style="display:flex;">
<div style="margin-right:20px">售卖价</div> <div style="margin-right:20px">售卖价</div>
<a-input-number v-model:value="formState.price" style="width: 200px" :min="0" <a-input-number v-model:value="formState.price" style="width: 200px" :min="0"
string-mode /> string-mode />
</div> </div>
</a-form-item> </a-form-item>
<p style="opacity: .67;font-size: 14px;text-align: left;margin-left: 70px;">预计十分钟后开始支付链接生效</p>
<a-form-item :wrapper-col="{ offset: 0, span: 8 }"> <a-form-item :wrapper-col="{ offset: 0, span: 8 }">
<a-button type="primary" html-type="submit" @click="onSubmit">确定</a-button> <a-button type="primary" html-type="submit" @click="onSubmit">确定</a-button>
</a-form-item> </a-form-item>
......
...@@ -2,18 +2,17 @@ ...@@ -2,18 +2,17 @@
<div class="page"> <div class="page">
<!-- {{props.props.propsData.isCad}} --> <!-- {{props.props.propsData.isCad}} -->
<div class="title">商品包基础信息</div> <div class="title">商品包基础信息</div>
<a-form style="margin-top: 30px" :model="formState" name="basic" :label-col="{ span: 2 }" <a-form style="margin-top: 30px" :model="formState" name="basic" :label-col="{ span: 1 }" :wrapper-col="{ span: 8 }" autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed">
:wrapper-col="{ span: 8 }" autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed"> <a-form-item label="商品名称:" name="subject" :rules="rulesRef.subject" labelAlign="left" :label-col="{ span: 2 }">
<a-form-item label="商品名称:" name="subject" :rules="rulesRef.subject" :label-col="{ span: 1 }">
<a-input v-model:value="formState.subject" /> <a-input v-model:value="formState.subject" />
</a-form-item> </a-form-item>
<a-form-item label="商品简介:" name="shortname" :rules="rulesRef.shortname" :label-col="{ span: 1 }"> <a-form-item label="商品简介:" name="shortname" :rules="rulesRef.shortname" labelAlign="left" :label-col="{ span: 2 }">
<a-input v-model:value="formState.shortname" /> <a-input v-model:value="formState.shortname" />
</a-form-item> </a-form-item>
<a-form-item label="商品示图:" name="picurl" :rules="rulesRef.picurl" :wrapper-col="{ offset: 0, span: 8 }" <a-form-item label="商品示图:" name="picurl" :rules="rulesRef.picurl" labelAlign="left" :wrapper-col="{ offset: 0, span: 8 }"
class="Up" :label-col="{ span: 1 }"> class="Up" :label-col="{ span: 2 }">
<div class="clearfix"> <div class="clearfix">
<a-upload class="clearfix-up" v-model:file-list="fileList" action="http://43.142.42.187:8899/file/upload" :maxCount="1" <a-upload class="clearfix-up" v-model:file-list="fileList" action="http://43.142.42.187:8899/file/upload" :maxCount="1"
list-type="picture-card" @preview="handlePreview" @change="handleChange"> list-type="picture-card" @preview="handlePreview" @change="handleChange">
...@@ -32,7 +31,7 @@ ...@@ -32,7 +31,7 @@
</div> </div>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item label="商品详情:" name="body" :label-col="{ span: 1 }"> <a-form-item label="商品详情:" name="body" :label-col="{ span: 2 }" labelAlign="left">
<div style="position: relative;"> <div style="position: relative;">
<div style="position: absolute;right: 19%;height: 30px;width: 30px;"> <div style="position: absolute;right: 19%;height: 30px;width: 30px;">
<a-upload class="clearfix-up-1" action="http://43.142.42.187:8899/file/upload" list-type="picture-card" :maxCount="1" <a-upload class="clearfix-up-1" action="http://43.142.42.187:8899/file/upload" list-type="picture-card" :maxCount="1"
...@@ -52,8 +51,8 @@ ...@@ -52,8 +51,8 @@
</p> </p>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item label="选择商品:" :wrapper-col="{ offset: 0, span: 8 }" name="sub" :rules="rulesRef.sub" <a-form-item label="选择商品:" labelAlign="left" :wrapper-col="{ offset: 0, span: 8 }" name="sub" :rules="rulesRef.sub"
:label-col="{ span: 1 }"> :label-col="{ span: 2 }">
<div style="width:100%;display: flex;align-items: center;"> <div style="width:100%;display: flex;align-items: center;">
<a-select v-model:value="formState.sub" mode="multiple" style="width: 100%" placeholder="请选择商品" @change="handleChanges"> <a-select v-model:value="formState.sub" mode="multiple" style="width: 100%" placeholder="请选择商品" @change="handleChanges">
<a-select-option v-for="item in optionss" :itemKey="item" :value="item.goodsid" :label="item.goodsid"> <a-select-option v-for="item in optionss" :itemKey="item" :value="item.goodsid" :label="item.goodsid">
...@@ -66,8 +65,8 @@ ...@@ -66,8 +65,8 @@
<div class="please">请添加至少两个商品</div> <div class="please">请添加至少两个商品</div>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item name="price" :wrapper-col="{ offset: 0, span: 2 }" label="商品售价" <a-form-item name="price" labelAlign="left" :wrapper-col="{ offset: 0, span: 2 }" label="商品售价"
:rules="[{ required: true, message: '请输入输入价格' }]" :label-col="{ span: 1 }"> :rules="[{ required: true, message: '请输入输入价格' }]" :label-col="{ span: 2 }">
<div> <div>
<a-radio-group v-model:value="value" @change="onSelectPlain"> <a-radio-group v-model:value="value" @change="onSelectPlain">
<a-radio value="0">免费</a-radio> <a-radio value="0">免费</a-radio>
...@@ -75,15 +74,15 @@ ...@@ -75,15 +74,15 @@
</a-radio-group> </a-radio-group>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{ offset: 1, span: 7 }" v-if="value == 1"> <a-form-item :wrapper-col="{ offset: 2, span: 7 }" v-if="value == 1" >
<div style="display:flex;"> <div style="display:flex;">
<div style="margin-right:20px">划线价</div> <div style="margin-right:20px">划线价</div>
<a-input-number v-model:value="formState.markingprice" style="width: 200px" :min="0" <a-input-number v-model:value="formState.markingprice" style="width: 200px" :min="0"
string-mode /> string-mode />
</div> </div>
</a-form-item> </a-form-item>
<a-form-item name="price" :wrapper-col="{ offset: 1, span: 7 }" v-if="value == 1" <a-form-item name="price" :wrapper-col="{ offset: 2, span: 7 }" v-if="value == 1"
:rules="[{ required: true, message: '请输入商品价格!' }]"> :rules="[{ required: true, message: '请输入商品价格!' }]" :label-col="{ span: 2 }">
<div style="display:flex;"> <div style="display:flex;">
<div style="margin-right:20px">售卖价</div> <div style="margin-right:20px">售卖价</div>
<a-input-number v-model:value="formState.price" style="width: 200px" :min="0" <a-input-number v-model:value="formState.price" style="width: 200px" :min="0"
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
<a-button type="primary" style="margin-left: 20px">删除</a-button> <a-button type="primary" style="margin-left: 20px">删除</a-button>
</a-popconfirm> </a-popconfirm>
</template> </template>
<template v-if="column.key === 'price'">
<div>{{record.price/100}}</div>
</template>
</template> </template>
</a-table> </a-table>
</div> </div>
...@@ -44,10 +47,9 @@ ...@@ -44,10 +47,9 @@
<GoodsBagSubs :props="{ propsData }" v-else @onBack="onBack"> <GoodsBagSubs :props="{ propsData }" v-else @onBack="onBack">
</GoodsBagSubs> </GoodsBagSubs>
</div> </div>
<a-modal v-model:visible="visible" title="编辑" :confirm-loading="confirmLoading" :width="1000" @ok="handleOk" <a-modal v-model:visible="visible" title="编辑" :confirm-loading="confirmLoading" :width="1000" @ok="handleOk" :maskClosable="false"
@Cancel="handleCancel" @handleChange="handleChange"> @Cancel="handleCancel" @handleChange="handleChange">
<a-form :model="modelRef" name="basic" :label-col="{ span: 2 }" :wrapper-col="{ span: 8 }" autocomplete="off"> <a-form :model="modelRef" name="basic" :label-col="{ span: 2 }" :wrapper-col="{ span: 8 }" autocomplete="off">
<a-form-item label="商品名称" name="商品名称" :rules="[{ required: true, message: '请输入商品名称!' }]" <a-form-item label="商品名称" name="商品名称" :rules="[{ required: true, message: '请输入商品名称!' }]"
:label-col="{ span: 2 }"> :label-col="{ span: 2 }">
<a-input v-model:value="modelRef.subject" /> <a-input v-model:value="modelRef.subject" />
...@@ -127,7 +129,7 @@ ...@@ -127,7 +129,7 @@
<div style="margin-right:20px">划线价</div> <div style="margin-right:20px">划线价</div>
<a-input-number style="width: 200px" :min="0" string-mode <a-input-number style="width: 200px" :min="0" string-mode
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')" :parser="value => value.replace(/\$\s?|(,*)/g, '')"
v-model:value="modelRef.markingprice" /> v-model:value="modelRef.markingprice" />
</div> </div>
</a-form-item> </a-form-item>
...@@ -137,7 +139,7 @@ ...@@ -137,7 +139,7 @@
<div style="margin-right:20px">售卖价</div> <div style="margin-right:20px">售卖价</div>
<a-input-number style="width: 200px" :min="0" string-mode <a-input-number style="width: 200px" :min="0" string-mode
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')" :parser="value => value.replace(/\$\s?|(,*)/g, '')"
v-model:value="modelRef.price" /> v-model:value="modelRef.price" />
</div> </div>
</a-form-item> </a-form-item>
...@@ -241,7 +243,7 @@ const value = ref<string>(""); ...@@ -241,7 +243,7 @@ const value = ref<string>("");
const status = ref<string>("0"); const status = ref<string>("0");
const previewImage = ref(""); const previewImage = ref("");
const previewVisible = ref(true); const previewVisible = ref(true);
let modelRef = ref<any>({}); const modelRef = ref<any>({});
const propsData = reactive<props>({ const propsData = reactive<props>({
isCad: 0, isCad: 0,
}); });
...@@ -290,8 +292,8 @@ const handleOk = async () => { ...@@ -290,8 +292,8 @@ const handleOk = async () => {
} }
}; };
const handleCancel = () => { const handleCancel = () => {
visible.value = false;
modelRef.value = {} modelRef.value = {}
visible.value = false;
} }
const onSearch = async () => { const onSearch = async () => {
const params = { const params = {
...@@ -314,11 +316,21 @@ const onBack = async (e: Number) => { ...@@ -314,11 +316,21 @@ const onBack = async (e: Number) => {
}; };
const onEdit = (e: any) => { const onEdit = (e: any) => {
visible.value = !visible.value; visible.value = !visible.value;
modelRef.value = e modelRef.value.parent = e.parent
modelRef.value.goodsid = e.goodsid
modelRef.value.picurl = e.picurl
modelRef.value.sellamount = e.sellamount
modelRef.value.sellcount = e.sellcount
modelRef.value.shortname = e.shortname
modelRef.value.status = e.status
modelRef.value.subject = e.subject
modelRef.value.tenantid = e.tenantid
modelRef.value.userid = e.userid
modelRef.value.body = e.body
modelRef.value.sellingmodel = e.price? '1':'0' modelRef.value.sellingmodel = e.price? '1':'0'
modelRef.value.price = e.price/100 modelRef.value.price = e.price/100
modelRef.value.markingprice = e.markingprice/100 modelRef.value.markingprice = e.markingprice/100
fileList.value[0].url = e.value.picurl fileList.value[0].url = e.picurl
}; };
const { resetFields, validate, validateInfos } = useForm( const { resetFields, validate, validateInfos } = useForm(
modelRef, modelRef,
...@@ -334,11 +346,8 @@ const { resetFields, validate, validateInfos } = useForm( ...@@ -334,11 +346,8 @@ const { resetFields, validate, validateInfos } = useForm(
const onSelectPlain = (e: any) => { const onSelectPlain = (e: any) => {
if (e.target.value === '0') { if (e.target.value === '0') {
modelRef.value.price = "0" modelRef.value.price = "0"
// free 0
modelRef.value.sellingmodel = e.target.value; modelRef.value.sellingmodel = e.target.value;
} }
}; };
const onSubmit = () => { const onSubmit = () => {
validate() validate()
...@@ -368,7 +377,6 @@ const init = async () => { ...@@ -368,7 +377,6 @@ const init = async () => {
}; };
const textChange = (e: any) => { const textChange = (e: any) => {
textarea.value = e textarea.value = e
console.log(e, '98', textarea.value);
} }
const onEditorFocus = (e: any) => { const onEditorFocus = (e: any) => {
......
...@@ -169,7 +169,7 @@ const rulesRef = reactive({ ...@@ -169,7 +169,7 @@ const rulesRef = reactive({
}); });
const { resetFields, validate } = useForm(formState, rulesRef); const { resetFields, validate } = useForm(formState, rulesRef);
const onSelect = (value: any, option: any) => { const onSelect = (value: any, option: any) => {
price.value = option.itemKey.price price.value = option.itemKey.price/100
} }
const onSubmit = () => { const onSubmit = () => {
validate() validate()
...@@ -230,9 +230,6 @@ const onSelectCheckboxValue = (e:any,index:any)=>{ ...@@ -230,9 +230,6 @@ const onSelectCheckboxValue = (e:any,index:any)=>{
}else{ }else{
checkboxValue.value.push(e) checkboxValue.value.push(e)
} }
console.log(checkboxValue.value);
} }
const showModal = () => { const showModal = () => {
visible.value = true; visible.value = true;
...@@ -259,7 +256,7 @@ onMounted(async () => { ...@@ -259,7 +256,7 @@ onMounted(async () => {
}) })
watch(formState,(newVal:any) => { watch(formState,(newVal:any) => {
if(newVal.paymentmodel =='0'){ if(newVal.paymentmodel =='0'){
price.value = optionss.value[newVal.subject.index].price price.value = optionss.value[newVal.subject.index].price/100
} }
}) })
......
...@@ -239,7 +239,22 @@ const handleOk =async(e: MouseEvent) => { ...@@ -239,7 +239,22 @@ const handleOk =async(e: MouseEvent) => {
} }
}; };
const onEdit = (e: any) => { const onEdit = (e: any) => {
formState.value =e formState.value.subject =e.subject
formState.value.userid =e.userid
formState.value.remark =e.remark
formState.value.shortname =e.shortname
formState.value.status =e.status
formState.value.starttime =e.starttime
formState.value.goodspayditch =e.goodspayditch
formState.value.id =e.id
formState.value.payment =e.payment
formState.value.paymentmodel =e.paymentmodel
formState.value.fullphone =e.fullphone
formState.value.expiremillisecond =e.expiremillisecond
formState.value.fullphone =e.fullphone
formState.value.goodsid =e.goodsid
formState.value.expireendtime =e.expireendtime
formState.value.createtime =e.createtime
value2.value = dayjs(moment(e.starttime).format(('YYYY/MM/DD')), dateFormat) value2.value = dayjs(moment(e.starttime).format(('YYYY/MM/DD')), dateFormat)
value3.value = dayjs(moment(e.starttime).format(('HH:mm')), 'HH:mm') value3.value = dayjs(moment(e.starttime).format(('HH:mm')), 'HH:mm')
value4.value = dayjs(moment(e.expireendtime).format(('YYYY-MM-DD')), dateFormat) value4.value = dayjs(moment(e.expireendtime).format(('YYYY-MM-DD')), dateFormat)
...@@ -310,7 +325,7 @@ const onSelectCheckboxValue = (e: any, index: any) => { ...@@ -310,7 +325,7 @@ const onSelectCheckboxValue = (e: any, index: any) => {
} }
const onSelect =(e:any,label:any,index:any)=>{ const onSelect =(e:any,label:any,index:any)=>{
formState.value.markingprice = listArray.value[label.index].price formState.value.markingprice = listArray.value[label.index].price/100
} }
onMounted(async () => { onMounted(async () => {
onSearch() onSearch()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment