| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710 |
- <template>
- <div>
- <basicDetails
- ref="details"
- :titleText="`${mainData.sonum}`"
- :editData="mainData"
- :mainAreaData="mainAreaData"
- turnPageId="20221224180302"
- idname="sa_orderid"
- ownertable="sa_order"
- tags=""
- :statusCheck="[
- { key: 'status', value: '审核' },
- { key: 'status', value: '提交' },
- { key: 'status', value: '关闭' },
- ]"
- :tabs="[
- '订单明细',
- '基本信息',
- '订单进度',
- '物流单',
- '发票记录',
- '收支明细',
- ]"
- @pageChange="pageChange"
- @onEditSuccess="queryMainData($route.query.id)"
- >
- <div slot="customOperation" class="inline-16">
- <Edit
- class="inline-16"
- v-if="
- tool.checkAuth($route.name, 'update') && mainData.status == '新建'
- "
- :data="mainData"
- @onSuccess="
- queryMainData();
- $refs.prod && $refs.prod.listData();
- "
- />
- <el-button
- :disabled="mainData.status !== '交期待确认'"
- type="primary"
- size="mini"
- @click="confirmdate"
- >{{$t('确认交期')}}</el-button
- >
- <el-button
- class="inline-16"
- v-if="tool.checkAuth($route.name, 'submit')"
- :disabled="mainData.status !== '新建' || mainData.qty === 0"
- type="primary"
- size="mini"
- @click="onSubmit('提交')"
- >{{$t('提 交')}}</el-button
- >
- <customBtn
- btnName="撤回"
- message="确认撤回当前订单吗?"
- idName="20230301190202"
- keyName="sa_orderid"
- :id="$route.query.id"
- @onSuccess="queryMainData"
- class="inline-16"
- v-if="
- mainData.status == '提交' && tool.checkAuth($route.name, 'reback')
- "
- />
- <el-button
- style="margin-left: 0px"
- v-else-if="tool.checkAuth($route.name, 'insert')"
- type="primary"
- size="mini"
- @click="onCopy"
- >{{$t('复 制')}}</el-button
- >
- <customBtn
- style="margin-left: 10px; display: inline-block !important"
- btnName="删 除"
- message="确认删除当前订单吗?"
- idName="20221108152102"
- keyName="sa_orderids"
- :id="[$route.query.id]"
- @onSuccess="$router.back()"
- v-if="
- mainData.status == '新建' && tool.checkAuth($route.name, 'delete')
- "
- />
- </div>
- <template #headerBottom>
- <div style="display: flex" v-if="Object.keys(mainData).length > 0">
- <div class="account_info">
- <div>
- <p class="normal-title" style="margin-bottom: 10px">{{$t('支付信息')}}</p>
- </div>
- <div class="reveive__panel inline-16">
- <p class="flex-align-center">
- <small>{{ $t("结算企业") }}:</small> <b>{{
- mainData.finance.enterprisename
- }}</b>
- </p>
- <div class="flex-align-center">
- <p class="inline-16">
- <small>{{ $t("账户名称") }}: </small
- >{{
- mainData.accountclass.accountname
- ? $t(mainData.accountclass.accountname)
- : $t("未选择账户")
- }}
- </p>
- <p class="inline-16">
- <small>{{ $t("账户余额") }}: </small
- ><b
- >¥{{
- tool.formatAmount(
- mainData.accountclass.balance
- ? mainData.accountclass.balance
- : 0,
- 2
- )
- }}</b
- >
- </p>
- <p>
- <small>{{ $t("信用额度") }}: </small
- >{{
- mainData.accountclass.creditquota
- ? tool.formatAmount(mainData.accountclass.creditquota, 2)
- : tool.formatAmount(mainData.accountclass.creditquota)
- }}
- </p>
-
- <p>
- <small>{{ $t("本单金额") }}: </small
- >{{
- mainData.rebate_used
- ? tool.formatAmount(
- mainData.defaultamount - rebateamount,
- 2
- )
- : tool.formatAmount(mainData.defaultamount)
- }}
- </p>
- </div>
- <div
- v-if="
- (mainData.type === '标准订单' ||
- mainData.type === '特殊订单') &&
- isusedrebate === 1
- "
- >
- <div v-if="checked" class="flex-align-center">
- <p class="inline-16">
- <small>{{ $t("返利金余额") }}: </small
- ><b>{{ tool.formatAmount(mainData.rebatebalance, 2) }}</b>
- </p>
- <p class="inline-16">
- <small>{{ $t("已使用返利金金额") }}: </small
- ><b>{{ tool.formatAmount(mainData.rebateamount, 2) }}</b>
- </p>
- </div>
- </div>
- </div>
- </div>
- <div class="address_info">
- <div>
- <p class="normal-title" style="margin-bottom: 10px">
- {{ $t("收货信息") }}
- </p>
- </div>
- <div class="reveive__panel inline-16">
- <div>
- <p class="inline-16">
- <b>{{ mainData.contactsEnterprise.enterprisename }}</b>
- </p>
- <p class="inline-16">
- <span class="inline-16"
- ><b>{{ mainData.contacts.name }}</b></span
- ><small>{{ mainData.contacts.phonenumber }}</small>
- </p>
- </div>
- <small
- >{{
- mainData.contacts.province
- ? mainData.contacts.province
- : "--"
- }}{{ mainData.contacts.city }}{{ mainData.contacts.county
- }}{{
- mainData.contacts.address ? mainData.contacts.address : ""
- }}</small
- >
- </div>
- </div>
- </div>
- </template>
- <!-- 基本信息 -->
- <div slot="slot1">
- <default-info :mainData="mainData"></default-info>
- </div>
- <!-- 订单明细 -->
- <div slot="slot0">
- <product-list
- :data="mainData"
- ref="prod"
- @select="select"
- @qtyChange="queryMainData"
- @onSuccess="queryMainData"
- >
- <div slot="operation">
- <importFile
- v-if="tool.checkAuth($route.name, 'importOrderMx')"
- class="inline-16"
- :bindData="{
- ownertable: 'sa_order',
- ownerid: $route.query.id,
- usetype: 'default',
- }"
- :errorUrl="errorUrl"
- @clearUrl="errorUrl = null"
- @onSuccess="bindImportOrder"
- ></importFile>
- <el-button class="inline-16" :disabled="mainData.status !== '审核' || selection.length === 0" size="small" type="primary" @click="adddispatch">{{$t(`一键发货`)}}</el-button>
- </div>
- </product-list>
- </div>
- <!-- 订单进度 -->
- <div slot="slot2">
- <orderprogress></orderprogress>
- </div>
- <!-- 居间费明细 -->
- <!-- <div slot="slot3">
- <rebat></rebat>
- </div>-->
- <!-- <div slot="slot4">
- <dispatch></dispatch>
- </div> -->
- <!-- 物流单 -->
- <div slot="slot3">
- <logistics></logistics>
- </div>
- <!-- 发票记录 -->
- <div slot="slot4">
- <invoiceTable></invoiceTable>
- </div>
- <!-- 收支明细 -->
- <div slot="slot5">
- <revenue :data="mainData"></revenue>
- </div>
- </basicDetails>
- <el-dialog
- append-to-body
- :title="$t(`退回原因`)"
- :visible.sync="dialogVisible"
- width="400px"
- >
- <el-input
- v-model="backreason"
- type="textarea"
- :placeholder="$t(`请输入退回原因`)"
- ></el-input>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false" size="small">{{
- $t("取 消")
- }}</el-button>
- <el-button type="primary" @click="onRebanck" size="small">{{
- $t("确 定")
- }}</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import Edit from "../modules/edit";
- import defaultInfo from "./tabs/defaultInfo.vue";
- import productList from "../modules/productlist.vue";
- import rebat from "./tabs/rebatesettlement.vue";
- import orderprogress from "./tabs/orderpProgress.vue";
- import logistics from "./tabs/logistics.vue";
- import dispatch from "./tabs/dispatch.vue";
- import invoiceTable from "./tabs/invoiceTable.vue";
- import revenue from "./tabs/revenueAndExp.vue";
- import importFile from "../modules/importFile.vue";
- export default {
- name: "detail",
- data() {
- return {
- mainData: {},
- mainAreaData: {},
- backreason: "",
- dialogVisible: false,
- errorUrl: null,
- isusedrebate: "",
- checked: 0,
- rebateamount: "",
- typeNew:'',
- selection:[]
- };
- },
- provide() {
- return {
- thisDetail: () => this,
- };
- },
- components: {
- Edit,
- defaultInfo,
- productList,
- rebat,
- orderprogress,
- dispatch,
- logistics,
- invoiceTable,
- revenue,
- importFile,
- },
- methods: {
- async queryMainData(id) {
- if (this.typeNew == '提交'){
- const res = await this.$api.requested({
- id: type === "审核" ? 20221108153502 : 20221108153402,
- content: {
- sa_orderid: this.mainData.sa_orderid,
- sys_enterpriseid: this.mainData.sys_enterpriseid,
- sa_accountclassid: this.mainData.accountclass.sa_accountclassid,
- },
- });
- this.tool.showMessage(res, async () => {
- this.typeNew = ''
- this.queryMainData();
- });
- }else {
- return new Promise(async (re, rj) => {
- const res = await this.$api.requested({
- id: "20221108151302",
- content: {
- nocache: true,
- sa_orderid: this.$route.query.id,
- },
- });
- this.mainData = res.data;
- this.checked = this.mainData.rebate_used;
- if (this.mainData.rebateamount > this.mainData.defaultamount) {
- this.rebateamount = this.tool.formatAmount(
- +this.mainData.defaultamount / 2
- );
- } else {
- this.rebateamount = this.mainData.rebateamount;
- }
- this.changeDataStructure();
- this.queryUsedrebate();
- re();
- });
- }
- },
- changeDataStructure() {
- let that = this;
- this.mainAreaData = [
- {
- label: "订单类型",
- value: this.mainData.type,
- },
- {
- label: "订单状态",
- value: this.$t(this.mainData.status),
- style: function () {
- let style = {};
- switch (that.mainData.status) {
- case "新建":
- style = { color: "#3874f6" };
- break;
- case "提交":
- style = { color: "#67c23a" };
- break;
- case "交期待确认":
- style = { color: "#f56c6c" };
- break;
- case "交期确认":
- style = { color: "#67C23A" };
- break;
- case "审核":
- style = { color: "#e6a23c" };
- break;
- case "关闭":
- style = { color: "#ccc" };
- break;
- default:
- break;
- }
- return style;
- },
- },
- {
- label: "单据日期",
- value: this.mainData.billdate,
- },
- {
- label: "合计数量",
- value: this.mainData.qty,
- style: function () {
- let style = { color: "#ff0000" };
- return style;
- },
- },
- {
- // {{tool.formatAmount(scope.row.marketprice,2)}}
- label: "合计金额",
- value: this.tool.formatAmount(this.mainData.defaultamount, 2),
- style: function () {
- let style = { color: "#ff0000" };
- return style;
- },
- },
- {
- label: "折后金额",
- value: this.tool.formatAmount(this.mainData.amount, 2),
- style: function () {
- let style = { color: "#ff0000" };
- return style;
- },
- },
- /*{
- label:'企业名称',
- value:this.mainData.enterprisename
- },*/
- {
- label: "销售分类",
- value: this.mainData.saletype,
- },
- {
- label: "备注",
- value: this.mainData.remarks,
- },
- {
- label: "核销状态",
- value: this.mainData.writeoffstatus,
- style:function () {
- let style = {}
- switch (that.mainData.writeoffstatus) {
- case '已核销':
- style = {color:"#67c23a"}
- break;
- case '部分核销':
- style = {color:"#e6a23c"}
- break;
- case '未核销':
- style = {color:"#f56c6c"}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label: "开票状态",
- value: this.mainData.invoicestatus,
- style:function () {
- let style = {}
- switch (that.mainData.invoicestatus) {
- case '已开票':
- style = {color:"#67c23a"}
- break;
- case '部分开票':
- style = {color:"#e6a23c"}
- break;
- case '未开票':
- style = {color:"#f56c6c"}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label: "运费状态",
- value: this.$t(this.mainData.freightstatus),
- },
- {
- label: "项目名称",
- value: this.mainData.projectname,
- },
- {
- label: "项目备注",
- value: this.mainData.projectnote,
- },
- {
- label: "退回原因",
- value: this.mainData.backreason,
- },
- ];
- },
- // 监听切换数据,上一页,下一页
- pageChange(id, rowindex, tabIndex) {
- this.$router.replace({
- path: "/agent_orderDetails",
- query: { id: id, rowindex: rowindex },
- });
- this.queryMainData(id);
- },
- // 提交审核订单
- onSubmit(type) {
- this.$confirm(
- this.$t("是否") + `“${this.$t(type)}”` + this.$t("该订单"),
- this.$t("提示"),
- {
- confirmButtonText: this.$t("确定"),
- cancelButtonText: this.$t("取消"),
- type: "warning",
- }
- )
- .then(async () => {
- if (this.$refs.prod.time == null){
- const res = await this.$api.requested({
- id: type === "审核" ? 20221108153502 : 20221108153402,
- content: {
- sa_orderid: this.mainData.sa_orderid,
- sys_enterpriseid: this.mainData.sys_enterpriseid,
- sa_accountclassid: this.mainData.accountclass.sa_accountclassid,
- },
- });
- this.tool.showMessage(res, async () => {
- this.queryMainData();
- });
- }else {
- this.typeNew = type
- }
- })
- .catch((err) => {
- this.$message({
- type: "info",
- message: err,
- });
- });
- },
- // 查询站点是否使用返利金
- async queryUsedrebate() {
- const res = await this.$api.requested({
- classname: "webmanage.site.site",
- method: "querySite_Parameter",
- content: {},
- });
- this.isusedrebate = res.data.order_rebate_used;
- console.log(this.isusedrebate);
- },
- // 反审核订单
- onReturnCheck() {
- this.$confirm(this.$t(`是否反审核该订单`), this.$t("提示"), {
- confirmButtonText: this.$t("确定"),
- cancelButtonText: this.$t("取消"),
- type: "warning",
- })
- .then(async () => {
- const res = await this.$api.requested({
- id: 20230102141502,
- content: {
- sa_orderid: this.mainData.sa_orderid,
- },
- });
- this.tool.showMessage(res, () => {
- this.queryMainData();
- });
- })
- .catch((err) => {
- this.$message({
- type: "info",
- message: err,
- });
- });
- },
- async onRebanck() {
- const res = await this.$api.requested({
- id: 20221108161902,
- content: {
- sys_enterpriseid: this.mainData.sys_enterpriseid,
- sa_accountclassid: this.mainData.accountclass.sa_accountclassid,
- sa_orderid: this.mainData.sa_orderid,
- backreason: this.backreason, //退回原因,可选
- },
- });
- this.tool.showMessage(res, () => {
- this.queryMainData();
- this.dialogVisible = false;
- });
- },
- async closeOrder() {
- const res = await this.$api.requested({
- id: 20221108164502,
- content: {
- sa_orderids: [this.$route.query.id],
- },
- });
- this.tool.showMessage(res, () => {
- this.queryMainData();
- this.dialogVisible = false;
- });
- },
- async confirmdate() {
- const res = await this.$api.requested({
- id: 20221230094802,
- content: {
- sa_orderid: this.$route.query.id,
- },
- });
- this.tool.showMessage(res, () => {
- this.queryMainData();
- });
- },
- async onCopy() {
- const res = await this.$api.requested({
- id: 20230102144502,
- content: {
- sa_orderid: this.$route.query.id,
- },
- });
- this.tool.showMessage(res, () => {
- let route = this.$route;
- if (route.path !== "/taskDetails") {
- this.oldRoute = { path: route.path, query: route.query };
- this.$store.dispatch("setHistoryRouter", this.oldRoute);
- }
- this.$router.replace({
- path: "/agent_orderDetails",
- query: { id: res.data.sa_orderid, rowindex: res.data.rowindex },
- });
- this.queryMainData(this.$route.query.id);
- });
- },
- reback() {
- this.$confirm(this.$t("确定撤回订单吗?"), this.$t("提示"), {
- confirmButtonText: this.$t("确定"),
- cancelButtonText: this.$t("取消"),
- type: "warning",
- })
- .then(async () => {
- const res = await this.$api.requested({
- id: 20230301190202,
- content: {
- sa_orderid: this.$route.query.id,
- },
- });
- this.tool.showMessage(res, () => {
- this.mainData();
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: this.$t("已取消"),
- });
- });
- },
- async bindImportOrder(id) {
- console.log(id);
- const res = await this.$api.requested({
- id: 20230227194803,
- content: {
- sa_orderid: this.$route.query.id,
- attachmentid: id,
- },
- });
- this.$refs["prod"].listData();
- if (res.data !== "成功") {
- this.errorUrl = res.data;
- }
- this.queryMainData();
- },
- select (data) {
- this.selection = data
- },
- async adddispatch () {
- const res = await this.$api.requested({
- "id": "20230220100604",
- "content": {
- "sa_orderid":this.mainData.sa_orderid,
- "sa_orderitemsids": this.selection.map(e=>{
- return e.sa_orderitemsid
- })
- }
- })
- this.tool.showMessage(res,()=>{
- let route = this.$route
- this.oldRoute = {path:route.path,query:route.query}
- this.$store.dispatch('setHistoryRouter',this.oldRoute)
- this.$router.replace({path:'/dispatchdetail',query:{id:res.data.sa_dispatchid,rowindex:res.data.rowindex}})
- })
- },
- },
- mounted() {
- this.queryMainData(this.$route.query.id);
- },
- created() {},
- };
- </script>
- <style scoped>
- .reveive__panel {
- font-size: 16px;
- line-height: 30px;
- padding: 0 10px;
- background: #d9ecff;
- border: 1px dashed #0676e7;
- }
- </style>
|