| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562 |
- <template>
- <div>
- <basic-container v-show="show" class="page-crad">
- <el-tabs v-model="tabsName" type="card" @tab-click="handleClick">
- <el-tab-pane label="待采购" name="first"></el-tab-pane>
- <el-tab-pane label="采购中" name="second"></el-tab-pane>
- <el-tab-pane label="采购完成" name="third"></el-tab-pane>
- <el-tab-pane label="全部" name="fourth"></el-tab-pane>
- </el-tabs>
- <avue-crud
- v-show="tabsName == 'first'"
- ref="procureCrud"
- :page.sync="treatPage"
- :option="procureOption"
- :data="procureData"
- @refresh-change="listBYStatusfun(treatPage)"
- @resetColumn="resetColumnTwo('procureCrud', 'procureOption', 'procureOptionList', 2.3)"
- @saveColumn="saveColumnTwo('procureCrud', 'procureOption', 'procureOptionList', 2.3)"
- >
- <template slot-scope="scope" slot="menu">
- <el-button type="text" size="small" @click.stop="procureViewfun(scope.row)">采购 </el-button>
- </template>
- </avue-crud>
- <avue-crud
- v-show="tabsName == 'second' || tabsName == 'third' || tabsName == 'fourth'"
- ref="crud"
- :option="option"
- :data="dataList"
- v-model="form"
- :page.sync="page"
- :search.sync="search"
- @search-change="searchChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- :table-loading="loading"
- :cell-style="cellStyle"
- @selection-change="selectionChange"
- @expand-change="expandChange"
- @search-criteria-switch="searchCriteriaSwitch"
- @saveColumn="saveColumn('crud', 'option', 'optionBack', 2)"
- @resetColumn="resetColumn('crud', 'option', 'optionBack', 2)"
- >
- <template slot-scope="{ row }" slot="expand">
- <avue-crud
- ref="itemCrud"
- :data="row.itemData"
- :option="itemOption"
- :table-loading="row.itemLoading"
- @resetColumn="resetColumnTwo('itemCrud', 'itemOption', 'itemOptionList', 2.2)"
- @saveColumn="saveColumnTwo('itemCrud', 'itemOption', 'itemOptionList', 2.2)"
- :cell-style="cellStyle"
- class="itemTable"
- ></avue-crud>
- </template>
- <template slot="createTimeSearch">
- <el-date-picker
- v-model="search.createTime"
- type="daterange"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']"
- >
- </el-date-picker>
- </template>
- <template slot="menuLeft">
- <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newAdd('new')">创建单据 </el-button>
- <el-button type="success" size="small" @click.stop="copyDoc()" :disabled="selectionList.length != 1">复制单据 </el-button>
- <el-button type="info" size="small" disabled>报表打印</el-button>
- <el-button type="warning" size="small" @click="caigorenwufun">采购任务</el-button>
- </template>
- <template slot="corpIdSearch">
- <crop-select v-model="search.corpId" corpType="GYS"></crop-select>
- </template>
- <template slot="businesDateSearch">
- <el-date-picker
- v-model="search.businesDate"
- type="daterange"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']"
- >
- </el-date-picker>
- </template>
- <template slot="plannedDeliveryDateSearch">
- <el-date-picker
- v-model="search.plannedDeliveryDate"
- type="daterange"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']"
- >
- </el-date-picker>
- </template>
- <template slot="requiredDeliveryDateSearch">
- <el-date-picker
- v-model="search.requiredDeliveryDate"
- type="daterange"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']"
- >
- </el-date-picker>
- </template>
- <template slot-scope="scope" slot="corpId">
- <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row, 1)">{{ scope.row.strCorpName }} </span>
- </template>
- <template slot-scope="scope" slot="srcOrderNo">
- <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row, 1)">{{ scope.row.srcOrderNo }}</span>
- </template>
- <template slot-scope="scope" slot="fudaPurchaseStatus">
- <span class="el-button--text">
- {{ scope.row.fudaPurchaseStatus }}
- </span>
- </template>
- <template slot-scope="scope" slot="fudaPurchaseDate">
- <span class="el-button--text">
- {{ scope.row.fudaPurchaseDate }}
- </span>
- </template>
- <template slot-scope="scope" slot="productionScheduling">
- <span class="el-button--text">
- {{ scope.row.productionScheduling }}
- </span>
- </template>
- <template slot-scope="scope" slot="createUser">
- {{ scope.row.createUserName }}
- </template>
- <template slot-scope="{ row }" slot="orderQuantity">
- <span>{{ row.orderQuantity | IntegerFormat }}</span>
- </template>
- <template slot-scope="{ row }" slot="purchaseAmount">
- <span>{{ row.purchaseAmount | decimalFormat2 }}</span>
- </template>
- <template slot-scope="{ row }" slot="purchaseQuantity">
- <span>{{ row.purchaseQuantity | decimalFormat2 }}</span>
- </template>
- <template slot-scope="{ row }" slot="pdeliverQuantity">
- <span>{{ row.deliverQuantity | decimalFormat2 }}</span>
- </template>
- <template slot-scope="{ row }" slot="actualQuantity">
- <span>{{ row.actualQuantity | decimalFormat2 }}</span>
- </template>
- <template slot-scope="{ row, index }" slot="menu">
- <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(row, index)">删除 </el-button>
- <el-button type="text" icon="el-icon-printer" size="small" class="el-button--small-yh " @click.stop="openReports(row)">导出</el-button>
- </template>
- </avue-crud>
- </basic-container>
- <detail-page @goBack="goBack" @copyOrder="copyOrder" :detailData="detailData" v-if="!show"></detail-page>
- <el-dialog
- title="导入采购任务"
- v-if="dialogVisible"
- :visible.sync="dialogVisible"
- append-to-body
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :before-close="function() {dialogVisible = false;params = {};}"
- top="1vh"
- width="90%"
- >
- <span>
- <el-row>
- <el-col :span="6" style="padding: 0 10px">
- <el-scrollbar>
- <!-- <avue-tree :option="treeOption" :key="avueTree" :data="treeData" @node-click="nodeClick"/>-->
- <!-- {{ treeData }}-->
- <el-table
- style="width: 100%"
- border
- size="mini"
- ref="singleTable"
- highlight-current-row
- @current-change="handleCurrentChange"
- :data="treeData"
- >
- <el-table-column prop="orderNo" show-overflow-tooltip align="center" label="销售单号"> </el-table-column>
- <el-table-column prop="plannedDeliveryDate" show-overflow-tooltip width="105" align="center" label="交货日期">
- <template slot-scope="{ row }">
- {{ row.plannedDeliveryDate ? row.plannedDeliveryDate.slice(0, 10) : "" }}
- </template>
- </el-table-column>
- </el-table>
- </el-scrollbar>
- </el-col>
- <el-col :span="18">
- <!-- :page.sync="dialogPage"-->
- <avue-crud
- :data="dialogData"
- :option="dialogOption"
- :search.sync="params"
- ref="dialogCrud"
- @resetColumn="resetColumnTwo('dialogCrud', 'dialogOption', 'dialogOptionList', 2.1)"
- @saveColumn="saveColumnTwo('dialogCrud', 'dialogOption', 'dialogOptionList', 2.1)"
- @refresh-change="refreshChangeTwo"
- @search-change="searchChangeTwo"
- @search-reset="searchReset"
- @selection-change="dialogSelectionChange"
- @on-load="dialogOnLoad"
- >
- <template slot="menuLeft">
- <el-tabs v-model="activeName" @tab-click="tabHandle">
- <el-tab-pane label="查询结果" name="searchList" />
- <el-tab-pane label="已选定数据" name="importStaging" />
- </el-tabs>
- </template>
- <template slot="menuRight">
- <el-button type="primary" size="small" @click="allClick('全选')">全选</el-button>
- </template>
- <template slot="corpNameSearch">
- <crop-select v-model="params.corpId" corpType="GYS" />
- </template>
- <template slot="actualQuantity" slot-scope="scope">
- <el-input-number
- v-if="activeName === 'importStaging'"
- v-model="scope.row.actualQuantity"
- :precision="2"
- :min="0.01"
- :controls="false"
- ></el-input-number>
- <span v-else>{{ scope.row.actualQuantity }}</span>
- </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="activeName == '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>
- </avue-crud>
- </el-col>
- </el-row>
- </span>
- <span slot="footer" class="dialog-footer">
- <!-- <el-button type="warning" @click="outExport">导出</el-button>-->
- <el-button type="warning" @click="openReport">导出</el-button>
- <el-button
- @click="
- dialogVisible = false;
- params = {};
- "
- >取 消</el-button
- >
- <el-button type="primary" :disabled="goodsListSave.length === 0" @click="confirmImport">导 入</el-button>
- </span>
- </el-dialog>
- <report-dialog :switchDialog="switchDialog" :reportId="params.pid" reportName="出口贸易-采购" @onClose="onClose()"></report-dialog>
- <report-dialog :switchDialog="switchDialogs" :reportId="srcIds" reportName="出口贸易-采购" @onClose="onCloses()"></report-dialog>
- <el-dialog title="导入采购任务" :visible.sync="procureVisible" append-to-body>
- <avue-crud
- :data="procurelistData"
- :option="procurelistOption"
- :search.sync="params"
- ref="daorucaigoCrud"
- @refresh-change="refreshChangeTwo"
- @resetColumn="resetColumnTwo('daorucaigoCrud', 'procurelistOption', 'procurelistOptionList', 2.4)"
- @saveColumn="saveColumnTwo('daorucaigoCrud', 'procurelistOption', 'procurelistOptionList', 2.4)"
- >
- <template slot="menuLeft">
- <el-tabs v-model="activeName" @tab-click="tabHandle">
- <el-tab-pane label="查询结果" name="searchList" />
- <el-tab-pane label="已选定数据" name="importStaging" />
- </el-tabs>
- </template>
- <template slot="corpNameSearch">
- <crop-select v-model="params.corpId" corpType="GYS" />
- </template>
- <template slot="actualQuantity" slot-scope="scope">
- <el-input-number
- v-if="activeName === 'importStaging'"
- v-model="scope.row.actualQuantity"
- :precision="2"
- :min="0.01"
- :controls="false"
- ></el-input-number>
- <span v-else>{{ scope.row.actualQuantity }}</span>
- </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="activeName == '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>
- </avue-crud>
- <span slot="footer" class="dialog-footer">
- <!-- <el-button type="warning" @click="outExport">导出</el-button>-->
- <el-button type="warning" @click="openReport">导出</el-button>
- <el-button @click="procureVisible = false">取 消</el-button>
- <el-button type="primary" :disabled="goodsListSave.length === 0" @click="confirmImport">导 入</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- // import option from "./config/mainList.json";
- import reportDialog from "@/components/report-dialog/main";
- import { getList, remove, gainUser, listXS, generatePurchaseBill, listBYStatus, getGoodsInfo, getGoods } from "@/api/exportTrade/purchaseContract";
- import detailPage from "./detailsPage.vue";
- import { defaultDate } from "@/util/date";
- import { IntegerFormat, decimalFormat2 } from "@/util/validate";
- import { customerParameter } from "@/enums/management-type";
- import { getToken } from "@/util/auth";
- import { customerList } from "@/api/basicData/customerInformation";
- import { detail as companyDetail } from "@/api/basicData/customerInformation";
- import { getUser as nameUser } from "@/api/system/user";
- import tableOption from "@/views/exportTrade/EcommerceStocking/config/customerContact.json";
- export default {
- name: "customerInformation",
- data() {
- return {
- switchDialog: false,
- switchDialogs: false,
- tabsName: "first",
- tabType: "",
- procureData: [], // 待采购数据
- // 待采购配置
- procureOption: [],
- procureOptionList: {
- searchShow: true,
- searchMenuSpan: 8,
- border: true,
- index: true,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- addBtn: false,
- menuWidth: "100",
- headerAlign: "center",
- searchIcon: false,
- searchIndex: 2,
- column: [
- {
- label: "销售单号",
- prop: "orderNo",
- overHidden: true
- },
- {
- label: "采购员",
- prop: "buyerName",
- hide: true,
- overHidden: true
- },
- {
- label: "交货日期",
- prop: "plannedDeliveryDate",
- overHidden: true
- },
- {
- label: "公司主体",
- prop: "belongToCorpName",
- overHidden: true
- },
- {
- label: "公司主体",
- prop: "belongToCorpId",
- hide: true,
- overHidden: true
- },
- {
- label: "制单人",
- prop: "createUserName",
- overHidden: true
- },
- {
- label: "制单人",
- prop: "createUser",
- hide: true,
- overHidden: true
- },
- {
- label: "制单日期",
- prop: "createTime",
- overHidden: true
- }
- ]
- },
- procureVisible: false, // 待采购弹窗
- procurelistData: [], // 待采购弹窗列表数据
- // 待采购弹窗待配置
- procurelistOption: {},
- procurelistOptionList: {
- searchShow: true,
- searchMenuSpan: 8,
- border: true,
- index: true,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- addBtn: false,
- menuWidth: "100",
- headerAlign: "center",
- searchIcon: false,
- searchIndex: 2,
- tip: false,
- column: [
- {
- label: "销售单号",
- prop: "billNo",
- searchSpan: 8,
- searchOrder: 1,
- overHidden: true
- },
- {
- label: "销售日期",
- prop: "businesDate",
- searchProp: "businesDateList",
- width: 100,
- type: "date",
- searchSpan: 8,
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- overHidden: true
- },
- {
- label: "供应商",
- prop: "corpName",
- searchSpan: 8,
- overHidden: true
- },
- {
- label: "交货日期",
- prop: "plannedDeliveryDate",
- searchProp: "plannedDeliveryDateList",
- width: 100,
- type: "date",
- searchSpan: 8,
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- overHidden: true
- },
- {
- label: "采购员",
- prop: "carry",
- overHidden: true
- },
- {
- label: "产品名称",
- prop: "cname",
- overHidden: true
- },
- {
- label: "产品编号",
- prop: "code",
- overHidden: true
- },
- {
- label: "产品类别",
- prop: "priceCategory",
- overHidden: true
- },
- {
- label: "产品型号",
- prop: "itemType",
- overHidden: true
- },
- {
- label: "数量",
- prop: "orderQuantity"
- },
- {
- label: "已采购数",
- prop: "purchaseQuantity",
- overHidden: true
- },
- {
- label: "待采数",
- prop: "actualQuantity",
- overHidden: true
- },
- {
- label: "螺纹",
- prop: "remarksOne",
- overHidden: true
- },
- {
- label: "介质",
- prop: "customTwo",
- overHidden: true
- },
- {
- label: "颜色",
- prop: "customThree",
- overHidden: true
- },
- {
- label: "电压",
- prop: "customFour",
- overHidden: true
- },
- {
- label: "显示全部",
- prop: "showAll",
- searchSpan: 8,
- searchOrder: 2,
- overHidden: true,
- type: "select",
- clearable: false,
- hide: true,
- // showColumn: false,
- dicData: [
- {
- label: "需采购",
- value: 0
- },
- {
- label: "已采购",
- value: 1
- }
- ],
- searchValue: 0
- }
- ]
- },
- search: {
- businesDate: defaultDate(5)
- // businesDate: ''
- },
- treeData: [],
- avueTree: false,
- treeOption: {
- nodeKey: "id",
- lazy: true,
- treeLoad: function(node, resolve) {
- listBYStatus({}).then(res => {
- resolve(
- res.data.data.map(item => {
- return {
- ...item,
- leaf: !item.hasChildren
- };
- })
- );
- });
- },
- addBtn: false,
- menu: false,
- size: "small",
- props: {
- labelText: "标题",
- label: "orderNo",
- value: "id",
- children: "children"
- }
- },
- dialogData: [],
- goodsListShow: [],
- goodsListSave: [],
- params: {},
- dialogPage: {
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- activeName: "searchList",
- dialogOption: {},
- dialogOptionList: {
- searchShow: true,
- searchMenuSpan: 8,
- border: true,
- index: true,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- addBtn: false,
- menuWidth: "100",
- headerAlign: "center",
- searchIcon: false,
- searchIndex: 2,
- tip: false,
- selection: true,
- column: [
- {
- label: "销售单号",
- prop: "billNo",
- search: true,
- searchSpan: 8,
- searchOrder: 1,
- overHidden: true
- },
- {
- label: "销售日期",
- prop: "businesDate",
- searchProp: "businesDateList",
- width: 100,
- type: "date",
- searchSpan: 8,
- searchRange: true,
- search: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- overHidden: true
- },
- {
- label: "供应商",
- prop: "corpName",
- searchSpan: 8,
- search: true,
- overHidden: true
- },
- {
- label: "交货日期",
- prop: "plannedDeliveryDate",
- searchProp: "plannedDeliveryDateList",
- width: 100,
- type: "date",
- searchSpan: 8,
- searchRange: true,
- search: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- overHidden: true
- },
- {
- label: "采购员",
- prop: "carry",
- overHidden: true
- },
- {
- label: "产品名称",
- prop: "cname",
- overHidden: true
- },
- {
- label: "产品编号",
- prop: "code",
- overHidden: true
- },
- {
- label: "产品类别",
- prop: "priceCategory",
- overHidden: true
- },
- {
- label: "产品型号",
- prop: "itemType",
- overHidden: true
- },
- {
- label: "数量",
- prop: "orderQuantity"
- },
- {
- label: "已采购数",
- prop: "purchaseQuantity",
- overHidden: true
- },
- {
- label: "待采数",
- prop: "actualQuantity",
- overHidden: true
- },
- {
- label: "螺纹",
- prop: "remarksOne",
- overHidden: true
- },
- {
- label: "介质",
- prop: "customTwo",
- overHidden: true
- },
- {
- label: "颜色",
- prop: "customThree",
- overHidden: true
- },
- {
- label: "电压",
- prop: "customFour",
- overHidden: true
- },
- {
- label: "显示全部",
- prop: "showAll",
- searchSpan: 8,
- searchOrder: 2,
- overHidden: true,
- type: "select",
- clearable: false,
- search: true,
- hide: true,
- // showColumn: false,
- dicData: [
- {
- label: "需采购",
- value: 0
- },
- {
- label: "已采购",
- value: 1
- }
- ],
- searchValue: 0
- }
- ]
- },
- dialogVisible: false,
- itemOption: {},
- itemOptionList: {
- align: "center",
- header: true,
- addBtn: false,
- border: true,
- menu: false,
- refreshBtn: false,
- column: [
- {
- label: "产品类别",
- prop: "priceCategory",
- width: 140,
- overHidden: true
- },
- {
- label: "产品名称",
- prop: "cname",
- width: 240,
- overHidden: true
- },
- {
- label: "产品描述",
- prop: "itemDescription",
- width: 240,
- overHidden: true
- },
- {
- label: "配件描述",
- prop: "partsDescribe",
- width: 240,
- overHidden: true
- },
- {
- label: "配件价格描述",
- prop: "partsPriceDescribe",
- width: 240,
- overHidden: true
- },
- {
- label: "数量",
- prop: "orderQuantity",
- width: 100,
- overHidden: true
- },
- {
- label: "单价",
- prop: "price",
- width: 100,
- overHidden: true
- },
- {
- label: "金额",
- prop: "amount",
- width: 100,
- overHidden: true
- }
- ]
- },
- form: {},
- option: {},
- optionBack: {
- searchShow: true,
- searchMenuSpan: 16,
- border: true,
- index: true,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- addBtn: false,
- headerAlign: "center",
- menuWidth: "120",
- searchLabelWidth: "90",
- searchIcon: true,
- searchIndex: 3,
- searchSpan: 6,
- expand: true,
- expandWidth: 38,
- selection: true,
- tip: false,
- column: [
- {
- label: "供应商",
- prop: "corpId",
- search: true,
- searchSpan: 8,
- // index: 1,
- minWidth: 120,
- overHidden: true
- },
- {
- label: "销售订单号",
- prop: "srcOrderNo",
- search: true,
- searchSpan: 8,
- // index: 3.1,
- minWidth: 120,
- overHidden: true
- },
- {
- label: "采购日期",
- prop: "businesDate",
- search: true,
- searchSpan: 8,
- // index: 2,
- minWidth: 90,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd"
- },
- {
- label: "采购状态",
- prop: "fudaPurchaseStatus",
- // index: 2.1,
- minWidth: 80,
- overHidden: true
- },
- {
- label: "采购订单号",
- prop: "orderNo",
- search: true,
- searchSpan: 8,
- // index: 3,
- minWidth: 120,
- overHidden: true
- },
- {
- label: "预交日期",
- prop: "plannedDeliveryDate",
- search: true,
- searchSpan: 8,
- // index: 4,
- minWidth: 90,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd"
- },
- {
- label: "实交日期",
- prop: "requiredDeliveryDate",
- search: true,
- searchSpan: 8,
- // index: 10,
- minWidth: 80,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd"
- },
- {
- label: "付款方式",
- prop: "paymentType",
- // index: 10,
- minWidth: 80,
- search: true,
- searchSpan: 8,
- overHidden: true,
- type: "select",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: "采购金额",
- prop: "purchaseAmount",
- // index: 5,
- minWidth: 90,
- align: "right",
- overHidden: true
- },
- {
- label: "数量合计",
- prop: "orderQuantity",
- // index: 6,
- minWidth: 80,
- align: "right",
- overHidden: true
- },
- {
- label: "数量",
- prop: "storageQuantity",
- // index: 8.1,
- minWidth: 80,
- align: "right",
- overHidden: true,
- hide: true
- },
- {
- label: "采购数",
- prop: "purchaseQuantity",
- // index: 8.2,
- minWidth: 80,
- align: "right",
- overHidden: true
- },
- {
- label: "发货数",
- prop: "deliverQuantity",
- // index: 8.3,
- minWidth: 80,
- align: "right",
- overHidden: true
- },
- {
- label: "客户收货数",
- prop: "receiveQuantity",
- // index: 8.4,
- minWidth: 90,
- align: "right",
- overHidden: true
- },
- // {
- // label: "发货数量",
- // prop: "actualQuantity",
- // // index: 8.5,
- // minWidth: 80,
- // align: "right",
- // overHidden: true
- // },
- {
- label: "采购员",
- prop: "buyerName",
- // index: 8.51,
- minWidth: 80,
- overHidden: true
- },
- {
- label: "跟单员",
- prop: "documenterName",
- // index: 8.52,
- minWidth: 80,
- overHidden: true
- },
- {
- label: "采购日期",
- prop: "fudaPurchaseDate",
- // index: 8.54,
- minWidth: 80,
- overHidden: true
- },
- {
- label: "排产状态",
- prop: "productionScheduling",
- // index: 8.55,
- minWidth: 80,
- overHidden: true
- },
- {
- label: "排产日期",
- prop: "productionSchedulingDate",
- // index: 8.56,
- minWidth: 80,
- overHidden: true
- },
- {
- label: "预计货好状态",
- prop: "estimateGoodGoods",
- // index: 8.57,
- minWidth: 100,
- overHidden: true
- },
- {
- label: "预计货好日期",
- prop: "estimateGoodGoodsDate",
- // index: 8.58,
- minWidth: 100,
- overHidden: true
- },
- {
- label: "收货金额",
- prop: "",
- // index: 9,
- minWidth: 80,
- align: "right",
- overHidden: true
- },
- {
- label: "收货数量",
- prop: "actualQuantity",
- // index: 10,
- minWidth: 80,
- align: "right",
- overHidden: true
- },
- {
- label: "系统号",
- prop: "sysNo",
- search: true,
- // index: 11,
- minWidth: 80,
- overHidden: true,
- searchSpan: 8
- },
- {
- label: "制单人",
- prop: "createUser",
- // index: 12,
- minWidth: 80,
- search: true,
- overHidden: true,
- type: "select",
- dicData: [],
- props: {
- label: "name",
- value: "id"
- },
- filterable: true,
- searchSpan: 8
- },
- {
- label: "制单日期",
- prop: "createTime",
- // index: 13,
- minWidth: 80,
- search: true,
- overHidden: true,
- searchSpan: 8,
- type: "date",
- format: "yyyy-MM-dd"
- },
- {
- label: "备注",
- prop: "orderRemark",
- // index: 8,
- minWidth: 150,
- overHidden: true,
- search: true,
- searchSpan: 8
- }
- ]
- },
- parentId: 0,
- dataList: [],
- treatPage: {
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- page: {
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- totalTwo: 0,
- show: true,
- detailData: {},
- loading: false,
- selectionList: [],
- srcIds: null
- };
- },
- components: { detailPage, reportDialog },
- async created() {
-
- this.option = await this.getColumnData(this.getColumnName(2), this.optionBack);
- this.dialogOption = await this.getColumnData(this.getColumnName(2.1), this.dialogOptionList);
- this.itemOption = await this.getColumnData(this.getColumnName(2.2), this.itemOptionList);
- this.procureOption = await this.getColumnData(this.getColumnName(2.3), this.procureOptionList);
- this.procurelistOption = await this.getColumnData(this.getColumnName(2.4), this.procurelistOptionList);
- this.getWorkDicts("payment_term").then(res => {
- this.findObject(this.option.column, "paymentType").dicData = res.data.data;
- });
- gainUser().then(res => {
- this.findObject(this.option.column, "createUser").dicData = res.data.data;
- });
- // 判断是否是采购员 权限
- if (JSON.parse(localStorage.getItem("saber-userInfo")).content.role_name.indexOf("采购") != -1) {
- this.findObject(this.procureOption.column, "buyerName").hide = false;
- }
- this.option.height = window.innerHeight - 210;
- this.listBYStatusfun(this.treatPage); // 获取待采购数据
- },
- filters: {
- IntegerFormat(num) {
- return IntegerFormat(num);
- },
- decimalFormat2(num) {
- return decimalFormat2(num);
- }
- },
- activated() {
- if (this.$route.query.check) {
- this.detailData = {
- check: this.$route.query.check,
- id: this.$route.query.check.billId
- };
- this.show = false;
- this.$store.commit("IN_CG_STATUS");
- }
- },
- methods: {
- openReports(row) {
- this.switchDialogs = !this.switchDialogs;
- this.srcIds = row.srcIds;
- },
- onCloses(val) {
- this.switchDialogs = val;
- this.srcIds = null;
- },
- handleClick() {
- if (this.tabsName == "second") {
- this.tabType = 1;
- } else if (this.tabsName == "third") {
- this.tabType = 2;
- } else if (this.tabsName == "fourth") {
- this.tabType = "";
- }
- this.onLoad(this.page, this.search);
- },
- // 采购任务弹窗打开
- caigorenwufun() {
- this.dialogVisible = true;
- this.listBYStatusfun(this.treatPage); // 获取待采购数据
- },
- // 获取待采购数据
- listBYStatusfun(page) {
- listBYStatus({
- size: page.pageSize,
- current: page.currentPage
- }).then(res => {
- for (let item of res.data.data.records) {
- // 公司
- companyDetail(item.belongToCorpId).then(re => {
- item.belongToCorpName = re.data.data.cname;
- });
- // 用户
- nameUser(item.createUser).then(re => {
- item.createUserName = re.data.data.name;
- });
- }
- this.procureData = res.data.data.records;
- this.treatPage.total = res.data.data.total;
- this.treeData = res.data.data.records;
- });
- },
- // 获取待采购弹窗列表数据
- procureViewfun(row) {
- this.procurelistData = [];
- this.procureOnLoad(row.id);
- this.procureVisible = true;
- },
- outExport() {
- let config = { params: { ...this.params } };
- if (config.params) {
- for (const propName of Object.keys(config.params)) {
- const value = config.params[propName];
- if (value !== null && typeof value !== "undefined") {
- if (value instanceof Array) {
- for (const key of Object.keys(value)) {
- let params = propName + "[" + key + "]";
- config.params[params] = value[key];
- }
- delete config.params[propName];
- }
- }
- }
- }
- const routeData = this.$router.resolve({
- path: "/api/blade-purchase-sales/exportOrder/listXSExport", //跳转目标窗口的地址
- query: {
- ...config.params //括号内是要传递给新窗口的参数
- }
- });
- window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
- },
- nodeClick(data) {
- this.params.pid = data.id;
- this.dialogPage.currentPage = 1;
- this.dialogOnLoad(this.dialogPage);
- },
- removeStagList(row, index) {
- this.goodsListSave.splice(row.$index, 1);
- },
- searchCriteriaSwitch(type) {
- if (type) {
- this.option.height = this.option.height - 139;
- } else {
- this.option.height = this.option.height + 139;
- }
- this.$refs.crud.getTableHeight();
- },
- cellStyle() {
- return "padding:0;height:40px;";
- },
- //删除列表后面的删除按钮触发触发(row, index, done)
- rowDel(row, index, done) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- remove(row.id).then(res => {
- if (res.data.code == 200) {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.onLoad(this.page, this.search);
- }
- });
- });
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- // 采购任务弹窗增加多选
- dialogSelectionChange(list) {
- this.goodsListSave = list;
- },
- //行展开数据
- expandChange(row) {
- if (!row.itemData) {
- getGoodsInfo({ id: row.id, tradeType: "CK" })
- .then(res => {
- this.dataList[row.$index].itemData = res.data.data;
- })
- .finally(() => {
- this.dataList[row.$index].itemLoading = false;
- });
- }
- },
- copyDoc() {
- this.selectionList.forEach(e => {
- this.detailData = {
- id: e.id,
- status: "copy"
- };
- this.show = false;
- });
- },
- copyOrder(id) {
- this.show = true;
- this.detailData = {
- id: id,
- status: "copy"
- };
- this.$nextTick(() => {
- this.show = false;
- });
- },
- editOpen(row, status) {
- this.detailData = {
- id: row.id,
- status: status
- };
- this.show = false;
- },
- //点击搜索按钮触发
- searchChange(params, done) {
- if (params.businesDate) {
- params.businesStartDate = params.businesDate[0];
- params.businesEndDate = params.businesDate[1];
- }
- if (params.requiredDeliveryDate) {
- params.requiredDeliveryStartDate = params.requiredDeliveryDate[0];
- params.requiredDeliveryEndDate = params.requiredDeliveryDate[1];
- }
- delete params.businesDate;
- delete params.requiredDeliveryDate;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- currentChange(val) {
- this.page.currentPage = val;
- },
- sizeChange(val) {
- this.page.currentPage = 1;
- this.page.pageSize = val;
- },
- // 标签页切换
- tabHandle(data) {
- if (data.name == "searchList") {
- this.dialogData = this.goodsListShow;
- this.dialogPage.total = this.totalTwo;
- } else if (data.name == "importStaging") {
- this.goodsListShow = this.dialogData;
- this.dialogData = this.goodsListSave;
- this.totalTwo = this.dialogPage.total;
- this.dialogPage.total = 0;
- }
- },
- // 采购任务弹窗列表选择按钮
- importStagList(row, index) {
- this.goodsListSave.push(row);
- },
- allClick(name) {
- if (name == "全选") {
- this.dialogData.forEach(item => {
- if (this.goodsListSave.filter(e => item.id == e.id).length == 0) {
- this.goodsListSave.push(item);
- }
- });
- }
- },
- // 采购任务弹窗列表刷新
- refreshChangeTwo() {
- this.dialogOnLoad(this.page);
- },
- searchChangeTwo(params, done) {
- done();
- if (!this.params.pid && !this.params.billNo) {
- return this.$message.error("请选择左边单号或输入销售单号");
- } else {
- this.dialogOnLoad(this.page);
- }
- },
- searchReset() {
- this.avueTree = !this.avueTree;
- this.params.showAll = 0;
- this.$refs.singleTable.setCurrentRow([]);
- this.dialogData = [];
- },
- //自定义列保存
- async saveColumnTwo(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- console.log(875);
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- openReport() {
- this.switchDialog = !this.switchDialog;
- },
- onClose(val) {
- this.switchDialog = val;
- },
- confirmImport() {
- let ids = this.goodsListSave.map(item => {
- return item.id;
- });
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- generatePurchaseBill(this.goodsListSave)
- .then(res => {
- this.$message.success("导入成功");
- console.log(res, 629);
- for (let item of res.data.data.orderItemsList) {
- getGoods(1, 10, null, { cname: item.cname }).then(res => {
- item.price = res.data.data.records[0].displayPrice;
- });
- }
- this.detailData = {
- form: res.data.data
- };
- loading.close();
- this.procureVisible = false; // 待采购弹窗关闭
- this.dialogVisible = false; // 采购任务弹窗关闭
- this.activeName = "searchList";
- setTimeout(() => {
- this.show = false;
- }, 200);
- })
- .catch(() => {
- loading.close();
- });
- },
- // 采购任务列表获取数据
- dialogOnLoad(page, params) {
- this.dialogLoading = true;
- params = {
- ...params,
- size: page.pageSize,
- current: page.currentPage,
- ...this.params
- };
- if (this.params.pid || this.params.billNo) {
- listXS(params).then(res => {
- this.dialogLoading = false;
- this.dialogData = res.data.data;
- // this.dialogPage.total = res.data.data.total
- });
- }
- },
- // 待采购列表获取数据
- procureOnLoad(id) {
- let params = {
- size: 20,
- current: 1,
- showAll: 0,
- pid: id
- };
- listXS(params).then(res => {
- this.procurelistData = res.data.data;
- });
- },
- onLoad(page, params) {
- if (this.search.businesDate && this.search.businesDate.length > 0) {
- params = {
- ...params,
- orderStartDate: this.search.businesDate[0],
- orderEndDate: this.search.businesDate[1]
- };
- delete params.businesDate;
- }
- if (this.search.requiredDeliveryDate && this.search.requiredDeliveryDate.length > 0) {
- params = {
- ...params,
- requiredDeliveryStartDate: this.search.requiredDeliveryDate[0],
- requiredDeliveryEndDate: this.search.requiredDeliveryDate[1]
- };
- delete params.requiredDeliveryDate;
- }
- params = {
- ...params,
- tabType: this.tabType
- };
- this.loading = true;
- this.dataList.forEach(item => {
- this.$refs.crud.toggleRowExpansion(item, false);
- });
- getList(page.currentPage, page.pageSize, params)
- .then(res => {
- if (res.data.data.records) {
- res.data.data.records.forEach(e => {
- e.itemLoading = true;
- });
- }
- this.dataList = res.data.data.records ? res.data.data.records : [];
- this.page.total = res.data.data.total;
- })
- .finally(() => {
- this.loading = false;
- });
- },
- refreshChange() {
- this.onLoad(this.page, this.search);
- },
- newAdd(type) {
- this.detailData = {
- pageType: type
- };
- this.show = false;
- },
- goBack() {
- this.detailData = this.$options.data().detailData;
- this.show = true;
- this.onLoad(this.page, this.search);
- },
- //自定义列保存
- async saveColumn(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumn(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- handleCurrentChange(val) {
- console.log(val);
- // this.currentRow = val;
- this.params.pid = val.id;
- this.dialogPage.currentPage = 1;
- this.dialogOnLoad(this.dialogPage);
- }
- },
- watch: {
- option: function() {
- this.search.businesDate = defaultDate(5);
- },
- dialogVisible: function() {
- this.goodsListShow = [];
- this.goodsListSave = [];
- this.totalTwo = 0;
- this.dialogData = [];
- listBYStatus({}).then(res => {
- this.treeData = res.data.data;
- });
- this.dialogOnLoad(this.page);
- }
- }
- };
- </script>
- <style scoped>
- ::v-deep .select-component {
- display: flex;
- }
- .page-crad ::v-deep .basic-container__card {
- //height: 94.2vh;
- height: 100vh;
- }
- .itemTable ::v-deep .el-table {
- margin-left: 50px;
- width: 100%;
- }
- /deep/ .el-col-md-8 {
- width: 24.33333%;
- }
- </style>
|