12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646 |
- <template>
- <div class="borderless">
- <div class="customer-head">
- <div class="customer-back">
- <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- </div>
- <el-button
- class="el-button--small-yh add-customer-btn"
- type="success" style="right: 140px;" @click="copyOrder">
- 复制新单
- </el-button>
- <el-button
- class="el-button--small-yh add-customer-btn"
- type="primary"
- :disabled="disabled"
- @click="editCustomer(false)"
- >{{ form.id ? '确认修改' : '确认新增' }}
- </el-button>
- </div>
- <div style="margin-top: 60px">
- <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
- <containerTitle title="基础资料"></containerTitle>
- <basic-container style="margin-bottom: 10px">
- <el-row>
- <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
- <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
- <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
- size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
- <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]"
- :configuration="configuration" style="width: 100%"/>
- <el-select v-else-if="item.prop === 'paymentType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small">
- <el-option v-for="(item,index) in paymentOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
- </el-select>
- <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled"></el-input>
- <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </basic-container>
- <containerTitle title="发货信息"></containerTitle>
- <basic-container style="margin-bottom: 10px">
- <el-row>
- <el-col v-for="(item,index) in contactInformation.column" :key="index" :span="item.span?item.span:8">
- <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
- <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled"/>
- <selectComponent v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]" :configuration="configuration" style="width: 100%"/>
- <el-input v-else-if="(item.prop === 'advancePayment') || (item.prop === 'settlmentAmount')" v-model="form[item.prop]" size="small" autocomplete="off" @change="computedCost"></el-input>
- <el-select v-else-if="item.prop === 'orderStatus'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small">
- <el-option v-for="(item,index) in statusOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
- </el-select>
- <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled"></el-input>
- <el-input v-else type="age" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </basic-container>
- <containerTitle title="商品信息"></containerTitle>
- <basic-container style="margin-bottom: 10px">
- <avue-crud
- :option="customerContact"
- v-model="contactsForm"
- :data="contactsData"
- ref="crudContact"
- @row-save="rowSave"
- @row-click="handleRowClick"
- @row-update="rowUpdate"
- @selection-change="productSelection"
- @row-del="rowDel"
- >
- <template slot="code" slot-scope="{row,index}">
- <span style="float: left;padding-top: 2px">{{ row.code }}</span>
- <el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
- </template>
- <template slot="orderQuantity" slot-scope="{ row }">
- <el-input
- v-if="row.$cellEdit"
- v-model="row.orderQuantity"
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")' size="small"
- @input="quantityChange(row)"
- ></el-input>
- <span v-else>{{ row.orderQuantity }}</span>
- </template>
- <template slot="price" slot-scope="{ row }">
- <el-input
- v-if="row.$cellEdit"
- v-model="row.price"
- size="small"
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")' @input="priceChange(row)"
- ></el-input>
- <span v-else>{{ row.price }}</span>
- </template>
- <template slot-scope="{row,index}" slot="menu">
- <el-button
- type="text"
- size="small"
- @click="rowCell(row,index)"
- >{{ row.$cellEdit ? '保存' : '修改' }}
- </el-button>
- </template>
- <template slot="menuLeft" slot-scope="{size}">
- <el-button type="primary"
- icon="el-icon-plus"
- size="small"
- @click="commoditySelection">录入明细
- </el-button>
- <el-button type="primary"
- icon="el-icon-plus"
- size="small"
- @click="policy">政策
- </el-button>
- <el-button type="warning"
- icon="el-icon-plus"
- size="small"
- :disabled="selection.length < 1"
- @click="generateShipmentD">生成发货单
- </el-button>
- <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
- </template>
- </avue-crud>
- </basic-container>
- <containerTitle title="费用明细"></containerTitle>
- <basic-container style="margin-bottom: 10px">
- <avue-crud
- :option="advantageProject"
- v-model="advantageProjectForm"
- :data="advantageProjectData"
- ref="crudProject"
- @row-save="rowSaveProject"
- @row-update="rowUpdateProject"
- @row-del="rowDelProject"
- >
- <template slot="code" slot-scope="{row,index}">
- <span style="float: left;padding-top: 2px">{{ row.code }}</span>
- <el-button type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
- </template>
- <template slot="corpId" slot-scope="{ row }">
- <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
- :configuration="configuration" @receiveList="receiveList"/>
- <span v-else>
- <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>
- </span>
- </template>
- <template slot-scope="{row,index}" slot="menu">
- <el-button
- type="text"
- size="small"
- @click="rowCellTwo(row,index)"
- >{{ row.$cellEdit ? '保存' : '修改' }}
- </el-button>
- </template>
- <template slot="menuLeft" slot-scope="{size}">
- <el-button type="primary"
- icon="el-icon-plus"
- size="small"
- @click="costIncrease"
- >录入明细
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- <containerTitle title="附件上传"></containerTitle>
- <basic-container style="margin-bottom: 40px">
- <avue-crud
- :option="bankOfDeposit"
- v-model="bankOfDepositForm"
- :data="bankOfDepositData"
- @row-save="rowSaveBankOfDeposit"
- @row-update="rowUpdateBankOfDeposit"
- @row-del="rowDelBankOfDeposit"
- :upload-after="uploadAfter"
- ></avue-crud>
- </basic-container>
- </el-form>
- </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 style="height: 0;">
- <el-col :span="5">
- <div>
- <el-scrollbar>
- <basic-container>
- <avue-tree :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="data"
- ref="crud"
- @refresh-change="refreshChange"
- @selection-change="selectionChange"
- :page.sync="page"
- @on-load="onLoad"></avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
- <el-button type="primary" @click="importChoice" v-if="commodityData === true"
- :disabled="tableData.length !== 1">导入</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="导入"
- append-to-body
- class="el-dialogDeep"
- :visible.sync="policyDialog"
- width="80%"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- @close="closePolicy">
- <el-row style="height: 0;">
- <el-col :span="5">
- <div>
- <el-scrollbar>
- <basic-container>
- <avue-tree :option="policyOption" :data="treeDataPolicy" @node-click="policyNodeClick"/>
- </basic-container>
- </el-scrollbar>
- </div>
- </el-col>
- <el-col :span="19">
- <containerTitle title="特价促销"></containerTitle>
- <basic-container style="margin-bottom: 10px">
- <avue-crud :option="optionPolicy"
- :table-loading="loadingPolicy"
- :data="dataPolicy"
- ref="crud"
- @selection-change="selectionChangePolicy"
- :page.sync="pagePolicy">
- </avue-crud>
- </basic-container>
- <containerTitle title="买赠促销"></containerTitle>
- <basic-container>
- <avue-crud
- :option="customerBuyFree"
- :data="contactsDataBuyFree"
- @selection-change="selectionChangePolicyTwo"
- ref="crudContactE">
- </avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-button @click="policyDialog = false">取 消</el-button>
- <el-button type="primary" @click="importPolicy">导入</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="导入费用"
- append-to-body
- class="el-dialogDeep"
- :visible.sync="dialogCost"
- width="80%"
- top="8vh"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- @close="closeFees">
- <el-row style="height: 0;">
- <el-col :span="5">
- <div>
- <el-scrollbar>
- <basic-container>
- <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost"/>
- </basic-container>
- </el-scrollbar>
- </div>
- </el-col>
- <el-col :span="19">
- <basic-container>
- <avue-crud :option="optionTwoCost"
- :table-loading="loadingCost"
- :data="dataCost"
- ref="crud"
- @refresh-change="refreshChangeCost"
- @selection-change="selectionChangeCost"
- :page.sync="pageCost"
- @on-load="onLoadCost">
- </avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogCost = false">取 消</el-button>
- <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
- <el-button type="primary" @click="choiceCost" v-if="choiceData === true"
- :disabled="tableDataCost.length !== 1">导入</el-button>
- </span>
- </el-dialog>
- <!-- 打印-->
- <el-dialog
- title="打印单"
- append-to-body
- class="el-dialogDeep"
- :visible.sync="printVisible"
- width="100%"
- fullscreen
- :close-on-click-modal="false"
- :close-on-press-escape="false">
- <div class="print-div">
- <div
- style="
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-item: center;
- font-size: 24px;
- margin-bottom: 5px;
- width: 100%;
- text-align: center;
- "
- >
- <div><b>VITAL INDUSTRIAL GROUP LIMITED</b></div>
- <div>NO.37 DONGHAI ROAD, QINGDAO, CHINA</div>
- <div>TEL:0086-532-86019080 FAX:0086-532-86019080</div>
- <div>
- <b>COMMERCIAL INVOICE</b>
- <span style="float: right">ORIGINAL</span>
- </div>
- </div>
- <div class="print_table" style="display: flex">
- <table
- border="0"
- cellspacing="0"
- cellpadding="0"
- style="width: 100%; line-height: 30px"
- >
- <tr>
- <td colspan="5" rowspan="3">MESSERS:</td>
- <td colspan="2">INVOICE NO.</td>
- <td colspan="3"></td>
- </tr>
- <tr>
- <td colspan="2">DATE</td>
- <td colspan="3"></td>
- </tr>
- <tr>
- <td colspan="2">INCOTERM .</td>
- <td colspan="3"></td>
- </tr>
- <tr>
- <td colspan="5">PI NO.:</td>
- <td colspan="2">DELIVERY PORT</td>
- <td colspan="3"></td>
- </tr>
- <tr>
- <td rowspan="2">NO.</td>
- <td rowspan="2">DESCRIPTION</td>
- <td>THICK</td>
- <td>LENGTH</td>
- <td>WIDTH</td>
- <td rowspan="2">SHEETS</td>
- <td rowspan="2">CRATES</td>
- <td>UNIT PRICE</td>
- <td>TOTAL</td>
- <td>T. AMOUNT</td>
- </tr>
- <tr>
- <td>mm</td>
- <td>mm</td>
- <td>mm</td>
- <td>US$/M²</td>
- <td>M²</td>
- <td>US$</td>
- </tr>
- <tr>
- <td>1</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td>2</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td>3</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td colspan="9" style="text-align: right">FUMIGATION COST:</td>
- <td></td>
- </tr>
- <tr>
- <td colspan="9" style="text-align: right">INSURANCE:</td>
- <td></td>
- </tr>
- <tr>
- <td colspan="9" style="text-align: right">TOTAL:</td>
- <td>0.00</td>
- </tr>
- </table>
- </div>
- <div class="print-footer" style="margin-top: 8px">
- <div style="font-weight: bold">TOTAL AMOUNT: U.S. DOLLARS NINE THOUSAND FORTY SIX CENTS TWENTY FIVE ONLY.
- </div>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- typeSave, detail, deleteDetails,
- corpstypeTree,
- corpsattn,
- corpsbank,
- corpsfiles,
- corpsitem,
- getList,
- detailList,
- generateShipment
- } from "@/api/basicData/configuration"
- import customerContact from "./configuration/customerContact.json"
- import advantageProject from "./configuration/advantageProject.json"
- import bankOfDeposit from "./configuration/bankOfDeposit.json"
- import commodity from "./configuration/commodity.json"
- import optionTwoCost from "./configuration/mainListCost.json"
- import optionPolicy from "./configuration/optionPolicy.json"
- import BuyFree from "./configuration/BuyFree.json"
- import {
- getDeptLazyTree,
- getDeptLazyTreeTwo,
- customerList,
- policyList,
- policyColumn
- } from "@/api/basicData/basicFeesDesc";
- import _ from "lodash";
- export default {
- name: "detailsPage",
- props: {
- detailData: {
- type: Object
- }
- },
- data() {
- return {
- disabled: false,
- form: {},
- configuration: {
- multipleChoices: false,
- multiple: false,
- collapseTags: false,
- placeholder: '请点击右边按钮选择',
- dicData: []
- },
- data: [],
- dataPolicy: [],
- contactsDataBuyFree: [],
- loadingCost: false,
- customerDivide: '',
- choiceData: false,
- commodityData: false,
- dataCost: [],
- treeDataPolicy: [],
- treeDataGoods: [],
- choiceIndex: '',
- dialogCost: false,
- treeDeptId: '',
- treeDeptIdCost: '',
- treePolicyId: '',
- pageCost: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- pagePolicy: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- loading: false,
- loadingPolicy: false,
- contactsForm: {},
- optionPolicy: optionPolicy,
- optionTwo: commodity,
- optionTwoCost: optionTwoCost,
- customerBuyFree: BuyFree,
- policyOption: {
- nodeKey: 'id',
- lazy: true,
- treeLoad: function (node, resolve) {
- const parentId = (node.level === 0) ? 0 : node.data.id;
- policyColumn(parentId).then(res => {
- resolve(res.data.data.map(item => {
- return {
- ...item,
- leaf: !item.hasChildren
- }
- }))
- });
- },
- addBtn: false,
- menu: false,
- size: 'small',
- props: {
- labelText: '标题',
- label: 'title',
- value: 'value',
- children: 'children'
- }
- },
- treeOptionCost: {
- nodeKey: 'id',
- lazy: true,
- treeLoad: function (node, resolve) {
- const parentId = (node.level === 0) ? 0 : node.data.id;
- getDeptLazyTree(parentId).then(res => {
- resolve(res.data.data.map(item => {
- return {
- ...item,
- leaf: !item.hasChildren
- }
- }))
- });
- },
- addBtn: false,
- menu: false,
- size: 'small',
- props: {
- labelText: '标题',
- label: 'title',
- value: 'value',
- children: 'children'
- }
- },
- treeOption: {
- nodeKey: 'id',
- lazy: true,
- treeLoad: function (node, resolve) {
- const parentId = (node.level === 0) ? 0 : node.data.id;
- getDeptLazyTreeTwo(parentId).then(res => {
- resolve(res.data.data.map(item => {
- return {
- ...item,
- leaf: !item.hasChildren
- }
- }))
- });
- },
- addBtn: false,
- menu: false,
- size: 'small',
- props: {
- labelText: '标题',
- label: 'title',
- value: 'value',
- children: 'children'
- }
- },
- dialogVisible: false,
- policyDialog: false,
- advantageProjectForm: {},
- selection: [],
- bankOfDepositForm: {},
- contactsData: [],
- advantageProjectData: [],
- bankOfDepositData: [],
- tableDataCost: [],
- dic: [],
- tableData: [],
- policyData: [],
- policyDataTwo: [],
- customerContact: customerContact,
- advantageProject: advantageProject,
- bankOfDeposit: bankOfDeposit,
- contactInformation: {
- column: [
- {
- label: '销售金额',
- prop: 'orderAmount',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '其他费用',
- prop: 'otherAmount',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '溢付款',
- prop: 'overPayment',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },{
- label: '应收账款',
- prop: 'debitAmount',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '已收款',
- prop: 'settlmentAmount',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '应收未收款',
- prop: 'accountsReceivable',//无
- disabled: true,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '应收预付款',
- prop: 'advancePayment',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '保证金',
- prop: 'deposit',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '逾期账款',
- prop: 'overDueAccounts',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '所属公司',
- prop: 'belongToCorpId',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '合同日期',
- prop: 'businesDate',
- type: 'datetime',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '实际发货日期',
- prop: 'actualDeliveryDate',
- type: 'datetime',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '毛利率',
- prop: 'grossProfitRate',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '毛利额',
- prop: 'grossProfit',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '历史运费(元/条)',
- prop: 'freightAmountHistory',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '到货日期',
- prop: 'arrivalDate',
- type: 'datetime',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '预收款日期',
- type: 'datetime',
- prop: 'advanceCollectionDate',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '积分倍数',
- prop: 'pointMutiple',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '单据状态',
- prop: 'orderStatus',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },{
- label: '制单日期',
- prop: 'createTime',
- type: 'datetime',
- disabled:true,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '制单人',
- prop: 'createUserName',
- disabled: true,
- span: 24,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },{
- label: '特别提醒',
- prop: 'specialRemarks',
- type: 'textarea',
- span: 24,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }
- ]
- },
- basicData: {
- column: [
- {
- label: '销售订单号',
- prop: 'orderNo',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '主订单号',
- prop: 'morderNo',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '发货地址',
- prop: 'shippingAddress',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '客户全称',
- prop: 'corpId',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '付款方式',
- prop: 'paymentType',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '到货地址',
- prop: 'arrivalAddress',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '包装要求',
- prop: 'packageRemarks',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '运费',
- prop: 'oceanFreight',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '银行帐号',
- prop: 'banks',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '要求发货日期',
- prop: 'requiredDeliveryDate',
- type: 'datetime',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '要求到货日期',
- prop: 'requiredArrivalDate',
- type: 'datetime',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '公司户头',
- prop: 'banksAccountName',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: "订单备注",
- type: 'textarea',
- span: 24,
- prop: "orderRemark",
- mock: {
- type: 'county'
- }
- }
- ]
- },
- paymentOption: [],
- statusOption: [],
- // 费用信息排序的最大值
- maxFeeNum: 0,
- maxGoodsNum: 0,
- }
- },
- //初始化查询
- created() {
- this.getWorkDicts("payment_term").then(res => {
- this.paymentOption = res.data.data
- })
- this.getWorkDicts("order_status").then(res => {
- this.statusOption = res.data.data
- })
- this.$set(this.form, 'orderStatus', '录入')
- if (this.detailData.id) {
- // let id = this.$route.query.id.replace(/\"/g, "")
- this.queryData(this.detailData.id)
- }
- if (this.detailData.copyId) {
- // let id = this.$route.query.copyId.replace(/\"/g, "")
- this.queryData(this.detailData.copyId, true)
- }
- },
- watch: {
- // '$route'(to, from) {
- // console.log(to, from);
- // if (this.$route.query.id) {
- // let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
- // detail(id).then(res => {
- // console.log(res.data.data)
- // this.form = res.data.data;
- // });
- // } else {
- // this.form = {}
- // }
- // },
- },
- methods: {
- queryData(id, isCopy = false){
- detail(id).then(res => {
- console.log(res.data.data)
- this.form = res.data.data;
- this.contactsData = this.form.orderItemsList
- this.advantageProjectData = this.form.orderFeesList
- this.bankOfDepositData = this.form.orderFilesList
- this.configuration.dicData = this.form.corpName
- if (this.form.belongToCorpList) {
- this.configuration.dicData = this.configuration.dicData.concat(this.form.belongToCorpList)
- }
- let feesData = []
- this.form.orderFeesList.forEach(item => {
- let a = {
- cname: item.corpName,
- id: item.corpId
- }
- feesData.push(a)
- })
- this.configuration.dicData = this.configuration.dicData.concat(feesData)
- // 去重
- this.removeRepeat()
- delete this.form.orderItemsList
- delete this.form.orderFeesList
- delete this.form.orderFilesList
- delete this.form.corpName
- delete this.form.belongToCorpList
- // 获取最大值
- let num = []
- this.advantageProjectData.forEach(item => {
- num.push(item.sort)
- })
- if (num.length == 0) {
- this.maxFeeNum = 0;
- } else {
- this.maxFeeNum = num.reduce((a, b) => {
- return b > a? b: a;
- })
- }
- let goodsNum = []
- this.contactsData.forEach(item => {
- goodsNum.push(item.sort)
- })
- if (goodsNum.length == 0) {
- this.maxGoodsNum = 0;
- } else {
- this.maxGoodsNum = goodsNum.reduce((a, b) => {
- return b > a? b: a;
- })
- }
- if (isCopy) {
- delete this.form.id
- this.contactsData.forEach(item => {
- delete item.id
- delete item.pid
- })
- this.advantageProjectData.forEach(item => {
- delete item.id
- delete item.pid
- })
- this.bankOfDepositData.forEach(item => {
- delete item.id
- delete item.pid
- })
- }
- });
- },
- // 复制新单
- copyOrder() {
- this.queryData(this.form.id, true)
- },
- //点击行可编辑
- handleRowClick(row, event, column) {
- },
- //商品编辑
- rowCell(row, index) {
- console.log(row)
- this.$refs.crudContact.rowCell(row, index)
- },
- //费用编辑
- rowCellTwo(row, index) {
- console.log(row)
- this.$refs.crudProject.rowCell(row, index)
- },
- //费用新增触发
- costIncrease() {
- this.dialogCost = !this.dialogCost
- this.choiceData = false
- },
- //商品新增触发
- commoditySelection() {
- this.dialogVisible = !this.dialogVisible
- this.commodityData = false
- },
- //政策价格导入
- policy() {
- this.policyDialog = !this.policyDialog
- },
- //生成发货单
- generateShipmentD() {
- let lsit = []
- for (let item in this.selection) {
- if (!this.selection[item].id) {
- return this.$confirm('商品信息有未保存数据, 是否立即保存?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.editCustomer(false)
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- } else {
- lsit.push(this.selection[item].id)
- }
- }
- let data = {
- id: this.form.id,
- orderItemIds: lsit
- }
- generateShipment(data).then(res => {
- console.log(res.data.data)
- this.$router.push({
- path: "/businessManagement/deliveryNotice/index",
- query: {form: JSON.stringify(res.data.data)},
- });
- })
- },
- //商品选中触发
- productSelection(selection) {
- this.selection = selection
- },
- //点击费用明细选择触发
- choice(row) {
- this.dialogCost = !this.dialogCost
- this.choiceData = true
- console.log(row)
- this.choiceIndex = row.$index
- },
- // 去重
- removeRepeat() {
- let obj = []
- this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
- obj[next.id] ? '': obj[next.id] = true && current.push(next)
- return current
- }, [])
- },
- //
- receiveList(data){
- this.configuration.dicData = this.configuration.dicData.concat(data)
- this.removeRepeat()
- },
- //点击商品明细选择触发
- commodityChoice(row) {
- this.dialogVisible = !this.dialogVisible
- this.commodityData = true
- console.log(row)
- this.choiceIndexT = row.$index
- },
- //导入商品触发
- importChoice() {
- // this.contactsData = this.contactsData.concat(this.tableData)
- if (this.tableData.length === 1) {
- this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
- this.contactsData[this.choiceIndexT].code = this.tableData[0].code
- this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
- this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
- this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
- this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
- this.contactsData[this.choiceIndexT].orderQuantity = 0
- this.contactsData[this.choiceIndexT].price = 0
- this.contactsData[this.choiceIndexT].amount = 0
- }
- this.dialogVisible = !this.dialogVisible
- this.commodityData = false
- },
- //费用编辑导入触发
- choiceCost() {
- if (this.tableDataCost.length === 1) {
- this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
- this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
- this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
- }
- this.dialogCost = !this.dialogCost
- this.choiceData = false
- },
- //费用导入触发
- importCost() {
- // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
- if (this.tableDataCost.length > 0) {
- for (let item in this.tableDataCost) {
- console.log(this.tableDataCost[item])
- this.tableDataCost[item].itemId = this.tableDataCost[item].id
- this.tableDataCost[item].feeName = this.tableDataCost[item].cname
- this.tableDataCost[item].sort = this.maxFeeNum + 1
- this.maxFeeNum++
- delete this.tableDataCost[item].id
- this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
- this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
- }
- }
- this.tableDataCost = []
- this.dialogCost = false
- },
- //确认导入触发
- importGoods() {
- // this.contactsData = this.contactsData.concat(this.tableData)
- if (this.tableData.length > 0) {
- for (let item in this.tableData) {
- console.log(this.tableData[item])
- this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
- delete this.tableData[item].goodsTypeName
- this.tableData[item].itemId = this.tableData[item].id
- // this.tableData[item].orderQuantity = 0
- this.$set(this.tableData[item], 'orderQuantity', 0)
- this.tableData[item].price = 0
- this.tableData[item].amount = 0
- this.tableData[item].sort = this.maxGoodsNum + 1
- this.maxGoodsNum++
- delete this.tableData[item].id
- this.$refs.crudContact.rowCellAdd(this.tableData[item]);
- this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
- }
- }
- this.tableData = []
- this.dialogVisible = false
- },
- closeGoods() {
- this.treeDataGoods = [];
- this.treeDeptId = "";
- },
- closeFees() {
- this.treeDeptIdCost = "";
- this.treeData = [];
- },
- closePolicy() {
- this.treePolicyId = '';
- this.dataPolicy = [];
- this.contactsDataBuyFree = [];
- },
- //选中触发
- selectionChange(list) {
- this.tableData = list
- },
- //费用选中触发
- selectionChangeCost(list) {
- this.tableDataCost = list
- },
- //导入页左商品类型查询
- nodeClick(data) {
- this.treeDeptId = data.id;
- this.page.currentPage = 1;
- this.onLoad(this.page);
- },
- //导入页销售政策查询
- policyNodeClick(data) {
- this.treePolicyId = data.id
- // detailList(data.id).then(res => {
- // //特价促销
- // this.dataPolicy = res.data.data.specialItemList
- // //买赠促销
- // this.contactsDataBuyFree = res.data.data.presentItemList
- // })
- this.policyOnLoad()
- },
- //导入页左费用类型查询
- nodeClickCost(data) {
- this.treeDeptIdCost = data.id;
- this.pageCost.currentPage = 1;
- this.onLoadCost(this.pageCost);
- },
- //刷新触发
- refreshChange() {
- this.page.currentPage = 1;
- this.onLoad(this.page);
- },
- //销售政策特价促销选中触发
- selectionChangePolicy(list) {
- this.policyData = list
- },
- //销售政策买赠促销选中触发
- selectionChangePolicyTwo(list) {
- this.policyDataTwo = list
- },
- //导入商品政策
- importPolicy() {
- let list = this.policyData.concat(this.policyDataTwo)
- for (let item in list) {
- console.log(list[item])
- this.$refs.crudContact.rowCellAdd(list[item]);
- this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
- }
- this.policyDialog = false
- },
- //费用刷新触发
- refreshChangeCost() {
- this.treeDeptIdCost = '';
- this.pageCost.currentPage = 1;
- this.onLoadCost(this.pageCost);
- },
- //新增商品信息保存触发
- rowSave(row, done, loading) {
- console.log(row)
- console.log(this.contactsData)
- // this.contactsData.push(row)
- done()
- },
- //修改商品信息触发
- rowUpdate(row, index, done, loading) {
- done(row);
- },
- //删除商品信息触发
- rowDel(row, index, donerowDel) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- //商品判断是否需要调用删除接口
- if (row.id) {
- corpsattn(row.id).then(res => {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.contactsData.splice(index, 1);
- })
- } else {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.contactsData.splice(index, 1);
- }
- })
- },
- //新增费用明细保存触发
- rowSaveProject(row, done, loading) {
- // this.advantageProjectData.push(row)
- done()
- },
- //修改费用明细触发
- rowUpdateProject(row, index, done, loading) {
- done(row);
- },
- policyOnLoad(params = {}) {
- // this.policyLoading = true;
- detailList(this.treePolicyId).then(res => {
- //特价促销
- this.dataPolicy = res.data.data.specialItemList
- //买赠促销
- this.contactsDataBuyFree = res.data.data.presentItemList
- })
- },
- //商品列表查询
- onLoad(page, params = {}) {
- this.loading = true;
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
- console.log(res)
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- });
- },
- //费用查询
- onLoadCost(page, params = {}) {
- this.loadingCost = true;
- let queryParams = Object.assign({}, params, {
- pageSize: page.pageSize,
- pageNum: page.currentPage,
- parentId: 0,
- feesTypeId: this.treeDeptIdCost
- })
- customerList(queryParams).then(res => {
- console.log(res)
- const data = res.data.data;
- this.pageCost.total = data.total;
- this.dataCost = data.records;
- this.loadingCost = false;
- });
- },
- //删除费用明细触发
- rowDelProject(row, index, donerowDel) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- //费用判断是否需要调用删除接口
- if (row.id) {
- corpsitem(row.id).then(res => {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.advantageProjectData.splice(index, 1);
- })
- } else {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.advantageProjectData.splice(index, 1);
- }
- })
- },
- //新增附件上传保存触发
- rowSaveBankOfDeposit(row, done, loading) {
- this.bankOfDepositData.push(row)
- done()
- },
- //修改附件上传触发
- rowUpdateBankOfDeposit(row, index, done, loading) {
- done(row);
- },
- //删除附件上传触发
- rowDelBankOfDeposit(row, index, donerowDel) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- //附件判断是否需要调用删除接口
- if (row.id) {
- corpsbank(row.id).then(res => {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.bankOfDepositData.splice(index, 1);
- })
- } else {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.bankOfDepositData.splice(index, 1);
- }
- })
- },
- uploadAfter(res, done) {
- if (res.originalName) {
- this.bankOfDepositForm.fileName = this.bankOfDepositForm.fileName
- ? this.bankOfDepositForm.fileName
- : res.originalName;
- }
- done();
- },
- //修改提交触发
- editCustomer(isBack = false) {
- console.log(this.form)
- this.$refs["form"].validate((valid) => {
- if (valid) {
- //商品信息
- this.form.orderItemsList = this.contactsData
- this.form.orderFeesList = this.advantageProjectData
- this.form.orderFilesList = this.bankOfDepositData
- if (typeof this.form.corpsTypeId == 'object') {
- this.form.corpsTypeId = this.form.corpsTypeId.join(",")
- }
- this.form.billType = 'XS'
- this.disabled = true
- typeSave(this.form).then(res => {
- this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
- this.disabled = false
- if (isBack) {
- //成功关闭此页面回到列表页
- this.$emit("goBack");
- } else {
- this.queryData(res.data.data.id)
- }
- })
- } else {
- return false;
- }
- });
- },
- // 计算应收未收款
- computedCost() {
- // 应收预付款
- let advancePayment = 0;
- // 已收款
- let settlmentAmount = 0;
- if (this.form.advancePayment) {
- advancePayment = this.form.advancePayment
- }
- if (this.form.settlmentAmount) {
- settlmentAmount = this.form.settlmentAmount
- }
- this.$set(this.form, "accountsReceivable", Number(advancePayment) - Number(settlmentAmount)).toFixed(2);
- },
- quantityChange(row) {
- if (!row.orderQuantity) {
- row.orderQuantity = 0;
- } else {
- // row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
- row.amount = (row.price * row.orderQuantity).toFixed(2)
- }
- },
- priceChange(row) {
- if (!row.price) {
- row.price = 0;
- } else {
- row.amount = (row.price * row.orderQuantity).toFixed(2)
- }
- },
- //返回列表
- backToList() {
- this.$confirm("是否保存当前页面?", "提示", {
- confirmButtonText: "保存",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.editCustomer(true)
- }).catch(() => {
- // this.$router.$avueRouter.closeTag();
- // this.$router.push({
- // path: '/businessManagement/salesOrder/index',
- // query: {}
- // });
- this.$emit("goBack");
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .customer-head {
- position: fixed;
- top: 105px;
- width: 100%;
- margin-left: -10px;
- height: 62px;
- background: #ffffff;
- box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
- z-index: 999;
- /* display: flex;
- justify-content: left; */
- }
- .customer-back {
- cursor: pointer;
- line-height: 62px;
- font-size: 16px;
- color: #323233;
- font-weight: 400;
- }
- .back-icon {
- line-height: 64px;
- font-size: 20px;
- margin-right: 8px;
- }
- .add-customer-btn {
- position: fixed;
- right: 36px;
- top: 115px;
- }
- ::v-deep .el-form-item {
- margin-bottom: 0;
- }
- .el-dialogDeep {
- ::v-deep .el-dialog {
- margin: 1vh auto 0 !important;
- padding-bottom: 10px !important;
- .el-dialog__body, .el-dialog__footer {
- padding-bottom: 0 !important;
- padding-top: 0 !important;
- }
- }
- }
- .print-div {
- color: #000;
- }
- .print_table {
- table {
- border-right: 1px solid #000;
- border-bottom: 1px solid #000;
- font-size: 12px;
- margin-bottom: 5px;
- }
- table td {
- border-left: 1px solid #000;
- border-top: 1px solid #000;
- vertical-align: middle;
- padding: 2px;
- text-align: center;
- }
- }
- .table {
- border-collapse: collapse;
- border-spacing: 0;
- background-color: transparent;
- display: table;
- width: 99%;
- max-width: 100%;
- margin: 0 auto;
- }
- .table td {
- text-align: left;
- vertical-align: middle;
- font-size: 14px;
- color: #000000;
- padding: 10.5px 0 10.5px 30px;
- //border: 1px solid #000;
- }
- </style>
|