| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951 |
- <template>
- <div>
- <!-- <el-button :disabled="data.status !=='新建'" type="primary" size="mini" @click="onShow(drawer = true)">{{$t('编 辑')}}</el-button> -->
- <el-button
- type="primary"
- :disabled="data.type === '特殊订单'"
- size="mini"
- @click="onShow((drawer = true))"
- >{{ $t("编 辑") }}</el-button
- >
- <el-drawer :visible.sync="drawer" :wrapperClosable="false" direction="rtl" append-to-body size="80%">
- <div slot="title">
- <div class="flex-align-center">
- <p>
- <span style="font-size: 14px">{{ $t("订单合计") }}:</span
- ><span style="color: red; font-size: 16px"
- ><b
- >¥ {{ tool.formatAmount(data.defaultamount, 2) }}</b
- ></span
- >
- </p>
- </div>
- <div class="flex-align-center">
- <p
- v-if="freefreightamount"
- style="
- font-size: 13px !important;
- color: #8888;
- font-weight: normal;
- "
- >
- {{ $t(checkFreefreightamount) }}
- </p>
- </div>
- </div>
- <div class="drawer__panel">
- <!-- 项目订单显示信息 -->
- <div
- v-if="data.type === '项目订单'"
- class="reveive__panel normal-margin flex-align-center"
- >
- <p class="inline-16">
- <small>{{ $t("项目信息") }}:</small>{{ data.projectname }}
- </p>
- <p class="inline-16">
- <small>{{ $t("合同信息") }}:</small>{{ data.contract_title }}
- </p>
- <p class="inline-16">
- <small>{{ $t("领域") }}:</small>{{ data.tradefield }}
- </p>
- <p class="inline-16">
- <small>{{ $t("品牌") }}:</small>{{ data.brandname }}
- </p>
- </div>
- <div>
- <div class="mt-10">
- <p class="normal-title inline-16">{{ $t("支付信息") }}</p>
- </div>
- <div class="reveive__panel normal-margin">
- <p class="flex-align-center">
- <small>{{ $t("结算企业") }}: </small
- ><b>{{ defaultData.finance.enterprisename }}</b
- > <financeEnterprise
- v-if="data.type !== '项目订单'"
- @select="onSelect"
- ></financeEnterprise>
- </p>
- <div class="flex-align-center">
- <p class="inline-16">
- <small>{{ $t("账户余额") }}: </small
- ><b
- >¥{{
- tool.formatAmount(
- defaultData.accountclass.balance
- ? defaultData.accountclass.balance
- : 0,
- 2
- )
- }}</b
- >
- </p>
- <p class="inline-16">
- <small>{{ $t("账户名称") }}: </small
- >{{
- defaultData.accountclass.accountname
- ? $t(defaultData.accountclass.accountname)
- : $t("未选择账户")
- }}
- </p>
- <p>
- <small>{{ $t("本单金额") }}: </small
- >{{
- data.rebate_used
- ? tool.formatAmount(data.defaultamount - rebateamount, 2)
- : data.defaultamount
- }}
- </p>
- </div>
- <div
- v-if="
- (data.type === '标准订单' || data.type === '特殊订单') &&
- isusedrebate === 1
- "
- >
- <el-checkbox
- v-model="checked"
- :true-label="1"
- :false-label="0"
- @change="rebateUsedChange"
- >{{ $t("使用返利金") }}</el-checkbox
- >
- <div v-if="checked" class="flex-align-center">
- <p class="inline-16">
- <b
- >{{ $t("返利金余额") }}:{{
- tool.formatAmount(defaultData.rebatebalance, 2)
- }}</b
- >
- </p>
- <el-input
- class="inline-16"
- size="mini"
- style="width: 150px"
- v-model="data.rebateamount"
- @blur="useRebate(data.rebateamount)"
- :placeholder="$t(`输入使用金额`)"
- ></el-input>
- <small
- >({{ $t("返利金最高使用比例")
- }}{{ data.order_rebate_userate }})</small
- >
- </div>
- </div>
- </div>
- </div>
- <div class="flex-align-center normal-margin">
- <div style="flex: 1; margin-right: 10px">
- <div class="mt-10">
- <p class="normal-title inline-16">{{ $t("选择财务信息") }}</p>
- <el-popover
- placement="bottom"
- :title="$t(`选择财务信息`)"
- trigger="click"
- v-model="visible2"
- >
- <addAmountInfo
- style="text-align: right"
- :data="{ sys_enterpriseid: data.sys_enterpriseid }"
- @onSuccess="
- thisDetail()
- .queryMainData()
- .then(() => {
- setDefaultData();
- })
- "
- />
- <el-table :data="financiallist" style="width: 100%" size="mini">
- <el-table-column
- prop="enterprisename"
- :label="$t(`公司抬头`)"
- width="120"
- >
- </el-table-column>
- <el-table-column
- prop="address"
- :label="$t('开票地址')"
- width="120"
- >
- </el-table-column>
- <el-table-column
- prop="bank"
- :label="$t('开户行')"
- width="120"
- >
- </el-table-column>
- <el-table-column
- prop="bankcardno"
- :label="$t('开户账号')"
- width="120"
- >
- </el-table-column>
- <el-table-column :label="$t('操作')" width="120">
- <template slot-scope="scope">
- <el-button
- class="inline-16"
- type="text"
- @click="
- (defaultData.fin_info = scope.row), (visible2 = false)
- "
- size="mini"
- >{{ $t("选 择") }}</el-button
- >
- <delete-btn
- message="确定删除当前信息吗?"
- nameId="20221013160502"
- nameKey="sys_enterprise_financeids"
- :id="scope.row.sys_enterprise_financeid"
- @deleteSuccess="
- thisDetail()
- .queryMainData()
- .then(() => {
- setDefaultData();
- })
- "
- ></delete-btn>
- </template>
- </el-table-column>
- </el-table>
- <el-button slot="reference" type="text" size="mini">{{
- $t("选择其他")
- }}</el-button>
- </el-popover>
- </div>
- <div class="reveive__panel normal-margin">
- <p>
- <small>{{ $t("抬头") }}: </small
- ><span class="inline-16"
- ><b>{{ defaultData.fin_info.enterprisename }}</b></span
- >
- </p>
- <div class="flex-align-center">
- <p class="inline-16">
- <small>{{ $t("开票地址") }}: </small
- >{{
- defaultData.fin_info.address
- ? defaultData.fin_info.address
- : "--"
- }}
- </p>
- <p>
- <small>{{ $t("开户行") }}: </small>
- {{ defaultData.fin_info.bank }}  <small
- >{{ $t("开户账号") }}: </small
- >
- {{ defaultData.fin_info.bankcardno }}
- </p>
- </div>
- </div>
- </div>
- <div style="flex: 1">
- <div class="mt-10">
- <p class="normal-title inline-16">{{ $t("收货信息") }}</p>
- </div>
- <div class="reveive__panel normal-margin">
- <div>
- <p class="inline-16">
- <b>{{ selectEnterpriseInfo.enterprisename }}</b>
- </p>
- <el-popover
- placement="bottom"
- :title="$t(`选择企业`)"
- trigger="click"
- v-model="visible4"
- >
- <div
- class="flex-align-center"
- style="justify-content: space-between; margin-bottom: 10px"
- >
- <el-input
- size="small"
- v-model="enterpriseParam.content.where.condition"
- :placeholder="$t('请输入搜索内容')"
- style="width: 150px"
- @keyup.enter.native="
- getEnterpriseList(
- (enterpriseParam.content.pageNumber = 1)
- )
- "
- @clear="
- getEnterpriseList(
- (enterpriseParam.content.pageNumber = 1)
- )
- "
- clearable
- ></el-input
- >
- </div>
- <el-table
- :data="enterpriseList"
- style="width: 100%"
- size="mini"
- >
- <el-table-column
- prop="enterprisename"
- :label="$t(`企业名称`)"
- width="150"
- >
- </el-table-column>
- <el-table-column :label="$t('地址')" width="360">
- <template slot-scope="scope">
- {{ scope.row.province }}{{ scope.row.city
- }}{{ scope.row.county }}{{ scope.row.address }}
- </template>
- </el-table-column>
- <el-table-column :label="$t('操作')" width="120">
- <template slot-scope="scope">
- <el-button
- class="inline-16"
- type="text"
- @click="
- (selectEnterpriseInfo = scope.row),
- (defaultData.re_info = {}),
- receiveAddress(),
- (visible4 = false)
- "
- size="mini"
- >{{ $t("选 择") }}</el-button
- >
- <!-- <delete-btn
- message="确定删除当前地址吗?"
- nameId="20221009155903"
- nameKey="contactsid"
- :id="scope.row.contactsid"
- :isNumber="true"
- @deleteSuccess="receiveAddress"
- ></delete-btn> -->
- </template>
- </el-table-column>
- </el-table>
- <div class="container" style="text-align: right">
- <el-pagination
- background
- small
- :current-page="enterpriseParam.content.pageNumber"
- @current-change="enterprisePageChange"
- :page-size="enterpriseParam.content.pageSize"
- layout="total,prev, pager, next"
- :total="enterpriseTotal"
- >
- </el-pagination>
- </div>
- <el-button slot="reference" type="text" size="mini">{{
- $t("选择企业")
- }}</el-button>
- </el-popover>
- </div>
- <div>
- <p class="inline-16">
- <span class="inline-16"
- ><b>{{ defaultData.re_info.name }}</b></span
- ><small>{{ defaultData.re_info.phonenumber }}</small>
- </p>
- <el-popover
- placement="bottom"
- :title="$t(`选择地址`)"
- trigger="click"
- v-model="visible"
- >
- <div
- class="flex-align-center"
- style="justify-content: space-between; margin-bottom: 10px"
- >
- <el-input
- size="small"
- v-model="addressparam.content.where.condition"
- :placeholder="$t('请输入搜索内容')"
- style="width: 150px"
- @keyup.enter.native="
- receiveAddress((addressparam.content.pageNumber = 1))
- "
- @clear="
- receiveAddress((addressparam.content.pageNumber = 1))
- "
- clearable
- ></el-input
- >
- <addAddressInfo
- style="text-align: right"
- @onAddSuccess="receiveAddress()"
- :mainData="{ sys_enterpriseid: data.sys_enterpriseid }"
- />
- </div>
- <el-table
- :data="receiveAddresslist"
- style="width: 100%"
- size="mini"
- >
- <el-table-column
- prop="name"
- :label="$t('联系人')"
- width="90"
- >
- </el-table-column>
- <el-table-column
- prop="phonenumber"
- :label="$t(`电话`)"
- width="120"
- >
- </el-table-column>
- <el-table-column :label="$t('地址')" width="360">
- <template slot-scope="scope">
- {{ scope.row.province }}{{ scope.row.city
- }}{{ scope.row.county }}{{ scope.row.address }}
- </template>
- </el-table-column>
- <el-table-column :label="$t('操作')" width="150">
- <template slot-scope="scope">
- <editAddressInfo
- class="inline-16"
- :mainData="{
- sys_enterpriseid: data.sys_enterpriseid,
- }"
- :row="scope.row"
- @onAddSuccess="receiveAddress()"
- ></editAddressInfo>
- <el-button
- class="inline-16"
- type="text"
- @click="
- (defaultData.re_info = scope.row), (visible = false)
- "
- size="mini"
- >{{ $t("选 择") }}</el-button
- >
- <delete-btn
- message="确定删除当前地址吗?"
- nameId="20221009155903"
- nameKey="contactsids"
- :id="scope.row.contactsid"
- :isNumber="false"
- @deleteSuccess="receiveAddress"
- ></delete-btn>
- </template>
- </el-table-column>
- </el-table>
- <div
- class="container"
- v-if="addresstotal"
- style="text-align: right"
- >
- <el-pagination
- background
- small
- :current-page="addressparam.content.pageNumber"
- @current-change="addresPageChange"
- :page-size="addressparam.content.pageSize"
- layout="total,prev, pager, next"
- :total="addresstotal"
- >
- </el-pagination>
- </div>
- <el-button slot="reference" type="text" size="mini">{{
- $t("选择其他地址")
- }}</el-button>
- </el-popover>
- </div>
- <small
- >{{
- defaultData.re_info.province
- ? defaultData.re_info.province
- : "--"
- }}{{ defaultData.re_info.city }}{{ defaultData.re_info.county
- }}{{
- defaultData.re_info.address ? defaultData.re_info.address : ""
- }}</small
- >
- </div>
- </div>
- </div>
- <div class="normal-margin flex-align-center">
- <div class="inline-16">
- <small
- ><b>{{ $t("回签单") }}</b
- > </small
- >
- <el-radio-group v-model="signbackstatus">
- <el-radio label="不需要">{{ $t("不需要") }}</el-radio>
- <el-radio label="纸质件">{{ $t("纸质件") }}</el-radio>
- <el-radio label="扫描件">{{ $t("扫描件") }}</el-radio>
- </el-radio-group>
- </div>
- <div style="margin-left: 20px">
- <small
- ><b>{{ $t("销售类别") }}:</b> </small
- >
- <el-select
- v-model="saletype"
- size="small"
- :placeholder="$t('请选择')"
- >
- <el-option
- v-for="item in saleroptions"
- :key="item.value"
- :label="$t(item.remarks)"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- <div
- style="margin-left: 20px"
- v-if="
- siteId == 'HY' &&
- (data.type == '标准订单' || data.type == '项目订单')
- "
- >
- <small
- ><b>{{ $t("是否样品订单") }}:</b> </small
- >
- <el-radio-group v-model="data.typemx">
- <el-radio label="样品">{{ $t("是") }}</el-radio>
- <el-radio label="">{{ $t("否") }}</el-radio>
- </el-radio-group>
- </div>
- </div>
- <div class="mt-10" v-if="tool.checkAuth($route.name,'updShipping')">
- <p class="normal-title inline-16">{{$t(`运费方式`)}}</p>
- </div>
- <div class="mt-10 flex-align-center" v-if="tool.checkAuth($route.name,'updShipping')">
- <div :style="defaultData.freightstatus === '到付'?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin inline-16" @click="defaultData.freightstatus = '到付'">
- <p>{{$t(`到付`)}}</p>
- </div>
- <div :style="defaultData.freightstatus === '预付'?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin" @click="defaultData.freightstatus = '预付'">
- <p>{{$t(`预付`)}}</p>
- </div>
- </div>
- <div class="normal-margin">
- <p class="normal-title mt-10 inline-16">{{ $t("订单备注") }}</p>
- <el-input
- size="mini"
- class="order__note__input"
- type="textarea"
- v-model="defaultData.remarks"
- :autosize="{ minRows: 5 }"
- :placeholder="$t(`请输入订单备注`)"
- ></el-input>
- </div>
- <div
- class="normal-margin"
- v-if="data.type === '标准订单' || data.type === '特殊订单'"
- >
- <p class="normal-title mt-10 inline-16">{{ $t("项目备注") }}</p>
- <el-input
- size="mini"
- class="order__note__input"
- type="textarea"
- v-model="data.projectnote"
- :autosize="{ minRows: 5 }"
- :placeholder="$t(`请输入项目备注`)"
- ></el-input>
- </div>
- <div class="mt-10">
- <div>
- <p class="normal-title inline-16">{{ $t("订单产品") }}</p>
- <!-- <el-button type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button> -->
- </div>
- <el-row :gutter="10">
- <el-col :span="setcol">
- <product-list
- ref="prolist"
- :data="data"
- :type="'edit'"
- @onSuccess="onEditSuccess"
- ></product-list>
- </el-col>
- <!-- <el-col :span="24 - setcol">
- <add-product ref="addpro" :data="data" @onConfirm="onConfirm"></add-product>
- </el-col> -->
- </el-row>
- </div>
- </div>
- <div class="fixed__btn__panel">
- <el-button
- size="small"
- @click="drawer = false"
- class="normal-btn-width"
- >{{ $t("取 消") }}</el-button
- >
- <el-button
- size="small"
- type="primary"
- @click="onSubmit"
- class="normal-btn-width"
- >{{ $t("保存修改") }}</el-button
- >
- </div>
- </el-drawer>
- </div>
- </template>
- <script>
- import previewImage from "@/components/previewImage/index.vue";
- import productList from "./productlist.vue";
- import addProduct from "@/template/orderCanUseProduct/index.vue";
- import financeEnterprise from "@/template/orderCanUseFinance/index.vue";
- import addAmountInfo from "@/components/financialInfo/modules/add";
- import addAddressInfo from "@/HManagement/marketing2/agent/details/modules/address/add";
- import editAddressInfo from "@/HManagement/marketing2/agent/details/modules/address/edit";
- export default {
- props: ["data"],
- components: {
- previewImage,
- productList,
- addProduct,
- financeEnterprise,
- addAmountInfo,
- addAddressInfo,
- editAddressInfo,
- },
- inject: ["thisDetail"],
- computed: {
- checkFreefreightamount() {
- let result = "";
- switch (this.freefreightamount) {
- case -1:
- result = this.$t("不免运费");
- break;
- case 0:
- result = this.$t("免运费");
- break;
- default:
- result =
- this.data.amount >= this.freefreightamount
- ? this.$t("当前订单免运费")
- : this.$t("订单满") +
- `${this.tool.formatAmount(this.freefreightamount, 2)}${this.$t(
- "元免运费,当前还差"
- )}${this.tool.formatAmount(
- this.freefreightamount - this.data.amount,
- 2
- )}${this.$t("元")}`;
- break;
- }
- return result;
- },
- },
- data() {
- return {
- siteId: JSON.parse(sessionStorage.getItem("active_account")).siteid,
- checked: 0,
- visible: false,
- visible1: false,
- visible2: false,
- visible3: false,
- visible4: false,
- drawer: false,
- receiveAddresslist: [],
- selectEnterpriseInfo: "",
- enterpriseList: [],
- accountlist: [],
- rebateAccount: [],
- logisticcomlist: [],
- financiallist: [],
- saleroptions: [],
- defaultData: {
- re_info: {},
- logist_info: {},
- fin_info: {},
- finance: {},
- accountclass: {},
- account_index: 0,
- remarks: this.data.remarks,
- freightstatus:''
- },
- total: 0,
- setcol: 24,
- rebateamount: null,
- isusedrebate: 0,
- signbackstatus: "不需要",
- saletype: "",
- freefreightamount: "",
- addressparam: {
- id: "20230220002602",
- content: {
- nocache: true,
- pageNumber: 1,
- pageSize: 10,
- sys_enterpriseid: "",
- where: {
- condition: "",
- workaddress: 1,
- },
- },
- },
- enterpriseParam: {
- id: 20230320134702,
- content: {
- pageNumber: 1,
- pageSize: 15,
- sys_enterpriseid: "",
- where: {
- condition: "",
- },
- },
- },
- addresstotal: 0,
- enterpriseTotal: 0,
- };
- },
- created() {
- this.queryBasicInfo();
- },
- methods: {
- enterprisePageChange(n) {
- this.enterpriseParam.content.pageNumber = n;
- this.getEnterpriseList();
- },
- addresPageChange(n) {
- this.addressparam.content.pageNumber = n;
- this.receiveAddress();
- },
- async queryBasicInfo() {
- const res = await this.$api.requested({
- id: 20220920084001,
- content: {
- sys_enterpriseid: this.data.sys_enterpriseid,
- },
- });
- this.freefreightamount = res.data.freefreightamount;
- },
- async rebateUsedChange() {
- console.log(this.data);
- if (this.data.status != "新建") return false;
- let amount = Math.round((this.data.order_rebate_userate * this.data.defaultamount)*100)/100; //最大可用金额
- let rebatebalance = this.data.rebatebalance; //返利金账户余额
- const res = await this.$api.requested({
- id: 20230218225002,
- content: {
- sa_orderid: this.data.sa_orderid, //订单金额
- isused: this.checked, //是否使用
- rebateamount: rebatebalance > amount ? amount : rebatebalance, //返利金使用金额
- },
- });
- if (res.code == 0){
- this.tool.showMessage(res,()=>{})
- }else {
- this.$emit("onSuccess");
- }
- // this.data.rebate_used = res.msg !== '成功' ? this.data.rebate_used == 0?1:0:this.data.rebate_used
- },
- onShow() {
- this.initPage();
- },
- async initPage() {
- this.setDefaultData();
- this.receiveAddress();
- this.getEnterpriseList();
- this.queryUsedrebate();
- this.selectOptions();
- this.checked = this.data.rebate_used;
- if (this.data.rebateamount > this.data.defaultamount) {
- this.rebateamount = this.tool.formatAmount(
- +this.data.defaultamount / 2
- );
- } else {
- this.rebateamount = this.data.rebateamount;
- }
- },
- /* 获取当前经销商企业列表 */
- async getEnterpriseList() {
- this.enterpriseParam.content.sys_enterpriseid =
- this.data.sys_enterpriseid;
- const res = await this.$api.requested(this.enterpriseParam);
- this.enterpriseList = res.data;
- this.enterpriseTotal = res.total;
- console.log(this.enterpriseList, "企业列表");
- },
- // 收货信息:合作企业联系人
- async receiveAddress(fn) {
- this.addressparam.content.sys_enterpriseid =
- this.selectEnterpriseInfo.sys_enterpriseid;
- const res = await this.$api.requested(this.addressparam);
- this.addresstotal = res.total;
- this.receiveAddresslist = res.data;
- },
- // 设置默认信息
- async setDefaultData() {
- this.defaultData.rebatebalance = this.data.rebatebalance;
- this.defaultData.finance = this.data.finance;
- this.defaultData.fin_info = this.data.finance;
- this.defaultData.accountclass = this.data.accountclass;
- this.defaultData.re_info = this.data.contacts;
- this.defaultData.freightstatus = this.data.freightstatus
- this.financiallist = this.data.pay_finance;
- this.saletype = this.data.saletype;
- this.signbackstatus = this.data.signbackstatus;
- this.selectEnterpriseInfo = this.data.contactsEnterprise;
- },
- async onSubmit() {
- const res = await this.$api.requested({
- id: 20221108111402,
- content: {
- sa_orderid: this.$route.query.id,
- sys_enterpriseid: this.data.sys_enterpriseid, //订货企业id
- sa_accountclassid: this.defaultData.accountclass.sa_accountclassid, //营销账户类型ID
- sa_brandid: this.data.sa_brandid, //品牌ID
- sa_contractid: this.data.sa_contractid, //合同ID,标准订单不传
- sa_projectid: this.data.sa_projectid, //工程项目表ID,标准订单不传
- sys_enterprise_financeid:
- this.defaultData.fin_info.sys_enterprise_financeid, //合作企业财务信息ID(开票信息)
- sa_logiscompid: this.defaultData.logist_info.sa_logiscompid, //物流公司档案ID
- rec_contactsid: this.defaultData.re_info.contactsid, //合作企业联系人表ID(收货信息)
- type: this.data.type, //订单类型
- typemx: this.data.typemx, //明细分类,可选
- remarks: this.defaultData.remarks, //可选
- saler_hrid: this.data.saler_hrid, //销售人员hrid,业务员hrid
- signbackstatus: this.signbackstatus,
- tradefieldmx: this.data.tradefieldmx,
- pay_enterpriseid: this.data.pay_enterpriseid,
- tradefield: this.data.tradefield,
- saletype: this.saletype,
- rebate_used: this.checked, //默认0,是否使用返利金
- signbacknum: "",
- sa_promotionid: this.data.sa_promotionid,
- billdate: this.data.billdate,
- projectnote: this.data.projectnote,
- freightstatus:this.defaultData.freightstatus
- },
- });
- this.tool.showMessage(res, () => {
- this.$emit("onSuccess");
- this.drawer = false
- /*if (this.data.type === '标准订单' || this.data.type === '特殊订单') {
- this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
- }*/
- });
- },
- onEditSuccess() {
- this.$refs.prolist.listData();
- this.$emit("onSuccess");
- },
- addMoreProduct() {
- this.setcol === 12 ? (this.setcol = 24) : (this.setcol = 12);
- },
- // 订单添加商品
- async onConfirm(data) {
- const res = await this.$api.requested({
- id: 20221109093602,
- content: {
- sa_orderid: this.$route.query.id, //订单ID
- sys_enterpriseid: this.data.sys_enterpriseid, //企业ID
- type: "标准订单", //订单类型
- items: data.map((e) => {
- return {
- sa_orderitemsid: 0,
- itemid: e.itemid,
- qty: e.orderminqty,
- needdate: e.deliverydate,
- };
- }),
- },
- });
- this.tool.showMessage(res, () => {
- this.setcol = 24;
- this.$refs["prolist"].listData();
- this.$emit("onSuccess");
- });
- },
- async useRebate(e) {
- let that = this;
- /* 修改返利金 */
- let rebateamount = e;
- let amount = Math.round((this.data.order_rebate_userate * this.data.defaultamount)*100)/100; //最大可用金额
- const res = await this.$api.requested({
- id: 20230218225002,
- content: {
- sa_orderid: this.data.sa_orderid, //订单金额
- isused: 1, //是否使用
- rebateamount: rebateamount > amount ? amount : rebateamount,
- },
- });
- if (res.msg=='成功') {
- this.$emit("onSuccess");
- this.initPage();
- if (rebateamount > amount) {
- this.data.rebateamount = amount;
- this.$message({
- message: this.$t("返利金最大可用值") + amount,
- type: "warning",
- });
- }
- } else {
- this.$message.success(res.msg);
- }
- },
- // 查询站点是否使用返利金
- async queryUsedrebate() {
- const res = await this.$api.requested({
- classname: "webmanage.site.site",
- method: "querySite_Parameter",
- content: {},
- });
- this.isusedrebate = res.data.order_rebate_used;
- },
- // 选择结算企业
- onSelect(data) {
- this.defaultData.finance = data;
- this.financiallist = data.finance;
- data.finance.forEach((e) => {
- if (e.isdefault === 1) {
- this.defaultData.fin_info = e;
- } else {
- this.defaultData.fin_info =
- data.finance.length > 0 ? data.finance[0] : {};
- }
- });
- },
- async selectOptions() {
- const res = await this.$store.dispatch("optiontypeselect", "saletype");
- this.saleroptions = res.data;
- },
- },
- };
- </script>
- <style>
- </style>
- <style scoped>
- .reveive__panel {
- font-size: 14px;
- line-height: 30px;
- padding: 10px;
- background: #d9ecff;
- border: 1px dashed #0676e7;
- }
- .account__panel small,
- .reveive__panel small {
- color: #666;
- }
- .account__panel {
- width: calc(25% - 26px);
- padding: 10px;
- margin-bottom: 10px;
- border: 1px dashed #666;
- }
- .act {
- background: #d9ecff;
- border: 1px dashed #0676e7;
- }
- .image {
- width: 40px;
- height: 40px;
- margin: 0px auto;
- }
- .order__note__input {
- border: none;
- outline: none;
- /* margin-left: 10px; */
- /* border-bottom: 1px solid #f1f2f3; */
- flex: 1;
- }
- </style>
|