|
@@ -5,18 +5,18 @@
|
|
|
<div class="title-box">
|
|
<div class="title-box">
|
|
|
<h3>合同信息</h3>
|
|
<h3>合同信息</h3>
|
|
|
<el-icon class="icon" v-if="inputType && showBtn" @click="openUpdate1">
|
|
<el-icon class="icon" v-if="inputType && showBtn" @click="openUpdate1">
|
|
|
- <IEpEdit />
|
|
|
|
|
|
|
+ <IEpEdit/>
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<el-form-item prop="customer_name" label="客户名称">
|
|
<el-form-item prop="customer_name" label="客户名称">
|
|
|
- <el-input disabled readonly placeholder="客户名称" v-model="dataInfo.customer_name" :disabled="inputType" />
|
|
|
|
|
|
|
+ <el-input disabled readonly placeholder="客户名称" v-model="dataInfo.customer_name" :disabled="inputType"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="order_name" label="合同名称">
|
|
<el-form-item prop="order_name" label="合同名称">
|
|
|
- <el-input placeholder="合同名称" v-model="ruleForm.order_name" :disabled="inputType" />
|
|
|
|
|
|
|
+ <el-input placeholder="合同名称" v-model="ruleForm.order_name" :disabled="inputType"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item prop="" label="合同编号">
|
|
|
|
|
- <el-input placeholder="合同编号" v-model="ruleForm.order_no" :disabled="inputType" />
|
|
|
|
|
|
|
+ <el-form-item prop="order_no" label="合同编号">
|
|
|
|
|
+ <el-input placeholder="合同编号" v-model="ruleForm.order_no" :disabled="inputType"/>
|
|
|
<!-- <el-checkbox
|
|
<!-- <el-checkbox
|
|
|
@change="heTongChange"
|
|
@change="heTongChange"
|
|
|
style="margin-left: 20px"
|
|
style="margin-left: 20px"
|
|
@@ -26,7 +26,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="order_uid" label="签署人">
|
|
<el-form-item prop="order_uid" label="签署人">
|
|
|
<el-tree-select default-expand-all node-key="id" filterable v-model="ruleForm.order_uid" :data="userOptions"
|
|
<el-tree-select default-expand-all node-key="id" filterable v-model="ruleForm.order_uid" :data="userOptions"
|
|
|
- check-strictly :render-after-expand="false" :props="{
|
|
|
|
|
|
|
+ check-strictly :render-after-expand="false" :props="{
|
|
|
label: 'name',
|
|
label: 'name',
|
|
|
}" style="width: 100%" placeholder="签署人" clearable :disabled="inputType">
|
|
}" style="width: 100%" placeholder="签署人" clearable :disabled="inputType">
|
|
|
</el-tree-select>
|
|
</el-tree-select>
|
|
@@ -34,7 +34,7 @@
|
|
|
|
|
|
|
|
<el-form-item label="签署日期" prop="order_date">
|
|
<el-form-item label="签署日期" prop="order_date">
|
|
|
<el-date-picker :disabled="inputType" style="width: 100%" v-model="ruleForm.order_date" type="date"
|
|
<el-date-picker :disabled="inputType" style="width: 100%" v-model="ruleForm.order_date" type="date"
|
|
|
- placeholder="签署日期" value-format="YYYY-MM-DD" />
|
|
|
|
|
|
|
+ placeholder="签署日期" value-format="YYYY-MM-DD"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="is_virtual" label="虚拟合同">
|
|
<el-form-item prop="is_virtual" label="虚拟合同">
|
|
|
<el-radio-group v-model="ruleForm.is_virtual" :disabled="inputType">
|
|
<el-radio-group v-model="ruleForm.is_virtual" :disabled="inputType">
|
|
@@ -44,8 +44,8 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="contact_id" label="客户签署人">
|
|
<el-form-item prop="contact_id" label="客户签署人">
|
|
|
<el-select :disabled="inputType" style="width: 100%" v-model="ruleForm.contact_id" placeholder="客户签署人"
|
|
<el-select :disabled="inputType" style="width: 100%" v-model="ruleForm.contact_id" placeholder="客户签署人"
|
|
|
- filterable clearable>
|
|
|
|
|
- <el-option v-for="item in userData" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
|
|
+ filterable clearable>
|
|
|
|
|
+ <el-option v-for="item in userData" :key="item.id" :label="item.name" :value="item.id"/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- <el-form-item prop="h" label="联系方式">
|
|
<!-- <el-form-item prop="h" label="联系方式">
|
|
@@ -53,14 +53,14 @@
|
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
|
<el-form-item prop="" label="开始/结束日期">
|
|
<el-form-item prop="" label="开始/结束日期">
|
|
|
<el-date-picker :disabled="inputType" v-model="ruleForm.datetimerange" type="daterange" range-separator="至"
|
|
<el-date-picker :disabled="inputType" v-model="ruleForm.datetimerange" type="daterange" range-separator="至"
|
|
|
- start-placeholder="开始时间" end-placeholder="结束时间" value-format="YYYY-MM-DD" />
|
|
|
|
|
|
|
+ start-placeholder="开始时间" end-placeholder="结束时间" value-format="YYYY-MM-DD"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="amount_real" label="合同金额(元)">
|
|
<el-form-item prop="amount_real" label="合同金额(元)">
|
|
|
- <el-input :disabled="inputType" placeholder="合同金额(元)" v-model="ruleForm.amount_real" />
|
|
|
|
|
|
|
+ <el-input :disabled="inputType" placeholder="合同金额(元)" v-model="ruleForm.amount_real"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="owner_by" label="销售">
|
|
<el-form-item prop="owner_by" label="销售">
|
|
|
- <el-tree-select :disabled="inputType" default-expand-all node-key="id" filterable v-model="ruleForm.owner_by"
|
|
|
|
|
- :data="userOptions" check-strictly :render-after-expand="false" :props="{
|
|
|
|
|
|
|
+ <el-tree-select :disabled="inputType" default-expand-all node-key="id" filterable v-model="ruleForm.owner_by "
|
|
|
|
|
+ :data="userOptions" check-strictly :render-after-expand="false" :props="{
|
|
|
label: 'name',
|
|
label: 'name',
|
|
|
}" style="width: 100%" placeholder="选择销售" clearable>
|
|
}" style="width: 100%" placeholder="选择销售" clearable>
|
|
|
</el-tree-select>
|
|
</el-tree-select>
|
|
@@ -80,7 +80,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="truck_price" label="运费(元)">
|
|
<el-form-item prop="truck_price" label="运费(元)">
|
|
|
<div style="white-space: nowrap">
|
|
<div style="white-space: nowrap">
|
|
|
- <el-input :disabled="inputType" placeholder="运费" v-model="ruleForm.truck_price" />
|
|
|
|
|
|
|
+ <el-input :disabled="inputType" placeholder="运费" v-model="ruleForm.truck_price"/>
|
|
|
<span style="color: #8c8d8f; font-size: 12px">
|
|
<span style="color: #8c8d8f; font-size: 12px">
|
|
|
*运费包含在合同金额里
|
|
*运费包含在合同金额里
|
|
|
</span>
|
|
</span>
|
|
@@ -89,9 +89,9 @@
|
|
|
|
|
|
|
|
<el-form-item prop="" label="合同附件" style="width: 100%">
|
|
<el-form-item prop="" label="合同附件" style="width: 100%">
|
|
|
<el-upload class="upload-demo" action="#" :auto-upload="false" :on-change="fileOnChange"
|
|
<el-upload class="upload-demo" action="#" :auto-upload="false" :on-change="fileOnChange"
|
|
|
- :show-file-list="false" v-if="!inputType">
|
|
|
|
|
|
|
+ :show-file-list="false" v-if="!inputType">
|
|
|
<div class="file-btn">
|
|
<div class="file-btn">
|
|
|
- <el-button type="primary" size="small"> 文件上传 </el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" size="small"> 文件上传</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
|
|
|
|
@@ -101,7 +101,7 @@
|
|
|
{{ item.file_name || item.name }}
|
|
{{ item.file_name || item.name }}
|
|
|
</a>
|
|
</a>
|
|
|
<el-icon v-if="!inputType" class="close" @click="fileRemove(i)">
|
|
<el-icon v-if="!inputType" class="close" @click="fileRemove(i)">
|
|
|
- <IEpClose />
|
|
|
|
|
|
|
+ <IEpClose/>
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -110,24 +110,25 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="contract" label="相关合同">
|
|
<el-form-item prop="contract" label="相关合同">
|
|
|
- <el-select v-model="ruleForm.contract" placeholder="相关合同" style="width: 100%" multiple :disabled="inputType">
|
|
|
|
|
- <el-option v-for="item in contractOptions" :key="item.id" :label="item.order_name" :value="item.id" />
|
|
|
|
|
|
|
+ <el-select v-model="ruleForm.contract" placeholder="相关合同" style="width: 100%" multiple
|
|
|
|
|
+ :disabled="inputType">
|
|
|
|
|
+ <el-option v-for="item in contractOptions" :key="item.id" :label="item.order_name" :value="item.id"/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="remark" label="备注" style="width: 100%">
|
|
<el-form-item prop="remark" label="备注" style="width: 100%">
|
|
|
- <el-input :disabled="inputType" placeholder="备注" type="textarea" :rows="2" v-model="ruleForm.remark" />
|
|
|
|
|
|
|
+ <el-input :disabled="inputType" placeholder="备注" type="textarea" :rows="2" v-model="ruleForm.remark"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- 回款信息 -->
|
|
<!-- 回款信息 -->
|
|
|
<div class="title-box">
|
|
<div class="title-box">
|
|
|
<h3>回款计划</h3>
|
|
<h3>回款计划</h3>
|
|
|
<el-icon class="icon" @click="openUpdate2" v-if="inputType && showBtn">
|
|
<el-icon class="icon" @click="openUpdate2" v-if="inputType && showBtn">
|
|
|
- <IEpPlus />
|
|
|
|
|
|
|
+ <IEpPlus/>
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
<el-table :data="collectionTable" border>
|
|
<el-table :data="collectionTable" border>
|
|
|
- <el-table-column prop="num" label="期次" />
|
|
|
|
|
- <el-table-column prop="plan_money" label="金额" />
|
|
|
|
|
- <el-table-column prop="plan_date" label="日期" />
|
|
|
|
|
|
|
+ <el-table-column prop="num" label="期次"/>
|
|
|
|
|
+ <el-table-column prop="plan_money" label="金额"/>
|
|
|
|
|
+ <el-table-column prop="plan_date" label="日期"/>
|
|
|
<el-table-column label="操作" width="80" v-if="showBtn">
|
|
<el-table-column label="操作" width="80" v-if="showBtn">
|
|
|
<template #default="scoped">
|
|
<template #default="scoped">
|
|
|
<el-button v-if="inputType" type="primary" @click="openEdit2(scoped)" link>
|
|
<el-button v-if="inputType" type="primary" @click="openEdit2(scoped)" link>
|
|
@@ -140,10 +141,10 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<div style="margin: 10px 0" v-if="!inputType">
|
|
<div style="margin: 10px 0" v-if="!inputType">
|
|
|
- <el-input style="width: 220px" placeholder="期次" v-model="collectionForm.num" />
|
|
|
|
|
- <el-input style="width: 220px; margin: 0 10px" placeholder="金额(元)" v-model="collectionForm.plan_money" />
|
|
|
|
|
|
|
+ <el-input style="width: 220px" placeholder="期次" v-model="collectionForm.num"/>
|
|
|
|
|
+ <el-input style="width: 220px; margin: 0 10px" placeholder="金额(元)" v-model="collectionForm.plan_money"/>
|
|
|
<el-date-picker style="width: 220px; margin-right: 10px" v-model="collectionForm.plan_date" type="date"
|
|
<el-date-picker style="width: 220px; margin-right: 10px" v-model="collectionForm.plan_date" type="date"
|
|
|
- placeholder="日期" value-format="YYYY-MM-DD" />
|
|
|
|
|
|
|
+ placeholder="日期" value-format="YYYY-MM-DD"/>
|
|
|
<el-button type="primary" @click="addCollection">
|
|
<el-button type="primary" @click="addCollection">
|
|
|
+ 新增期次
|
|
+ 新增期次
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -154,20 +155,21 @@
|
|
|
<div class="title-box">
|
|
<div class="title-box">
|
|
|
<h3>回款记录</h3>
|
|
<h3>回款记录</h3>
|
|
|
<el-icon class="icon" v-if="showBtn" @click="openUpdate3">
|
|
<el-icon class="icon" v-if="showBtn" @click="openUpdate3">
|
|
|
- <IEpPlus />
|
|
|
|
|
|
|
+ <IEpPlus/>
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
<el-table :data="collectionLogs" border>
|
|
<el-table :data="collectionLogs" border>
|
|
|
- <el-table-column prop="return_money" label="回款金额" />
|
|
|
|
|
- <el-table-column prop="return_date" label="回款日期" />
|
|
|
|
|
- <el-table-column prop="remark" label="备注" />
|
|
|
|
|
|
|
+ <el-table-column prop="return_money" label="回款金额"/>
|
|
|
|
|
+ <el-table-column prop="return_date" label="回款日期"/>
|
|
|
|
|
+ <el-table-column prop="remark" label="备注"/>
|
|
|
<el-table-column label="附件">
|
|
<el-table-column label="附件">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<div v-if="row.files">
|
|
<div v-if="row.files">
|
|
|
<div v-for="item in JSON.parse(row.files)">
|
|
<div v-for="item in JSON.parse(row.files)">
|
|
|
<span v-if="isImageUrl(item.url)" style="color: var(--el-color-primary); cursor: pointer;"
|
|
<span v-if="isImageUrl(item.url)" style="color: var(--el-color-primary); cursor: pointer;"
|
|
|
- @click="lookImg(item.url)"> {{
|
|
|
|
|
- item.name }}</span>
|
|
|
|
|
|
|
+ @click="lookImg(item.url)"> {{
|
|
|
|
|
+ item.name
|
|
|
|
|
+ }}</span>
|
|
|
<a v-else :href="item.url" target="_blank" :download="item.name">
|
|
<a v-else :href="item.url" target="_blank" :download="item.name">
|
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
|
</a>
|
|
</a>
|
|
@@ -205,17 +207,17 @@
|
|
|
<div class="title-box" style="margin-top: 20px">
|
|
<div class="title-box" style="margin-top: 20px">
|
|
|
<h3>配送信息</h3>
|
|
<h3>配送信息</h3>
|
|
|
<el-icon class="icon" v-if="inputType && showBtn" @click="openUpdate4">
|
|
<el-icon class="icon" v-if="inputType && showBtn" @click="openUpdate4">
|
|
|
- <IEpEdit />
|
|
|
|
|
|
|
+ <IEpEdit/>
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
<el-form-item label="收货人">
|
|
<el-form-item label="收货人">
|
|
|
- <el-input style="width: 100%" placeholder="收货人" v-model="ruleForm.addr_name" :disabled="true" />
|
|
|
|
|
|
|
+ <el-input style="width: 100%" placeholder="收货人" v-model="ruleForm.addr_name" :disabled="true"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="收货人电话">
|
|
<el-form-item label="收货人电话">
|
|
|
- <el-input placeholder="收货人电话" v-model="ruleForm.addr_phone" :disabled="true" />
|
|
|
|
|
|
|
+ <el-input placeholder="收货人电话" v-model="ruleForm.addr_phone" :disabled="true"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="收货人地址" style="width: 100%">
|
|
<el-form-item label="收货人地址" style="width: 100%">
|
|
|
- <el-input :disabled="true" placeholder="收货人地址" type="textarea" :rows="2" v-model="ruleForm.address" />
|
|
|
|
|
|
|
+ <el-input :disabled="true" placeholder="收货人地址" type="textarea" :rows="2" v-model="ruleForm.address"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -241,9 +243,9 @@
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<el-table :data="goodsTable" border>
|
|
<el-table :data="goodsTable" border>
|
|
|
- <el-table-column prop="id" label="ID" width="60" />
|
|
|
|
|
- <el-table-column prop="goods_name" label="商品名称" />
|
|
|
|
|
- <el-table-column prop="goods_kind" label="商品类型" />
|
|
|
|
|
|
|
+ <el-table-column prop="id" label="ID" width="60"/>
|
|
|
|
|
+ <el-table-column prop="goods_name" label="商品名称"/>
|
|
|
|
|
+ <el-table-column prop="goods_kind" label="商品类型"/>
|
|
|
<el-table-column prop="" label="规格/售价">
|
|
<el-table-column prop="" label="规格/售价">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<div>
|
|
<div>
|
|
@@ -256,13 +258,13 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="合同价">
|
|
<el-table-column label="合同价">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="!inputType" placeholder="合同价" v-model="row.discount_amount" />
|
|
|
|
|
|
|
+ <el-input v-if="!inputType" placeholder="合同价" v-model="row.discount_amount"/>
|
|
|
<span v-else>{{ row.discount_amount }}</span>
|
|
<span v-else>{{ row.discount_amount }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="数量">
|
|
<el-table-column label="数量">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <el-input placeholder="数量" v-if="!inputType" v-model="row.count" />
|
|
|
|
|
|
|
+ <el-input placeholder="数量" v-if="!inputType" v-model="row.count"/>
|
|
|
<span v-else>{{ row.count }}</span>
|
|
<span v-else>{{ row.count }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -279,9 +281,9 @@
|
|
|
<div style="margin-top: 20px" v-if="ruleForm.sends && ruleForm.sends.length > 0">
|
|
<div style="margin-top: 20px" v-if="ruleForm.sends && ruleForm.sends.length > 0">
|
|
|
<h3>物流信息</h3>
|
|
<h3>物流信息</h3>
|
|
|
<el-table :data="ruleForm.sends" border>
|
|
<el-table :data="ruleForm.sends" border>
|
|
|
- <el-table-column prop="company_name" label="快递名称" />
|
|
|
|
|
- <el-table-column prop="send_number" label="快递单号" />
|
|
|
|
|
- <el-table-column prop="send_remark" label="备注" />
|
|
|
|
|
|
|
+ <el-table-column prop="company_name" label="快递名称"/>
|
|
|
|
|
+ <el-table-column prop="send_number" label="快递单号"/>
|
|
|
|
|
+ <el-table-column prop="send_remark" label="备注"/>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -316,21 +318,21 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<!-- 添加关联商品 -->
|
|
<!-- 添加关联商品 -->
|
|
|
- <goodsPage ref="goodsPageRef" @selectGoodsFun="selectGoodsFun" />
|
|
|
|
|
|
|
+ <goodsPage ref="goodsPageRef" @selectGoodsFun="selectGoodsFun"/>
|
|
|
<!-- 编辑组件 -->
|
|
<!-- 编辑组件 -->
|
|
|
<!-- 基本信息 -->
|
|
<!-- 基本信息 -->
|
|
|
<update1 ref="update1Ref" :contractOptions="contractOptions" :dataInfo="dataInfo" :userOptions="userOptions"
|
|
<update1 ref="update1Ref" :contractOptions="contractOptions" :dataInfo="dataInfo" :userOptions="userOptions"
|
|
|
- :userData="userData" @refreshFun="refreshFun" />
|
|
|
|
|
- <update2 ref="update2Ref" :dataInfo="dataInfo" @refreshList="refreshFun" />
|
|
|
|
|
- <update3 ref="update3Ref" :dataInfo="dataInfo" @refreshList="refreshFun" @addRefreshList="addRefreshList" />
|
|
|
|
|
- <update4 ref="update4Ref" :dataInfo="dataInfo" @refreshList="refreshFun" />
|
|
|
|
|
- <update5 ref="update5Ref" :dataInfo="dataInfo" @refreshList="refreshFun" />
|
|
|
|
|
- <imgDialog ref="imgDialogRef" />
|
|
|
|
|
|
|
+ :userData="userData" @refreshFun="refreshFun"/>
|
|
|
|
|
+ <update2 ref="update2Ref" :dataInfo="dataInfo" @refreshList="refreshFun"/>
|
|
|
|
|
+ <update3 ref="update3Ref" :dataInfo="dataInfo" @refreshList="refreshFun" @addRefreshList="addRefreshList"/>
|
|
|
|
|
+ <update4 ref="update4Ref" :dataInfo="dataInfo" @refreshList="refreshFun"/>
|
|
|
|
|
+ <update5 ref="update5Ref" :dataInfo="dataInfo" @refreshList="refreshFun"/>
|
|
|
|
|
+ <imgDialog ref="imgDialogRef"/>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { treePersonApi } from "@/plugins/api/system/user";
|
|
|
|
|
-import { fileApi } from "@/plugins/api/upload";
|
|
|
|
|
-import { optionsApi } from "@/plugins/api/customer/manage/contacts";
|
|
|
|
|
|
|
+import {treePersonApi} from "@/plugins/api/system/user";
|
|
|
|
|
+import {fileApi} from "@/plugins/api/upload";
|
|
|
|
|
+import {optionsApi} from "@/plugins/api/customer/manage/contacts";
|
|
|
import {
|
|
import {
|
|
|
addApi,
|
|
addApi,
|
|
|
detailApi,
|
|
detailApi,
|
|
@@ -359,12 +361,13 @@ const props = defineProps({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 查看图片
|
|
// 查看图片
|
|
|
let imgDialogRef = ref(null);
|
|
let imgDialogRef = ref(null);
|
|
|
|
|
+
|
|
|
function lookImg(src) {
|
|
function lookImg(src) {
|
|
|
imgDialogRef.value.initFun(src, '70%');
|
|
imgDialogRef.value.initFun(src, '70%');
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function isImageUrl(url) {
|
|
function isImageUrl(url) {
|
|
|
// 首先,检查URL是否包含至少一个'.'
|
|
// 首先,检查URL是否包含至少一个'.'
|
|
|
if (!url.includes('.')) {
|
|
if (!url.includes('.')) {
|
|
@@ -386,38 +389,51 @@ function isImageUrl(url) {
|
|
|
// let dataInfo = ref({})
|
|
// let dataInfo = ref({})
|
|
|
// 基本信息--1
|
|
// 基本信息--1
|
|
|
let update1Ref = ref(null);
|
|
let update1Ref = ref(null);
|
|
|
|
|
+
|
|
|
function openUpdate1() {
|
|
function openUpdate1() {
|
|
|
update1Ref.value.initFun(ruleForm.value);
|
|
update1Ref.value.initFun(ruleForm.value);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 回款计划--2
|
|
// 回款计划--2
|
|
|
let update2Ref = ref(null);
|
|
let update2Ref = ref(null);
|
|
|
|
|
+
|
|
|
function openUpdate2() {
|
|
function openUpdate2() {
|
|
|
update2Ref.value.initFun(ruleForm.value);
|
|
update2Ref.value.initFun(ruleForm.value);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function openEdit2(scoped) {
|
|
function openEdit2(scoped) {
|
|
|
update2Ref.value.initFun(scoped.row, "edit");
|
|
update2Ref.value.initFun(scoped.row, "edit");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 回款记录--3
|
|
// 回款记录--3
|
|
|
let update3Ref = ref(null);
|
|
let update3Ref = ref(null);
|
|
|
|
|
+
|
|
|
function openUpdate3() {
|
|
function openUpdate3() {
|
|
|
update3Ref.value.initFun(ruleForm.value);
|
|
update3Ref.value.initFun(ruleForm.value);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function openEdit3(row) {
|
|
function openEdit3(row) {
|
|
|
update3Ref.value.initFun(row, "edit");
|
|
update3Ref.value.initFun(row, "edit");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 配送信息--4
|
|
// 配送信息--4
|
|
|
let update4Ref = ref(null);
|
|
let update4Ref = ref(null);
|
|
|
|
|
+
|
|
|
function openUpdate4() {
|
|
function openUpdate4() {
|
|
|
update4Ref.value.initFun(ruleForm.value);
|
|
update4Ref.value.initFun(ruleForm.value);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 配送信息--5
|
|
// 配送信息--5
|
|
|
let update5Ref = ref(null);
|
|
let update5Ref = ref(null);
|
|
|
|
|
+
|
|
|
function openUpdate5() {
|
|
function openUpdate5() {
|
|
|
update5Ref.value.initFun(ruleForm.value);
|
|
update5Ref.value.initFun(ruleForm.value);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//
|
|
//
|
|
|
//联系人(客户)
|
|
//联系人(客户)
|
|
|
let userData = ref([]);
|
|
let userData = ref([]);
|
|
|
|
|
+
|
|
|
function getCustomer() {
|
|
function getCustomer() {
|
|
|
optionsApi({
|
|
optionsApi({
|
|
|
customer_id: props.dataInfo.customer_id,
|
|
customer_id: props.dataInfo.customer_id,
|
|
@@ -425,6 +441,7 @@ function getCustomer() {
|
|
|
userData.value = res;
|
|
userData.value = res;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
let ruleForm = ref({});
|
|
let ruleForm = ref({});
|
|
|
let rules = {
|
|
let rules = {
|
|
|
order_name: [
|
|
order_name: [
|
|
@@ -476,6 +493,14 @@ let rules = {
|
|
|
trigger: "change",
|
|
trigger: "change",
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
|
|
+ truck_price:
|
|
|
|
|
+ [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: "运费(元)",
|
|
|
|
|
+ trigger: "blur",
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
owner_by: [
|
|
owner_by: [
|
|
|
{
|
|
{
|
|
|
required: true,
|
|
required: true,
|
|
@@ -506,13 +531,16 @@ let rules = {
|
|
|
],
|
|
],
|
|
|
};
|
|
};
|
|
|
let dialogVisible = ref(false);
|
|
let dialogVisible = ref(false);
|
|
|
|
|
+
|
|
|
function handleClose(done) {
|
|
function handleClose(done) {
|
|
|
ElMessageBox.confirm("是否确定关闭此对话框?")
|
|
ElMessageBox.confirm("是否确定关闭此对话框?")
|
|
|
- .then(() => {
|
|
|
|
|
- done();
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => { });
|
|
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
let title = ref("");
|
|
let title = ref("");
|
|
|
let submitType = ref("");
|
|
let submitType = ref("");
|
|
|
let inputType = computed(() => {
|
|
let inputType = computed(() => {
|
|
@@ -544,7 +572,7 @@ function initFun(type, row) {
|
|
|
goodsTable.value = []; //商品
|
|
goodsTable.value = []; //商品
|
|
|
activities.value = []; //变更记录
|
|
activities.value = []; //变更记录
|
|
|
if (!props.showBtn) {
|
|
if (!props.showBtn) {
|
|
|
- ruleForm.value = { ...row };
|
|
|
|
|
|
|
+ ruleForm.value = {...row};
|
|
|
}
|
|
}
|
|
|
// 配送信息
|
|
// 配送信息
|
|
|
ruleForm.value.addr_name = props.dataInfo.shouhuoren;
|
|
ruleForm.value.addr_name = props.dataInfo.shouhuoren;
|
|
@@ -557,10 +585,11 @@ function initFun(type, row) {
|
|
|
getUsers();
|
|
getUsers();
|
|
|
getContract();
|
|
getContract();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function detailFun(id) {
|
|
function detailFun(id) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
detailApi(id).then((res) => {
|
|
detailApi(id).then((res) => {
|
|
|
- ruleForm.value = { ...res };
|
|
|
|
|
|
|
+ ruleForm.value = {...res};
|
|
|
resolve(res);
|
|
resolve(res);
|
|
|
if (res.files_arr) {
|
|
if (res.files_arr) {
|
|
|
fileList.value = res.files_arr.slice();
|
|
fileList.value = res.files_arr.slice();
|
|
@@ -598,15 +627,19 @@ function detailFun(id) {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function refreshFun() {
|
|
function refreshFun() {
|
|
|
detailFun(ruleForm.value.id);
|
|
detailFun(ruleForm.value.id);
|
|
|
emit("refreshList");
|
|
emit("refreshList");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//
|
|
//
|
|
|
function addRefreshList(row) {
|
|
function addRefreshList(row) {
|
|
|
collectionLogs.value.push(row);
|
|
collectionLogs.value.push(row);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
const emit = defineEmits(["refreshList"]);
|
|
const emit = defineEmits(["refreshList"]);
|
|
|
|
|
+
|
|
|
function submit() {
|
|
function submit() {
|
|
|
if (!ruleFormRef.value) return;
|
|
if (!ruleFormRef.value) return;
|
|
|
ruleFormRef.value.validate((valid, fields) => {
|
|
ruleFormRef.value.validate((valid, fields) => {
|
|
@@ -614,8 +647,8 @@ function submit() {
|
|
|
let obj = Object.assign({}, ruleForm.value);
|
|
let obj = Object.assign({}, ruleForm.value);
|
|
|
obj.customer_id = props.dataInfo.id;
|
|
obj.customer_id = props.dataInfo.id;
|
|
|
if (
|
|
if (
|
|
|
- ruleForm.value.datetimerange &&
|
|
|
|
|
- ruleForm.value.datetimerange.length == 2
|
|
|
|
|
|
|
+ ruleForm.value.datetimerange &&
|
|
|
|
|
+ ruleForm.value.datetimerange.length == 2
|
|
|
) {
|
|
) {
|
|
|
obj.start_date = ruleForm.value.datetimerange[0];
|
|
obj.start_date = ruleForm.value.datetimerange[0];
|
|
|
obj.end_date = ruleForm.value.datetimerange[1];
|
|
obj.end_date = ruleForm.value.datetimerange[1];
|
|
@@ -626,15 +659,21 @@ function submit() {
|
|
|
//
|
|
//
|
|
|
obj.plans = [...collectionTable.value];
|
|
obj.plans = [...collectionTable.value];
|
|
|
if (
|
|
if (
|
|
|
- collectionForm.value.num &&
|
|
|
|
|
- collectionForm.value.plan_money &&
|
|
|
|
|
- collectionForm.value.plan_date
|
|
|
|
|
|
|
+ collectionForm.value.num &&
|
|
|
|
|
+ collectionForm.value.plan_money &&
|
|
|
|
|
+ collectionForm.value.plan_date
|
|
|
) {
|
|
) {
|
|
|
obj.plans.push(collectionForm.value);
|
|
obj.plans.push(collectionForm.value);
|
|
|
}
|
|
}
|
|
|
//
|
|
//
|
|
|
obj.goods = goodsTable.value.map((ele) => {
|
|
obj.goods = goodsTable.value.map((ele) => {
|
|
|
ele.sku_id = ele.id;
|
|
ele.sku_id = ele.id;
|
|
|
|
|
+ if (!ele.count || ele.count ==="") {
|
|
|
|
|
+ ele.count=1
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ele.discount_amount || ele.discount_amount ===""){
|
|
|
|
|
+ ele.discount_amount= ele.price_selling
|
|
|
|
|
+ }
|
|
|
return ele;
|
|
return ele;
|
|
|
});
|
|
});
|
|
|
if (ruleForm.value.contract) {
|
|
if (ruleForm.value.contract) {
|
|
@@ -655,15 +694,19 @@ function heTongChange(type) {
|
|
|
ruleForm.value.c = new Date();
|
|
ruleForm.value.c = new Date();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 销售
|
|
// 销售
|
|
|
let userOptions = ref([]);
|
|
let userOptions = ref([]);
|
|
|
|
|
+
|
|
|
function getUsers() {
|
|
function getUsers() {
|
|
|
treePersonApi().then((res) => {
|
|
treePersonApi().then((res) => {
|
|
|
userOptions.value = res;
|
|
userOptions.value = res;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 文件上传
|
|
// 文件上传
|
|
|
let fileList = ref([]);
|
|
let fileList = ref([]);
|
|
|
|
|
+
|
|
|
function fileOnChange(file) {
|
|
function fileOnChange(file) {
|
|
|
let formData = new FormData();
|
|
let formData = new FormData();
|
|
|
formData.append("file", file.raw);
|
|
formData.append("file", file.raw);
|
|
@@ -678,11 +721,14 @@ function fileOnChange(file) {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function fileRemove(i) {
|
|
function fileRemove(i) {
|
|
|
fileList.value.splice(i, 1);
|
|
fileList.value.splice(i, 1);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 相关合同
|
|
// 相关合同
|
|
|
let contractOptions = ref([]);
|
|
let contractOptions = ref([]);
|
|
|
|
|
+
|
|
|
function getContract() {
|
|
function getContract() {
|
|
|
contractApi({
|
|
contractApi({
|
|
|
customer_id: props.dataInfo.customer_id,
|
|
customer_id: props.dataInfo.customer_id,
|
|
@@ -690,9 +736,11 @@ function getContract() {
|
|
|
contractOptions.value = data;
|
|
contractOptions.value = data;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 回款信息
|
|
// 回款信息
|
|
|
let collectionTable = ref([]);
|
|
let collectionTable = ref([]);
|
|
|
let collectionForm = ref({});
|
|
let collectionForm = ref({});
|
|
|
|
|
+
|
|
|
function collectionDel(row) {
|
|
function collectionDel(row) {
|
|
|
collectionTable.value.splice(row.$index, 1);
|
|
collectionTable.value.splice(row.$index, 1);
|
|
|
}
|
|
}
|
|
@@ -710,29 +758,39 @@ function addCollection() {
|
|
|
collectionTable.value.push(collectionForm.value);
|
|
collectionTable.value.push(collectionForm.value);
|
|
|
collectionForm.value = {};
|
|
collectionForm.value = {};
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 回款记录
|
|
// 回款记录
|
|
|
let collectionLogs = ref([]);
|
|
let collectionLogs = ref([]);
|
|
|
|
|
|
|
|
// 商品明细
|
|
// 商品明细
|
|
|
let goodsTable = ref([]);
|
|
let goodsTable = ref([]);
|
|
|
let goodsPageRef = ref(null);
|
|
let goodsPageRef = ref(null);
|
|
|
|
|
+
|
|
|
function addGoodsFun() {
|
|
function addGoodsFun() {
|
|
|
goodsPageRef.value.initFun();
|
|
goodsPageRef.value.initFun();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function selectGoodsFun(arr) {
|
|
function selectGoodsFun(arr) {
|
|
|
if (arr && arr.length > 0) {
|
|
if (arr && arr.length > 0) {
|
|
|
arr.forEach((item) => {
|
|
arr.forEach((item) => {
|
|
|
|
|
+ console.log( item,"==============price_selling=======")
|
|
|
// 不再判断是否有相同的商品,直接添加
|
|
// 不再判断是否有相同的商品,直接添加
|
|
|
- // if (
|
|
|
|
|
- // !goodsTable.value.some((ele) => {
|
|
|
|
|
- // return ele.id == item.id;
|
|
|
|
|
- // })
|
|
|
|
|
- // ) {
|
|
|
|
|
- goodsTable.value.push(item);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ const existingItem = goodsTable.value.find((ele) => ele.id === item.id);
|
|
|
|
|
+ if (existingItem) {
|
|
|
|
|
+ // 如果商品已存在,数量 +1
|
|
|
|
|
+ existingItem.count = (parseInt(existingItem.count) || 0) + 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.count=parseInt(item.count|| 1)
|
|
|
|
|
+ if (!item.discount_amount){
|
|
|
|
|
+ item.discount_amount= item.price_selling
|
|
|
|
|
+ }
|
|
|
|
|
+ // 否则新增商品
|
|
|
|
|
+ goodsTable.value.push(item);
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function goodsDel(scoped) {
|
|
function goodsDel(scoped) {
|
|
|
if (!inputType.value) {
|
|
if (!inputType.value) {
|
|
|
goodsTable.value.splice(scoped.$index, 1);
|
|
goodsTable.value.splice(scoped.$index, 1);
|
|
@@ -744,6 +802,7 @@ function goodsDel(scoped) {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
let allData = computed(() => {
|
|
let allData = computed(() => {
|
|
|
let num = 0;
|
|
let num = 0;
|
|
|
let price = 0;
|
|
let price = 0;
|
|
@@ -763,7 +822,8 @@ let allData = computed(() => {
|
|
|
// 合同变更记录
|
|
// 合同变更记录
|
|
|
let activities = ref([]);
|
|
let activities = ref([]);
|
|
|
|
|
|
|
|
-onMounted(() => { });
|
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+});
|
|
|
defineExpose({
|
|
defineExpose({
|
|
|
initFun,
|
|
initFun,
|
|
|
});
|
|
});
|