| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="goBack(0)">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
- v-if="editButton" @click="confirmEditing">编 辑
- </el-button>
- <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
- :disabled="isSaveBtn" @click="editCustomer">保 存
- </el-button>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="info" size="small"
- :disabled="form.status != '已发货' || form.returnsNumber == form.goodsTotalNum || editButton"
- @click="getReturns">
- 销售退货
- </el-button>
- <el-button v-if="form.status != '已发货'" class="el-button--small-yh" style="margin-left: 6px;"
- type="success" size="small" :disabled="!form.id || editButton" @click="confirm(1)">确认到货
- </el-button>
- <el-button v-if="form.status == '已发货'" class="el-button--small-yh" style="margin-left: 6px;"
- type="danger" size="small" :disabled="!form.id || editButton" @click="confirm(2)">撤销到货
- </el-button>
- </div>
- </div>
- <div style="margin-top: 50px">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- <tempalte slot="customerName" slot-scope="{ row }">
- <dic-select v-model="form.customerName" placeholder="客户" key="id" label="cname" res="records"
- url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=KH" :filterable="true"
- :remote="true" dataName="cname" @selectChange="dicChange('customerName', $event)"
- :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售'"></dic-select>
- </tempalte>
- <template slot-scope="{row,index}" slot="contacts">
- <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
- filterable allow-create default-first-option @change="contactsChange($event)"
- :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售'">
- <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
- :value="item.contacts" />
- </el-select>
- </template>
- </avue-form>
- </trade-card>
- <trade-card title="明细信息">
- <el-tabs v-model="activeName" type="card">
- <el-tab-pane label="销售明细" name="sale_detail">
- <avue-crud :option="optionContacts" ref="formContacts" :data="form.orderItemsList" :key="key"
- @selection-change="selectionChange"
- @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 434)"
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 434)">
- <template slot-scope="{scope,row}" slot="menuLeft">
- <el-button type="primary" icon="el-icon-plus" size="small"
- :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售'"
- @click="rowAdd(row, 1)">添加商品</el-button>
- <el-button type="success" size="small"
- :disabled="!form.id || editButton || form.status == '已发货' || form.businessSource == '外部销售'"
- icon="el-icon-bottom" @click="excelDialogfun('名称')">按名称导入
- </el-button>
- <el-button type="success" size="small"
- :disabled="!form.id || editButton || form.status == '已发货' || form.businessSource == '外部销售'"
- icon="el-icon-bottom" @click="excelDialogfun('code')">按Code导入
- </el-button>
- <el-popover placement="top" width="400" trigger="click" @show="inventoryShow2()">
- <avue-crud :data="inventoryList" :option="inventoryOption">
- </avue-crud>
- <el-button slot="reference" type="primary" plain size="small"
- :disabled="selectionMultilist.length != 1">查看库存</el-button>
- </el-popover>
- <el-button type="primary" plain size="small"
- :disabled="selectionMultilist.length == 0 || editButton || form.status == '已发货'"
- @click="allClick('派发销售单')">派发销售单</el-button>
- <el-button type="danger" plain size="small" @click="allClick('撤销派发')"
- :disabled="selectionMultilist.length == 0 || editButton || form.status == '已发货'">撤销派发</el-button>
- <el-button type="primary" icon="el-icon-printer" size="small"
- @click="handlePrint">打印</el-button>
- <el-button type="danger" plain size="small" @click="batchDelete"
- :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售'">一键删除</el-button>
- </template>
- <template slot="goodsId" slot-scope="{ row }">
- {{ row.goodsName }}
- </template>
- <template slot="goodsNum" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" size="small" v-model="row.goodsNum"
- :precision="numberDecimal" :controls="false" @change="goodsNumblurfun(row)"
- style="width: 100%"></el-input-number>
- <span v-else>{{ row.goodsNum }}</span>
- </template>
- <template slot="price" slot-scope="{ row }">
- <el-input v-if="row.$cellEdit" size="small" v-model="row.price"
- style="width: 100%"></el-input>
- <span v-else>{{ row.price }}</span>
- </template>
- <template slot="dot" slot-scope="{ row }">
- <el-select v-if="row.$cellEdit" v-model="row.dot" filterable default-first-option
- @focus="picihaolistfun(row.goodsId)" @change="dotchangefun($event, row)"
- size="small">
- <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
- :value="item.dot"></el-option>
- </el-select>
- <span v-else>{{ row.dot }}</span>
- </template>
- <template slot="subTotalMoney" slot-scope="{ row }">{{ row.goodsNum * row.price
- }}</template>
- <template slot="remarks" slot-scope="{ row }">
- <el-input v-if="row.$cellEdit" size="small" v-model="row.remarks"
- style="width: 100%"></el-input>
- <span v-else>{{ row.remarks }}</span>
- </template>
- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button v-if="!row.$cellEdit" :size="size" :disabled="editButton || row.sendNum > 0"
- :type="type" icon="el-icon-edit" @click="rowCell(row, index)">编辑
- </el-button>
- <el-button v-else :size="size" :disabled="editButton || row.sendNum > 0" :type="type"
- icon="el-icon-plus" @click="rowSave(row, index)">保存
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="editButton || row.sendNum > 0"
- :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
- </el-button>
- </template>
- </avue-crud>
- <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
- :close-on-click-modal="false" v-dialog-drag>
- <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading"
- :upload-before="uploadBefore" :upload-after="uploadAfter">
- <template slot="excelTemplate">
- <el-button type="primary" @click="derivation">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- <p style="text-align: center;color: #DC0505">
- 温馨提示 第一次导入时请先下载模板
- </p>
- </el-dialog>
- </el-tab-pane>
- <el-tab-pane label="支付明细" name="payment_details">
- <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details"
- :data="dataList" @row-save="rowSave" @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)"
- @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)">
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="共享记录" name="outbound_records">
- <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
- :data="form.shareSalesItemsList" @row-save="rowSave" @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 435)"
- @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 435)">
- <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button :size="size" :disabled="disabled" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
- @click="rowDelBox(row, index)">删除
- </el-button>
- </template> -->
- </avue-crud>
- </el-tab-pane>
- </el-tabs>
- </trade-card>
- <report-dialog :switchDialog="switchDialog" reportName="轮胎商城-销售订单" :reportId="form.id"
- @onClose="onClose()"></report-dialog>
- </div>
- <el-dialog title="选择商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
- <el-row>
- <el-col :span="5">
- <div>
- <el-scrollbar>
- <basic-container>
- <avue-tree style="height: 60vh;overflow-y: auto" :option="treeOption"
- :data="treeDataGoods" @node-click="nodeClick" />
- </basic-container>
- </el-scrollbar>
- </div>
- </el-col>
- <el-col :span="19">
- <basic-container>
- <avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="crud"
- :search.sync="SelectSearch" @refresh-change="refreshChange" @search-change="goodsSearch"
- :page.sync="page" @on-load="onLoad" @resetColumn="resetCrud" @saveColumn="saveCrud">
- <template slot="menuLeft">
- <el-tabs v-model="activeNameTabs" @tab-click="tabHandle">
- <el-tab-pane label="查询结果" name="searchList" />
- <el-tab-pane label="已选定数据" name="importStaging" />
- </el-tabs>
- </template>
- <template slot="goodsNum" slot-scope="{row}">
- <el-input-number v-model="row.goodsNum" size="small" :controls="false"
- :precision="numberDecimal" @input="amountChange($event, row)" style="width: 100%" />
- </template>
- <template slot="dot" slot-scope="{row}">
- <!--使用allow-create属性即可通过在输入框中输入文字来创建新的条目。注意此时filterable必须为真。-->
- <!--本例还使用了default-first-option属性, 在该属性打开的情况下,按下回车就可以选中当前选项列表中的第一个选项,-->
- <!--无需使用鼠标或键盘方向键进行定位。-->
- <!--allow-create filterable default-first-option-->
- <el-select v-model="row.dot" filterable default-first-option size="small"
- @focus="picihaolistfun(row.id)" @change="dotchangefun($event, row)">
- <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
- :value="item.dot"></el-option>
- </el-select>
- <!--<span v-else>{{ row.dot }}</span>-->
- </template>
- <template slot="price" slot-scope="{row}">
- <el-input-number v-model="row.price" size="small" :controls="false"
- style="width: 100%" />
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-edit" size="small"
- @click.stop="importStagList(scope.row, scope.index)"
- v-if="activeNameTabs == 'searchList'"
- :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
- </el-button>
- <el-button type="text" icon="el-icon-delete" size="small"
- @click.stop="removeStagList(scope.row, scope.index)" v-else>移除
- </el-button>
- </template>
- <template slot="inventory" slot-scope="scope">
- <span style="color: #489fef">
- {{ Number(scope.row.inventory) }}
- </span>
- </template>
- </avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false" :loading="saveLoading">取 消</el-button>
- <el-button type="primary" @click="importGoods" :loading="saveLoading">导入</el-button>
- <!--<el-button type="primary" @click="importChoice" v-if="commodityData === true" :loading="saveLoading"-->
- <!-- :disabled="tableData.length !== 1">导入</el-button>-->
- </span>
- </el-dialog>
- <el-dialog title="派发销售单" append-to-body class="el-dialogDeep" :visible.sync="distributeVisible" width="60%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false"
- @close="distributeGoods">
- <div>
- <div style="display: flex;align-items: center;">
- <span>
- 共享公司:
- </span>
- <dic-select v-model="sharedCompany" placeholder="共享公司" key="id" label="deptName"
- url="/blade-system/dept/deptListAll" :filterable="true"
- @selectChange="dicChange('sharedCompany', $event)"></dic-select>
- </div>
- <avue-crud :data="selectionMultilist" :option="distributeOption">
- <template slot="outGoodsTotalShipNum" slot-scope="{row}">
- <el-input-number v-model="row.outGoodsTotalShipNum" size="small" :controls="false"
- style="width: 100%" @change="outGoodsChange(row)" />
- </template>
- <template slot-scope="{type,size,row,index}" slot="menu">
- <el-popover placement="top" width="400" trigger="click" @show="inventoryShow(row)">
- <avue-crud :data="inventoryList" :option="inventoryOption">
- </avue-crud>
- <el-button slot="reference" size="small" type="text">查看库存</el-button>
- </el-popover>
- </template>
- </avue-crud>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="distributeVisible = false" :loading="saveLoading" size="small">取 消</el-button>
- <el-button type="primary" @click="inDistribute" :loading="saveLoading" size="small">确认派发</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
- import { getDetails as getDetailsGods } from '@/api/tirePartsMall/basicData/commodityInformation'
- import {
- getDetails,
- submit,
- delOrderItem,
- checkOrder,
- confirmRefund,
- revokeCheckOrder,
- goodsListXs,
- goodsPageXs,
- distributeShareSales,
- revokeDistributeShareSales,
- confirmShipment,
- revokeShipment,
- listAllByGoodsId
- } from "@/api/tirePartsMall/basicData/shareSales";
- import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
- import reportDialog from "@/components/report-dialog/main";
- import { dateFormat } from "@/util/date";
- import checkSchedule from "@/components/checkL/checkSchedule";
- import check from "@/components/checkL/check";
- import dicSelect from "@/components/dicSelect/main";
- import commodityxsho from '../../configuration/commodityxsho.json'
- import TicketDistribution from "../../../oceanShipping/maritimeExport/components/ticketDistribution.vue";
- import M from "minimatch";
- import da from "element-ui/src/locale/lang/da";
- import { number } from "echarts";
- import { getCorpTypes } from "@/api/tirePartsMall/basicData/commodityInformation";
- import { getWorkDicts } from "../../../../api/system/dictbiz";
- import losbfeestemplate from "@/views/iosBasicData/losbfeestemplate/index.vue";
- import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
- import {
- getList as KHgetList
- } from "@/api/tirePartsMall/basicData/customerInformation";
- import { getToken } from "@/util/auth";
- import { isProcurement } from "@/api/basicData/configuration";
- export default {
- name: "detailsPage",
- data() {
- return {
- sharedCompany: null,
- distributeVisible: false,
- numberDecimal: 0,
- inventoryList: [],
- inventoryOption: {
- header: false,
- menu: false,
- align: 'center',
- column: [
- {
- label: '来源公司',
- prop: 'srcSalesCompanyName',
- overHidden: true,
- },
- {
- label: '商品名称',
- prop: 'goodsName',
- overHidden: true,
- },
- {
- label: '库存数量',
- prop: 'inventory',
- overHidden: true,
- }
- ]
- },
- distributeOption: {
- header: false,
- border: true,
- stripe: true,
- editBtn: false,
- delBtn: false,
- menuWidth: '80',
- align: 'center',
- column: [
- {
- label: '商品名称',
- prop: 'goodsName',
- width: 360,
- overHidden: true,
- },
- {
- label: '商品数量',
- prop: 'goodsNum',
- overHidden: true,
- },
- {
- label: '发货数量',
- prop: 'sendNum',
- overHidden: true,
- },
- {
- label: '派发数量',
- prop: 'outGoodsTotalShipNum',
- overHidden: true,
- }
- ]
- },
- excelBox: false,
- reportName: '', // 打印传的名字
- SelectSearch: {}, // 添加商品检索
- // 编辑还是保存
- mingxibaocun: true,
- // 批次号请求到的数据
- picihaolist: [],
- // 添加商品弹窗
- dialogVisible: false,
- // 弹窗高度
- // rowHeight: '',
- // 左侧选择搜索
- treeDataGoods: [],
- treeDeptId: '',
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 50, 100, 300, 500]
- },
- pageList: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- // 左侧选择
- treeOption: {
- addBtn: false,
- menu: false,
- size: "small",
- props: {
- labelText: "标题",
- label: "title",
- value: "id",
- }
- },
- templateUrl: '', // 模板url
- // 表格需要的配置
- optionTwo: {
- align: "center",
- height: "400",
- searchShow: true,
- searchShowBtn: false,
- menu: true,
- menuWidth: 80,
- searchSpan: 8,
- searchMenuSpan: 8,
- searchMenuPosition: "right",
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- border: true,
- index: true,
- dialogClickModal: false,
- searchIcon: true,
- searchIndex: 2,
- column: [
- {
- label: "商品名称",
- prop: "goodsName",
- search: true,
- width: 100,
- overHidden: true
- },
- {
- label: "商品编号",
- prop: "goodsCode",
- search: true,
- width: 100,
- overHidden: true
- },
- {
- label: "数量",
- prop: "goodsNum",
- width: 100,
- overHidden: true
- },
- {
- label: "单价",
- prop: "price",
- width: 100,
- overHidden: true
- },
- {
- label: "库存",
- prop: "inventory",
- width: 100,
- overHidden: true
- },
- {
- label: "规格型号",
- prop: "specificationAndModel",
- width: 100,
- overHidden: true
- },
- {
- label: "公司",
- prop: "salesCompanyName",
- width: 100,
- overHidden: true
- },
- {
- label: "品牌",
- prop: "brandName",
- width: 100,
- overHidden: true
- },
- {
- label: "花纹",
- prop: "brandItem",
- width: 100,
- overHidden: true
- },
- {
- label: "是否静音棉",
- prop: "originalFactory",
- width: 100,
- type: 'select',
- dicData: [{
- label: '否',
- value: "0"
- }, {
- label: '是',
- value: "1"
- }],
- overHidden: true
- },
- {
- label: "是否防爆",
- prop: "explosionProof",
- width: 100,
- type: 'select',
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }],
- overHidden: true
- },
- {
- label: "是否自修补",
- prop: "selfRecovery",
- width: 100,
- type: 'select',
- dicData: [{
- label: '否',
- value: "0"
- }, {
- label: '是',
- value: "1"
- }],
- overHidden: true
- }
- ]
- },
- loading: false,
- // 商品列表数据合计
- goodsListShow: [],
- // 商品列表暂存
- goodsListSave: [],
- saveLoading: false,
- commodityData: false,
- surplusRouteQuantityOption: [],
- tableData: [],
- // tabs切换
- activeNameTabs: 'searchList',
- data: [],
- courierCompaniesList: [],
- inventory: 0,
- isStatus: 1,
- goodsIdoptions: [],
- dataList: [],
- dicUrlWithCustomId: '',
- editButton: false, // 大编辑大隐藏显示
- isEditButton: false, // 大编辑是否禁用
- goods: [],
- isDisabled: false, // 表格删除的是否禁用
- isDisabledTask: false, // 撤销任务和生成任务的是否禁用
- contactsOption: [],
- isContacts: false, // 表单的联系人是否禁用
- checkData: {},
- buttonColor: 'success', // 初始颜色为success 生成任务和撤销任务颜色状态
- checkDialog: false, // 审核弹窗的开启关闭
- batchNo: '',
- switchDialog: false, // 打印弹窗的开启和关闭
- activeName: "sale_detail",
- disabled: false, // 表格按钮的禁用
- key: 0,
- form: {
- orderItemsList: [],
- paymentRecordsList: [],
- outboundRecordsList: [],
- freight: 5,
- },
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- label: "导入明细",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "上传中,请稍等",
- accept: '.xls,.xlsx',
- span: 24,
- propsHttp: {
- res: "data"
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-sales-part/ship/import-item"
- }
- ]
- },
- optionForm: {
- menuBtn: false,
- span: 8,
- disabled: false,
- column: [{
- label: '客户',
- prop: "customerName",
- disabled: false,
- formslot: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- // {
- // label: '业务员',
- // // disabled: false,
- // prop: "salerId",
- // type: "select",
- // props: {
- // label: "name",
- // value: "id"
- // },
- // dicUrl: "/api/blade-user/salerList",
- // filterable: true,
- // }, {
- // label: '仓库',
- // prop: "storageId",
- // type: 'select',
- // disabled: true,
- // placeholder: '仓库为空即为异地销售',
- // props: {
- // label: 'cname',
- // value: 'id'
- // },
- // dicUrl: '/api/blade-sales-part/storageDesc/listAll',
- // },
- {
- label: '联系人',
- type: "select",
- prop: "contacts",
- disabled: false,
- allowCreate: true,
- filterable: true,
- dicData: [],
- props: {
- label: 'address',
- value: 'id'
- },
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
- }, {
- label: '电话',
- disabled: false,
- prop: "phone",
- }, {
- label: '收货地址',
- prop: "recAddress",
- type: 'select',
- allowCreate: true,
- filterable: true,
- disabled: false,
- props: {
- label: 'address',
- value: 'address'
- },
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
- }, {
- label: '业务日期',
- prop: "businesDate",
- searchProp: "businesDateList",
- disabled: false,
- type: "datetime",
- value: dateFormat(new Date(), 'yyyy-MM-dd'),
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ]
- }, {
- label: '收款方式',
- prop: "receivableType",
- type: "select",
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- value: '网络支付'
- },
- {
- label: '业务来源',
- prop: "businessSource",
- disabled: true
- }, {
- label: '配送方式',
- type: 'select',
- prop: "shipType",
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- value: '物流',
- }, {
- label: '货运公司',
- type: 'select',
- prop: "logisticsCorpName",
- allowCreate: true,
- filterable: true,
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=tyre_express_company",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: '货运单号',
- disabled: false,
- prop: "expressNo"
- },
- {
- label: '成本',
- prop: "cost",
- display: false,
- disabled: true
- }, {
- label: '毛利',
- prop: "grossProfit",
- display: false,
- disabled: true
- }, {
- label: '销售金额',
- prop: "salesAmount",
- disabled: true
- }, {
- label: '运费',
- prop: "freight",
- disabled: true
- }, {
- label: '总金额',
- prop: "totalMoney",
- disabled: true
- }, {
- label: '已收金额',
- prop: "paymentAmountTl",
- disabled: true
- }, {
- label: '单据编号',
- prop: "ordNo",
- disabled: true
- }, {
- label: '来源单号',
- prop: "srcOrdNo",
- disabled: true
- }, {
- label: '退货数量',
- prop: "returnsNumber",
- disabled: true
- }, {
- label: '退货金额',
- prop: "returnsAmount",
- disabled: true
- }, {
- label: '备注',
- prop: "remarks",
- type: 'textarea',
- disabled: false,
- span: 16,
- minRows: 1
- }]
- },
- formContacts: {},
- optionContacts: {},
- optionContactsBack: {
- disabled: false,
- goodsId: '',
- border: true,
- align: 'center',
- index: true,
- addBtnText: "添加商品",
- updateBtnText: '保存',
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- // 航编辑开启
- cellBtn: false,
- span: 8,
- height: 500,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 150,
- dialogTop: 25,
- dialogWidth: "80%",
- summaryText: "合计",
- showSummary: true,
- selection: true,
- sumColumnList: [{
- name: "goodsNum",
- type: "sum"
- }, {
- name: "sendNum",
- type: "sum"
- }, {
- name: "profit",
- type: "sum"
- }, {
- name: "subTotalMoney",
- type: "sum"
- }, {
- name: "thisAmount",
- type: "sum"
- }, {
- name: "costprie",
- type: "sum"
- }, {
- name: "grossProfit",
- type: "sum"
- }, {
- name: "returnsNumber",
- type: "sum"
- }, {
- name: "returnsAmount",
- type: "sum"
- }],
- column: [{
- label: '商品名称',
- prop: 'goodsId',
- width: 250,
- disabled: false,
- remote: true,
- overHidden: true,
- hide: true,
- type: 'select',
- dicData: [],
- props: {
- label: 'goodsName',
- value: 'goodsId'
- },
- dicUrl: `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=&enableOrNot=1&stock=${this.goodsId}`
- }, {
- label: '商品名称',
- prop: 'goodsName',
- width: 250,
- disabled: false,
- remote: true,
- overHidden: true,
- }, {
- label: '库存',
- prop: 'inventory',
- width: 250,
- disabled: false,
- remote: true,
- overHidden: true,
- }, {
- label: '数量',
- prop: 'goodsNum',
- overHidden: true,
- disabled: false,
- cell: true,
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }, {
- validator: (rule, value, callback) => {
- console.log(this.formContacts.inventory);
- if (value < 0) {
- callback(new Error("数量不能小于0"));
- } else if (Number(value) > Number(this.formContacts.inventory)) {
- callback(new Error("数量不能大于库存"));
- } else {
- callback();
- }
- },
- trigger: "blur"
- }]
- },
- {
- label: '价格',
- prop: 'price',
- overHidden: true,
- width: 100,
- disabled: false,
- cell: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }, {
- validator: (rule, value, callback) => {
- if (value < 0) {
- callback(new Error("价格不能小于0"));
- } else {
- callback();
- }
- },
- trigger: "blur"
- }]
- },
- {
- label: '库存',
- prop: 'inventory',
- overHidden: true,
- hide: true,
- width: 100
- },
- {
- label: '商品编码',
- prop: 'goodsNo',
- overHidden: true,
- disabled: false,
- width: 100
- },
- {
- label: '品牌',
- prop: 'brandName',
- disabled: false,
- width: 100,
- overHidden: true,
- },
- {
- label: '规格型号',
- prop: 'propertyName',
- overHidden: true,
- disabled: false,
- width: 100
- }, {
- label: '花纹',
- prop: 'pattern',
- overHidden: true,
- disabled: false,
- width: 100
- }, {
- label: '商品描述',
- prop: 'goodsDescription',
- disabled: false,
- overHidden: true,
- width: 100
- },
- {
- label: '发货数量',
- prop: 'sendNum',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- // {
- // label: '利润',
- // prop: 'profit',
- // overHidden: true,
- // width: 100
- // },
- {
- label: '小计',
- prop: 'subTotalMoney',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- // {
- // label: '返利',
- // prop: 'thisAmount',
- // overHidden: true,
- // width: 100
- // },
- {
- label: '成本',
- prop: 'costprie',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- {
- label: '毛利',
- prop: 'grossProfit',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- {
- label: '退货数量',
- prop: "returnsNumber",
- overHidden: true,
- width: 100,
- disabled: true,
- },
- {
- label: '退货金额',
- prop: "returnsAmount",
- overHidden: true,
- width: 100,
- disabled: true,
- },
- {
- label: '备注',
- prop: "remarks",
- overHidden: true,
- width: 100,
- disabled: false,
- }
- ]
- },
- selectionMultilist: [], // 多选数据
- optionPaymentDetails: {},
- optionPaymentDetailsBack: {
- align: 'center',
- index: true,
- addBtnText: "录入明细",
- menu: false,
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- column: [{
- label: '支付编号',
- prop: 'serialNumber',
- overHidden: true,
- }, {
- label: '金额',
- prop: 'amount',
- overHidden: true,
- }, {
- label: '类型',
- prop: 'type',
- overHidden: true,
- }, {
- label: '支付时间',
- prop: 'createTime',
- overHidden: true,
- }]
- },
- optionOutboundRecords: {},
- optionOutboundRecordsBack: {
- align: 'center',
- index: true,
- menu: false,
- addBtnText: "录入明细",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- // menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- column: [{
- label: '商品名称',
- prop: 'goodsName',
- overHidden: true,
- },
- // {
- // label: '来源单号',
- // prop: 'ordNo'
- // },
- {
- label: '商品数量',
- prop: 'goodsNum',
- overHidden: true,
- }, {
- label: '单价',
- prop: 'price',
- overHidden: true,
- }, {
- label: '小计',
- prop: 'subTotalMoney',
- overHidden: true,
- }, {
- label: '共享公司',
- prop: 'sharedCompanyName',
- overHidden: true,
- }, {
- label: '状态',
- prop: 'sharedStatus',
- overHidden: true,
- }]
- }
- }
- },
- components: { SearchQuery, reportDialog, check, checkSchedule, dicSelect },
- props: {
- detailData: Object
- },
- async created() {
- this.optionContacts = await this.getColumnData(this.getColumnName(434), this.optionContactsBack);
- this.optionPaymentDetails = await this.getColumnData(this.getColumnName(269.2), this.optionPaymentDetailsBack);
- this.optionOutboundRecords = await this.getColumnData(this.getColumnName(435), this.optionOutboundRecordsBack);
- this.key++
- if (this.detailData.id) {
- this.editButton = true
- this.optionForm.disabled = true
- this.getDetail(this.detailData.id, true)
- }
- },
- methods: {
- confirmEditing() {
- this.editButton = false
- if (this.form.status != '已发货') {
- if (this.form.businessSource == '外部销售') {
- this.optionForm.disabled = false
- this.optionForm.column.forEach(item => {
- if (item.prop == 'shipType' || item.prop == 'logisticsCorpName' || item.prop == 'expressNo' || item.prop == 'remarks') {
- item.disabled = false
- } else {
- item.disabled = true
- }
- })
- }
- if (this.form.businessSource == '内部销售') {
- this.optionForm.disabled = false
- }
- }
- },
- outGoodsChange(row) {
- if (Number(row.outGoodsTotalShipNum) > Number(Number(row.goodsNum) - Number(row.sendNum))) {
- this.$set(row, 'outGoodsTotalShipNum', null)
- return this.$message.error("派发数量不能超过" + (Number(row.goodsNum) - Number(row.sendNum)));
- }
- },
- dicChange(name, row) {
- if (name == 'customerName') {
- if (row) {
- this.$set(this.form, 'customerId', row.id)
- getCustom({ id: row.id }).then(res => {
- if (res.data.data) {
- this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
- this.form.storageId = res.data.data.deliveryWarehouseId
- this.form.storageName = res.data.data.deliveryWarehouseName
- this.form.contacts = res.data.data.corpsAttnList[0].cname
- this.form.phone = res.data.data.corpsAttnList[0].tel
- this.contactsOption = res.data.data.corpsAddrList
- this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
- this.form.salerId = res.data.data.salesmanId
- this.form.salerName = res.data.data.salesmanName
- }
- })
- } else {
- this.form.customerId = ''
- this.form.customerName = ''
- this.dicUrlWithCustomId = ''
- this.form.storageId = ''
- this.form.contacts = ''
- this.form.phone = ''
- this.contactsOption = ''
- this.form.recAddress = ''
- this.form.salerId = ''
- this.form.salerName = ''
- this.form.storageName = ''
- }
- }
- if (name == 'sharedCompany') {
- if (row) {
- this.form.sharedCompanyId = row.id
- this.form.sharedCompanyName = row.deptName
- } else {
- this.form.sharedCompanyId = null
- this.form.sharedCompanyName = null
- }
- }
- },
- confirm(type) {
- if (type == 1) {
- for (let item of this.form.orderItemsList) {
- if (item.sendNum != item.goodsNum) {
- return this.$message.error("第" + Number(item.$index + 1) + "行明细未发货,请先发货");
- }
- }
- this.$confirm('是否确认发货?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- confirmShipment(this.form).then(res => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- });
- })
- }
- if (type == 2) {
- this.$confirm('是否撤销发货?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- revokeShipment(this.form).then(res => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- });
- })
- }
- },
- allClick(name) {
- if (name == '派发销售单') {
- for (let item of this.selectionMultilist) {
- if (!item.id) {
- return this.$message.error("请保存数据");
- }
- if (item.sendNum == item.goodsNum) {
- return this.$message.error("明细存在已派发完的数据,请重新选择");
- }
- }
- this.sharedCompany = null
- this.selectionMultilist.forEach(e => {
- e.outGoodsTotalShipNum = 0
- })
- this.distributeVisible = true
- }
- if (name == '撤销派发') {
- let ids = []
- for (let item of this.selectionMultilist) {
- if (item.sendNum == 0) {
- return this.$message.error("请正确选择明细");
- }
- ids.push(item.id)
- }
- this.$confirm('是否撤销派发?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- revokeDistributeShareSales({ itemIds: ids.join(',') }).then(res => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- });
- })
- }
- },
- // 数量失焦触发
- goodsNumblurfun(row) {
- if (Number(row.goodsNum) > Number(row.inventory)) {
- this.$set(row, 'goodsNum', null)
- return this.$message.warning("不能大于库存数量");
- }
- },
- inventoryShow(row) {
- this.inventoryList = []
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- listAllByGoodsId({ goodsCode: row.goodsNo }).then(res => {
- this.inventoryList = res.data.data
- }).finally(() => {
- loading.close();
- });
- },
- inventoryShow2() {
- this.inventoryList = []
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- listAllByGoodsId({ goodsCode: this.selectionMultilist[0].goodsNo }).then(res => {
- this.inventoryList = res.data.data
- }).finally(() => {
- loading.close();
- });
- },
- inDistribute() {
- if (!this.sharedCompany) {
- return this.$message.error("请选择共享公司");
- }
- for (let item of this.selectionMultilist) {
- if (item.outGoodsTotalShipNum == 0) {
- return this.$message.error("请输入派件数量");
- }
- }
- let obj = {}
- obj = {
- ...this.form,
- orderItemsList: this.selectionMultilist
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- distributeShareSales(obj).then(res => {
- this.$message.success("操作成功")
- this.distributeVisible = false
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- });
- },
- uploadAfter(res, done, loading, column) {
- if (Array.isArray(res)) {
- if (res instanceof Array) {
- this.form.orderItemsList = this.form.orderItemsList.concat(res)
- res.forEach(item => {
- dotList({
- storageId: this.form.storageId,
- goodsId: res.goodsId
- }).then(e => {
- this.findObject(this.optionContactsBack.column, "dot").dicData = e.data.data
- })
- })
- }
- } else {
- this.$message.error(res)
- }
- this.excelBox = false;
- loading = false;
- done(res);
- },
- derivation() {
- window.open(
- `${this.templateUrl}?${this.website.tokenHeader
- }=${getToken()}&stockId=${this.form.storageId}`
- );
- },
- uploadBefore(file, done, loading) {
- done();
- loading = true;
- },
- // 销售明细 导入按钮
- excelDialogfun(name) {
- if (!this.form.customerId) {
- this.$message.error('请选择客户')
- return
- }
- if (name == '名称') {
- this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-name'
- this.templateUrl = '/api/blade-sales-part/order/export-item-name'
- } else if (name == 'code') {
- this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-code'
- this.templateUrl = '/api/blade-sales-part/order/export-item-code'
- }
- this.excelBox = true
- },
- //生成退货单
- getReturns() {
- this.$confirm("您确定要退货吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$router.push({
- path: "/tirePartsMall/salesService/returns/index",
- query: {
- bsType: 'TKGX',
- id: this.form.id,
- }
- });
- })
- },
- // 获取左侧筛选
- getAllWorkDicts() {
- getCorpTypes({ whetherIntegral: '0' }).then(res => {
- this.treeDataGoods = res.data.data;
- });
- },
- //导入页左商品类型查询
- nodeClick(data) {
- this.treeDeptId = data.id;
- this.page.currentPage = 1;
- this.onLoad(this.page, { ...this.SelectSearch, goodsTypeId: this.treeDeptId });
- },
- closeGoods() {
- this.treeDataGoods = [];
- this.treeDeptId = "";
- this.activeNameTabs = "searchList";
- },
- //刷新触发
- refreshChange() {
- this.page.currentPage = 1;
- this.onLoad(this.page);
- },
- // 点击搜索触发
- goodsSearch(params, done) {
- this.page.currentPage = 1;
- params = {
- ...params,
- }
- this.onLoad(this.page, params);
- done()
- },
- rowCell(row) {
- this.$set(row, "$cellEdit", true);
- },
- rowSave(row) {
- this.$set(row, "$cellEdit", false);
- },
- // 标签页切换
- tabHandle(data) {
- if (data.name == 'searchList') {
- this.goodsListShow = this.data;
- this.page.total = this.pageList.total
- } else if (data.name == 'importStaging') {
- this.goodsListShow = this.goodsListSave;
- this.page.total = 0
- }
- },
- // 商品信息价格计算
- amountChange(value, row) {
- if (value > row.inventory) {
- this.$set(row, 'goodsNum', null)
- return this.$message.error("数量不能超过库存数量");
- }
- },
- importStagList(row, index, type) {
- this.goodsListSave.push(row);
- },
- removeStagList(row, index, type) {
- this.goodsListSave.splice(row.$index, 1)
- },
- //确认导入触发
- importGoods() {
- if (this.goodsListSave.length == 0) {
- return this.$message.error("请选择");
- }
- this.goodsListSave.forEach(item => {
- item.goodsNo = item.goodsCode
- item.propertyName = item.specificationAndModel
- item.pattern = item.brandItem
- item.costpriePrice = item.shareCost
- item.rebatePrice = item.costpriePrice
- item.subTotalMoney = Number(item.goodsNum * item.price) ? Number(item.goodsNum * item.price).toFixed(2) : 0,
- delete item.id
- this.form.orderItemsList.push(item)
- })
- this.dialogVisible = false
- },
- //导入商品弹窗列表查询
- onLoad(page, params = {}) {
- this.loading = true;
- goodsPageXs({
- current: page.currentPage,
- size: page.pageSize,
- ...Object.assign(params, this.SelectSearch)
- }).then(res => {
- res.data.data.records.forEach(e => {
- e.price = e.priceOne
- e.goodsNum = 0
- })
- this.goodsListShow = res.data.data.records
- this.page.total = res.data.data.total;
- this.data = res.data.data.records
- this.pageList.total = res.data.data.total;
- this.loading = false;
- })
- },
- //修改提交触发
- editCustomer() {
- this.$refs["form"].validate((valid, done) => {
- done();
- let picihao = false
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit({
- bsType: "GX",
- ...this.form
- }).then(res => {
- this.getDetail(res.data.data.id)
- this.$message.success("保存成功");
- }).finally(() => {
- loading.close();
- });
- } else {
- return false;
- }
- });
- },
- getDetail(id, type) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- })
- getDetails({ id: id }).then(res => {
- this.form = res.data.data
- if (res.data.data.status == '已发货') {
- this.optionForm.disabled = true
- }
- }).finally(() => {
- loading.close();
- })
- },
- rowDelBox(row, index, type) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- delOrderItem({ ids: row.id }).then(res => {
- this.form.orderItemsList.splice(index, 1);
- this.$message.success("操作成功!");
- });
- } else {
- this.form[type].splice(index, 1);
- this.$message.success("操作成功!");
- }
- }
- );
- },
- // 明细信息多选
- selectionChange(list) {
- this.selectionMultilist = list
- },
- // 一键删除
- batchDelete() {
- if (this.selectionMultilist.length == 0) {
- return this.$message.warning('请选择要删除的数据')
- }
- for (let item of this.selectionMultilist) {
- if (item.sendNum != 0) {
- return this.$message.error("已派发,不能删除");
- }
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let multiList = this.selectionMultilist
- let arr = this.form.orderItemsList
- // 获取有id 的数据
- const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
- // 把选中的删除掉
- multiList.forEach((item) => {
- for (let index in arr) {
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
- arr.splice(Number(index), 1)
- }
- }
- })
- // 有id 的处理
- if (itemsWithId.length != 0) {
- delOrderItem({ ids: arrIds.join(',') }).then(res => {
- this.$message.success("操作成功!");
- });
- }
- })
- },
- // 新增商品
- rowAdd(row, type) {
- if (!this.form.customerId) {
- this.$message.error('请选择客户')
- return
- }
- this.findObject(this.optionContactsBack.column, 'goodsId').dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=1&stock=${this.form.storageId}`
- this.optionContactsBack.column.forEach(its => {
- if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
- its.disabled = false
- } else {
- its.disabled = true
- }
- })
- this.getAllWorkDicts()
- this.goodsListSave = []
- setTimeout(res => {
- this.refreshChange()
- this.dialogVisible = true
- }, 300)
- // this.$refs.formContacts.rowAdd()
- },
- //打印
- handlePrint() {
- this.switchDialog = !this.switchDialog;
- },
- onClose(val) {
- this.switchDialog = val;
- },
- //自定义列保存
- async saveColumnTwo(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- isProcurement({ "param": "whether.model" }).then(res => {
- if (res.data.data == 1) {
- this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
- this.findObject(this.optionContacts.column, "rebatePrice").hide = true
- this.findObject(this.optionContacts.column, "rebateCostprie").hide = true
- this.findObject(this.optionContacts.column, "rebateProfit").hide = true
- this.findObject(this.optionContacts.column, "rebatePrice").showColumn = true
- this.findObject(this.optionContacts.column, "rebateCostprie").showColumn = true
- this.findObject(this.optionContacts.column, "rebateProfit").showColumn = true
- }
- })
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- isProcurement({ "param": "whether.model" }).then(res => {
- if (res.data.data == 1) {
- this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
- this.findObject(this.optionContacts.column, "rebatePrice").hide = true
- this.findObject(this.optionContacts.column, "rebateCostprie").hide = true
- this.findObject(this.optionContacts.column, "rebateProfit").hide = true
- this.findObject(this.optionContacts.column, "rebatePrice").showColumn = true
- this.findObject(this.optionContacts.column, "rebateCostprie").showColumn = true
- this.findObject(this.optionContacts.column, "rebateProfit").showColumn = true
- }
- })
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- goBack(type) {
- this.$emit("goBack", type);
- },
- // 弹框的重置
- resetCrud() {
- this.$message.success("重置成功");
- },
- // 弹窗的保存
- saveCrud() {
- this.$message.success("保存成功");
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- </style>
|