12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535 |
- <template>
- <div class="app-container">
- <div class="search-bx">
- <div class="search">
- <el-row :gutter="0">
- <el-input
- v-model="tableObj.getdataListParm.parammaps.customerName"
- placeholder="客户名称"
- style="width: 180px"
- class="filter-item"
- clearable
- />
- <el-select
- v-model="tableObj.getdataListParm.parammaps.groupId"
- placeholder="集团"
- class="filter-item"
- style="width: 120px"
- clearable
- >
- <el-option
- v-for="item in groupNameList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- <el-input
- v-model="tableObj.getdataListParm.parammaps.posterName"
- placeholder="寄件人"
- class="filter-item"
- style="width: 120px"
- />
- <el-date-picker
- v-model="tableObj.getdataListParm.parammaps.inputDatetime"
- class="inputDatetime filter-item"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- style="width: 250px"
- />
- <el-button class="successBorder" @click="form_search">查询</el-button>
- <el-button class="successBorder" @click="form_clear">重置</el-button>
- <el-button
- v-if="isExpressAdd"
- class="success"
- icon="el-icon-plus"
- @click="form_add"
- >新增</el-button
- >
- <!-- <el-button class="success" icon="el-icon-upload2" @click="form_export">导出</el-button> -->
- </el-row>
- </div>
- <!-- <div class="operation">
- <el-row :gutter="0">
- <el-col :span="21">
- <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="form_add">新增</el-button>
- </el-col>
- <el-col :span="3">
- </el-col>
- </el-row>
- </div> -->
- </div>
- <div class="table">
- <el-table
- :key="tableObj.tableKey"
- v-loading="tableObj.listLoading"
- element-loading-text="给我一点时间"
- :data="tableObj.list"
- border
- fit
- highlight-current-row
- style="width: 100%"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :max-height="myHeight"
- >
- <!-- <el-table-column type="selection" align="center" width="50" /> -->
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{
- scope.$index + (tableObj.pageNum - 1) * tableObj.pageSize + 1
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="客户名称"
- min-width="120px"
- align="center"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <span>{{ scope.row.customerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="集团" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.groupName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="接收日期" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pdate }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="寄件人"
- min-width="110px"
- align="center"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <span>{{ scope.row.posterName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="寄件电话" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.posterTel }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="寄件单号"
- min-width="120px"
- align="center"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <span>{{ scope.row.postCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="快递寄出原因" min-width="120px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.reason }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="处理方式"
- min-width="110px"
- align="center"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <span>{{ scope.row.handletypeName }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="备注"
- min-width="120px"
- align="center"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <span>{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- <el-table-column label="录入日期" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.created }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- :width="autoWidth"
- v-if="autoWidth !== 0"
- class-name="small-padding fixed-width"
- fixed="right"
- >
- <template slot-scope="{ row }">
- <!-- <el-button v-if="isRoleEdit" class="miniSuccess" @click="form_edit(row)">编辑</el-button>
- <el-button v-if="isRoleEdit" class="miniDanger" @click="form_delete(row)">删除</el-button> -->
- <el-button class="miniPrimary" @click="form_see(row)"
- >查看</el-button
- >
- <el-button
- v-if="
- isExpressAdd &&
- row.isModify == '1' &&
- row.createrId == employeid
- "
- class="miniSuccess"
- @click="form_edit(row)"
- >编辑</el-button
- >
- <el-button
- v-if="
- isExpressAdd && row.isDel == '1' && row.createrId == employeid
- "
- class="miniDanger"
- @click="form_delete(row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="tableObj.total >= 0"
- :total="tableObj.total"
- :page.sync="tableObj.getdataListParm.offset"
- :limit.sync="tableObj.getdataListParm.pagecount"
- @pagination="get_table_data"
- />
- </div>
- <!-- 新增/编辑 -->
- <el-dialog
- :title="textMap[create.dialogStatus]"
- :visible.sync="create.dialogFormVisible"
- :close-on-click-modal="false"
- width="60%"
- >
- <div class="app-add">
- <el-form
- ref="temp"
- :rules="create.rules"
- :model="create.temp"
- label-position="right"
- label-width="150px"
- style="width: 80%; margin: 0 auto 50px"
- >
- <el-row>
- <el-col :span="12">
- <el-form-item label="客户名称:" prop="customerId">
- <el-select
- v-model="create.temp.customerId"
- filterable
- placeholder="客户名称"
- class="filter-item"
- style="width: 100%"
- clearable
- @change="change_customer"
- :disabled="
- create.dialogStatus == 'see' ||
- create.dialogStatus == 'update'
- "
- >
- <el-option
- v-for="item in create.customerNameList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="所属集团:" prop="groupId">
- <el-select v-model="create.temp.groupId" placeholder="所属集团" class="filter-item" style="width: 100%;" filterable @change="change_group" clearable :disabled="create.dialogStatus=='see' || create.dialogStatus=='update' " >
- <el-option v-for="item in groupNameList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item> -->
- <!-- <el-form-item label="客户名称:" prop="customerName" >
- <el-autocomplete ref="customerName" v-model="create.temp.customerName" :fetch-suggestions="customer_search" placeholder="客户名称" style="width: 100%;margin-right:10px" @select="changeCustomer" :disabled="create.dialogStatus=='see' || create.dialogStatus=='update'" @clear="clear_customer_selectTemp" @blur="customer_search_blurTemp" clearable >
- <template slot-scope="{ item }">
- <span class="name">{{ item.name }}</span>
- </template>
- </el-autocomplete>
- </el-form-item> -->
- </el-col>
- <el-col :span="12">
- <el-form-item label="集团:" prop="groupName">
- <el-input
- ref="groupName"
- v-model="create.temp.groupName"
- class="filter-item"
- style="width: 100%"
- disabled
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="接收日期:" prop="pdate">
- <el-date-picker
- v-model="create.temp.pdate"
- type="date"
- placeholder="选择日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width: 100%"
- :clearable="false"
- :disabled="create.dialogStatus == 'see'"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="寄件人:" prop="posterId">
- <el-select
- ref="posterId"
- v-model="create.temp.posterId"
- filterable
- placeholder="请选择寄件人"
- class="filter-item"
- style="width: 100%"
- @change="changeReceiver"
- :disabled="create.dialogStatus == 'see'"
- >
- <el-option
- v-for="item in create.posterNameList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="寄件电话:" prop="posterTel">
- <el-input
- ref="posterTel"
- v-model="create.temp.posterTel"
- class="filter-item"
- style="width: 100%"
- maxlength="11"
- placeholder="请输入寄件电话"
- :disabled="create.dialogStatus == 'see'"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="寄件单号:" prop="postCode">
- <el-input
- ref="postCode"
- v-model="create.temp.postCode"
- class="filter-item"
- style="width: 100%"
- maxlength="30"
- placeholder="请输入寄件单号"
- :disabled="create.dialogStatus == 'see'"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="寄件原因:" prop="reason">
- <el-input
- ref="reason"
- v-model="create.temp.reason"
- class="filter-item"
- style="width: 100%"
- maxlength="11"
- placeholder="请输入寄件原因"
- :disabled="create.dialogStatus == 'see'"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="处理方式:" prop="handletypeId">
- <el-select
- ref="handletypeId"
- v-model="create.temp.handletypeId"
- filterable
- placeholder="请选择处理方式"
- class="filter-item"
- style="width: 100%"
- :disabled="create.dialogStatus == 'see'"
- >
- <el-option
- v-for="item in handletypeList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-form-item label="备注:" prop="remark">
- <el-input
- ref="remark"
- v-model="create.temp.remark"
- type="textarea"
- :autosize="{ minRows: 1.3, maxRows: 4 }"
- placeholder="请输入备注,最多255个字"
- maxlength="255"
- class="filter-item"
- style="width: 100%"
- :disabled="create.dialogStatus == 'see'"
- />
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item label="添加收货物品:" prop="visiterId">
- <el-select
- ref="visiterId"
- v-model="create.temp.visiterId"
- filterable
- placeholder="请选择收货物品"
- class="filter-item"
- style="width: 100%"
- :disabled="create.dialogStatus == 'see'"
- @change="change_receProduct"
- >
- <el-option
- v-for="item in receProductNameList"
- :key="item.productsId"
- :label="
- '产品名称:' +
- item.productsName +
- ' 型号:' +
- item.model +
- ' 规格:' +
- item.Specifications
- "
- :value="item.productsId"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-row>
- <el-row>
- <el-table
- :key="contact.tableKey"
- v-loading="contact.listLoading"
- element-loading-text="给我一点时间"
- :data="contact.list"
- border
- fit
- highlight-current-row
- style="width: 100%"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column
- label="序号"
- align="center"
- type="index"
- width="50px"
- >
- <template slot-scope="scope">
- <span>{{ scope.$index + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="产品名称"
- min-width="110px"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.productsName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="型号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.model }}</span>
- </template>
- </el-table-column>
- <el-table-column label="规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.Specifications }}</span>
- </template>
- </el-table-column>
- <el-table-column label="数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span v-if="create.dialogStatus == 'see'">{{
- scope.row.nums
- }}</span>
- <el-input
- v-if="
- create.dialogStatus == 'update' ||
- create.dialogStatus == 'create'
- "
- v-model="scope.row.nums"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="280px" align="center">
- <template slot-scope="scope">
- <span v-if="create.dialogStatus == 'see'">{{
- scope.row.remark
- }}</span>
- <el-input
- v-if="
- create.dialogStatus == 'update' ||
- create.dialogStatus == 'create'
- "
- v-model="scope.row.remark"
- type="textarea"
- :autosize="{ minRows: 1.3, maxRows: 4 }"
- style="width: 95%; padding: 10px 0"
- />
- </template>
- </el-table-column>
- <el-table-column
- v-if="
- create.dialogStatus == 'update' ||
- create.dialogStatus == 'create'
- "
- label="操作"
- align="center"
- width="110"
- class-name="small-padding fixed-width"
- fixed="right"
- >
- <template slot-scope="{ row }">
- <el-button
- v-if="
- create.dialogStatus == 'update' ||
- create.dialogStatus == 'create'
- "
- class="miniDanger"
- @click="form_delete2(row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button
- class="cancelClose"
- @click="
- create.dialogFormVisible = false;
- get_table_data();
- "
- >关闭</el-button
- >
- <el-button
- v-if="
- create.dialogStatus === 'create' ||
- create.dialogStatus === 'update'
- "
- class="success"
- :disabled="isokDisable"
- @click="
- create.dialogStatus === 'create'
- ? add_dialog_save()
- : form_edit_save()
- "
- >确认</el-button
- >
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- GetDataByName,
- PostDataByName,
- failproccess,
- ExecDataByConfig,
- GetDataByNames,
- checkButtons,
- calculativeWidth,
- } from "@/api/common";
- import Cookies from "js-cookie";
- import { parseTime, json2excel } from "@/utils/index.js";
- import Pagination from "@/components/Pagination";
- import { MessageBox } from "element-ui";
- export default {
- name: "expressReception",
- components: { Pagination },
- data() {
- return {
- myHeight: document.documentElement.clientHeight - 85 - 160,
- employeid: Cookies.get("employeid"),
- isExpressAdd: [],
- isRoleEdit: [],
- send_select_list: [
- { name: "getCustomerSelect", offset: 0, pagecount: 0, parammaps: {} },
- {
- name: "getDictListSelect1",
- offset: 0,
- pagecount: 0,
- parammaps: { pid: "54" },
- },
- {
- name: "getProductsEnable",
- offset: 0,
- pagecount: 0,
- parammaps: { enable: "1" },
- },
- {
- name: "getDictListSelect3",
- offset: 0,
- pagecount: 0,
- parammaps: { pid: "57" },
- },
- ],
- customerNameList: [], // 客户名称
- groupNameList: [], // 集团
- //下拉框 - 收件货品
- receProductNameList: [
- // {"Specifications":"SMA连接线","categoryId":14,"categoryName":"易 损 配 件","model":"根","price":"0.00","productsId":25,"productsName":"同轴电缆","remark":"","sort":1},
- // {"Specifications":"SMA转TNC连接线","categoryId":14,"categoryName":"易 损 配 件","model":"根","price":"0.00","productsId":26,"productsName":"同轴电缆","remark":"质保期3个月","sort":2},
- // {"Specifications":"/","categoryId":14,"categoryName":"易 损 配 件","model":"个","price":"0.00","productsId":27,"productsName":"蓄电池","remark":"质保期1年","sort":3},{"Specifications":"/","categoryId":14,"categoryName":"易 损 配 件","model":"个","price":"0.00","productsId":28,"productsName":"充电器","remark":"质保期1年","sort":4},
- // {"Specifications":"200*125 T","categoryId":14,"categoryName":"易 损 配 件","model":"张","price":"0.00","productsId":29,"productsName":"薄膜开关","remark":"质保期3个月","sort":5},
- ],
- handletypeList: [], // 处理方式
- //表格请求参数~~
- tableObj: {
- getdataListParm: {
- name: "getPostal",
- page: 1,
- offset: 1,
- pagecount: parseInt(Cookies.get("pagecount")),
- returntype: "Map",
- parammaps: {
- roleId: Cookies.get("g_roleId"),
- userId: Cookies.get("g_userId"),
- customerName: "",
- customerId: "",
- groupId: "",
- posterName: "",
- inputDatetime: "",
- beginDate: "",
- endDate: "",
- },
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: true,
- temp: {},
- },
- download: {
- getdataListParm: {
- name: "getPostal",
- page: 1,
- offset: 1,
- pagecount: 0,
- returntype: "Map",
- parammaps: {
- roleId: Cookies.get("g_roleId"),
- userId: Cookies.get("g_userId"),
- customerName: "",
- customerId: "",
- groupId: "",
- posterName: "",
- inputDatetime: "",
- beginDate: "",
- endDate: "",
- },
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: true,
- temp: {},
- },
- // 新增/编辑
- create: {
- dialogFormVisible: false,
- dialogStatus: "",
- temp: {
- customerId: "",
- customerName: "",
- groupId: "",
- visiterId: "",
- groupName: "",
- pdate: parseTime(new Date(), "{y}-{m}-{d}"),
- posterId: "",
- posterName: "",
- posterTel: "",
- postCode: "",
- reason: "",
- handletypeId: "",
- remark: "",
- id: "",
- modifyName: "add",
- receiverChoose: "true",
- },
- rules: {
- customerId: [{ required: true, message: "必填", trigger: "blur" }],
- // groupId: [{ required: true, message: '必填', trigger: 'blur' }],
- pdate: [{ required: true, message: "必填", trigger: "blur" }],
- posterId: [{ required: true, message: "必填", trigger: "blur" }],
- posterTel: [{ required: true, message: "必填", trigger: "blur" }],
- postCode: [{ required: true, message: "必填", trigger: "blur" }],
- },
- // 寄件人
- getdataListParm: {
- name: "getContacts",
- returntype: "Map",
- parammaps: { customerId: "" },
- },
- posterNameList: [], // 寄件人
- // 客户名称
- getdataListParmCust: {
- name: "getCustomerByGroupId",
- returntype: "Map",
- parammaps: { groupId: "" },
- },
- customerNameList: [],
- // 集团
- getdataListParm2: {
- name: "getgroupNameById",
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: "Map",
- parammaps: { id: "" },
- },
- // 弹窗里的表格,仅编辑查看时调用
- getdataListParm3: {
- name: "getPostalGoodsById",
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: "Map",
- parammaps: { postalId: "" },
- },
- // 寄件人电话
- getdataListParm4: {
- name: "getTelById",
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: "Map",
- parammaps: { id: "" },
- },
- },
- textMap: {
- create: "新增",
- see: "查看",
- update: "编辑",
- },
- // 管理
- contact: {
- dialogFormVisible: false,
- dialogStatus: "",
- temp: {
- id: "",
- contactName: "",
- telephone: "",
- address: "",
- remark: "",
- },
- rules: {},
- getdataListParm: {
- name: "getContacts",
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: "Map",
- parammaps: { customerId: "" },
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: false,
- },
- autoWidth: 130,
- requestParam: {},
- isokDisable: false,
- selectList: [],
- rowStyle: { maxHeight: 50 + "px", height: 45 + "px" },
- cellStyle: { padding: 0 + "px" },
- };
- },
- created() {
- this.get_table_data();
- this.get_select_list();
- this.get_auto_buttons();
- },
- methods: {
- //获取按钮权限
- get_auto_buttons() {
- const Edit = "expressReception";
- const isRoleEdit = checkButtons(
- JSON.parse(sessionStorage.getItem("buttons")),
- Edit
- );
- this.isRoleEdit = isRoleEdit;
- const ExpressAdd = "business:express:add";
- const isExpressAdd = checkButtons(
- this.$store.state.user.buttons,
- ExpressAdd
- );
- this.isExpressAdd = isExpressAdd;
- //操作的宽度
- // var widthCount = calculativeWidth(isExpressAdd,isExpressAdd) + 90
- // this.autoWidth = widthCount
- },
- //获取所有下拉框的内容
- get_select_list() {
- GetDataByNames(this.send_select_list).then((response) => {
- this.create.customerNameList = response.data.getCustomerSelect.list;
- console.log("客户名称下拉框", this.create.customerNameList);
- this.groupNameList = response.data.getDictListSelect1.list;
- console.log("集团下拉框", this.groupNameList);
- // response.data.getProductsEnable.list.map(function (i) {
- // return (i.productsId = i.id)
- // })
- response.data.getProductsEnable.list.map(function (i) {
- return (i.customerId = "");
- });
- response.data.getProductsEnable.list.map(function (i) {
- return (i.nums = "");
- });
- response.data.getProductsEnable.list.map(function (i) {
- return (i.remark = "");
- });
- this.receProductNameList = response.data.getProductsEnable.list;
- console.log("收件货品下拉框", this.receProductNameList);
- this.handletypeList = response.data.getDictListSelect3.list;
- console.log("处理方式下拉框", this.handletypeList);
- });
- },
- //加载表格
- get_table_data() {
- var me = this;
- this.tableObj.listLoading = true;
- console.log(
- "this.tableObj.getdataListParm======>",
- this.tableObj.getdataListParm
- );
- GetDataByName(this.tableObj.getdataListParm).then((response) => {
- console.log("table数据======>", response.data.list);
- if (response.data.list !== null) {
- this.tableObj.list = response.data.list;
- this.tableObj.pageNum = response.data.pageNum;
- this.tableObj.pageSize = response.data.pageSize;
- this.tableObj.total = response.data.total;
- //计算操作栏宽度
- var btnNum = 0;
- var arrList = response.data.list;
- arrList.forEach(function (row) {
- var itemBtnNum = 0;
- if (
- me.isExpressAdd &&
- row.isModify == "1" &&
- row.createrId == me.employeid
- ) {
- itemBtnNum = itemBtnNum + 1;
- }
- if (
- me.isExpressAdd &&
- row.isDel == "1" &&
- row.createrId == me.employeid
- ) {
- itemBtnNum = itemBtnNum + 1;
- }
- console.log(itemBtnNum);
- if (itemBtnNum > btnNum) {
- btnNum = itemBtnNum;
- }
- });
- console.log("btnNum=============", btnNum);
- me.autoWidth = btnNum * 90 + 90;
- } else {
- this.tableObj.list = [];
- }
- setTimeout(() => {
- this.tableObj.listLoading = false;
- }, 100);
- });
- },
- form_search() {
- console.log("点击了查询");
- if (
- this.tableObj.getdataListParm.parammaps.inputDatetime !== "" &&
- this.tableObj.getdataListParm.parammaps.inputDatetime !== null
- ) {
- this.tableObj.getdataListParm.parammaps.beginDate = parseTime(
- this.tableObj.getdataListParm.parammaps.inputDatetime[0],
- "{y}-{m}-{d}"
- );
- this.tableObj.getdataListParm.parammaps.endDate = parseTime(
- this.tableObj.getdataListParm.parammaps.inputDatetime[1],
- "{y}-{m}-{d}"
- );
- } else {
- this.tableObj.getdataListParm.parammaps.inputDatetime = "";
- this.tableObj.getdataListParm.parammaps.beginDate = "";
- this.tableObj.getdataListParm.parammaps.endDate = "";
- }
- this.tableObj.getdataListParm.offset = 1;
- this.get_table_data();
- },
- form_clear() {
- console.log("点击了重置");
- this.tableObj.getdataListParm.parammaps.customerName = "";
- this.tableObj.getdataListParm.parammaps.customerId = "";
- this.tableObj.getdataListParm.parammaps.groupId = "";
- this.tableObj.getdataListParm.parammaps.posterName = "";
- this.tableObj.getdataListParm.parammaps.beginDate = "";
- this.tableObj.getdataListParm.parammaps.endDate = "";
- this.tableObj.getdataListParm.parammaps.inputDatetime = "";
- this.tableObj.getdataListParm.offset = 1;
- this.get_table_data();
- },
- // 新增
- form_reset() {
- this.create.temp = {
- customerId: "",
- customerName: "",
- groupId: "",
- visiterId: "",
- groupName: "",
- pdate: parseTime(new Date(), "{y}-{m}-{d}"),
- posterId: "",
- posterName: "",
- posterTel: "",
- postCode: "",
- reason: "",
- handletypeId: "",
- remark: "",
- id: "",
- modifyName: "add",
- receiverChoose: "true",
- };
- this.contact.list = [];
- },
- //监听 - 集团
- change_group(item) {
- console.log(item);
- console.log(this.create.temp.groupId);
- this.create.temp.groupId = item;
- this.create.getdataListParmCust.parammaps.groupId = item;
- this.create.temp.customerName = "";
- this.create.temp.customerId = "";
- this.create.customerNameList = [];
- this.get_customer_list();
- this.$forceUpdate();
- },
- // 弹窗中的客户
- get_customer_list() {
- GetDataByName(this.create.getdataListParmCust).then((response) => {
- if (response.data.list !== null) {
- this.create.customerNameList = response.data.list;
- console.log("弹窗中的客户数据", response.data.list);
- } else {
- this.create.customerNameList = [];
- }
- });
- },
- //监听 - 下拉中客户名称
- change_customer(item) {
- console.log(item);
- this.create.temp.customerId = item;
- this.get_groupName(item);
- this.create.getdataListParm.parammaps.customerId = item;
- // this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
- this.getPosterNameList();
- },
- // 获取集团名称
- get_groupName(customerId) {
- var me = this;
- var send_data = {
- name: "getgroupNameById",
- returntype: "Map",
- parammaps: { id: customerId },
- };
- GetDataByName(send_data).then((response) => {
- console.log(response);
- if (response.data.list !== null) {
- me.create.temp.groupName = response.data.list[0].groupName;
- me.create.temp.groupId = response.data.list[0].groupId;
- } else {
- me.create.temp.groupName = "";
- me.create.temp.groupId = "";
- }
- });
- },
- //监听 - 下拉中客户名称
- changeCustomer(item) {
- console.log(item);
- this.create.temp.customerId = item.id;
- this.create.temp.customerName = item.name;
- this.$forceUpdate();
- this.create.getdataListParm.parammaps.customerId = item.id;
- // this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
- this.getPosterNameList();
- this.create.getdataListParm2.parammaps.id = item.id;
- this.getGroupNameId();
- },
- clear_customer_selectTemp(item) {
- document.activeElement.blur();
- this.create.temp.customerId = "";
- this.create.temp.customerName = "";
- this.create.temp.groupName = "";
- this.$forceUpdate();
- },
- //模糊查询客户
- customer_search(queryString, cb) {
- console.log("模糊查询输入值", queryString);
- GetDataByName({
- name: "getCustomerNameFuzzy",
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: "Map",
- parammaps: { inputvalue: queryString },
- }).then((response) => {
- this.customerNameList = response.data.list;
- console.log("客户名称下拉框", response);
- cb(response.data.list);
- });
- },
- //模糊查询客户选择
- change_customer_select(item) {
- console.log("客户名称模糊查询选中值", item);
- this.tableObj.getdataListParm.parammaps.customerId = item.id;
- this.tableObj.getdataListParm.parammaps.customerName = item.name;
- },
- //清空客户选择
- clear_customer_select(item) {
- this.tableObj.getdataListParm.parammaps.customerId = "";
- this.tableObj.getdataListParm.parammaps.customerName = "";
- document.activeElement.blur();
- },
- //客户失去焦点
- customer_search_blur(item) {
- console.log("客户失去焦点");
- this.tableObj.getdataListParm.parammaps.customerId = "";
- this.tableObj.getdataListParm.parammaps.customerName = "";
- this.customerNameList = [];
- },
- customer_search_blurTemp(item) {
- this.create.temp.customerId = "";
- this.create.temp.customerName = "";
- this.create.temp.groupName = "";
- this.customerNameList = [];
- this.$forceUpdate();
- },
- //
- getPosterNameList() {
- GetDataByName(this.create.getdataListParm).then((response) => {
- if (response.data.list !== null) {
- this.create.posterNameList = response.data.list;
- console.log("寄件人数据", response.data.list);
- } else {
- this.create.posterNameList = [];
- }
- });
- },
- //监听 - 下拉中寄件人
- changeReceiver(item) {
- this.create.getdataListParm4.parammaps.id = item;
- this.create.temp.posterName = this.create.posterNameList.find(
- (obj) => obj.id === item
- ).name;
- this.getTelephoneName();
- },
- // 接待人电话
- getTelephoneName() {
- GetDataByName(this.create.getdataListParm4).then((response) => {
- if (response.data.list !== null) {
- this.create.temp.posterTel = response.data.list[0].telephone;
- console.log("接待人电话", response.data.list);
- }
- });
- },
- // 集团名称
- getGroupNameId() {
- GetDataByName(this.create.getdataListParm2).then((response) => {
- if (response.data.list !== null) {
- this.create.temp.groupName = response.data.list[0].groupName;
- this.create.temp.groupId = response.data.list[0].groupId;
- console.log("集团名称", response.data.list);
- }
- });
- },
- //下拉 - 收件货品
- change_receProduct(item) {
- console.log("收件货品ID ", item);
- var index = this.receProductNameList.findIndex(
- (obj) => obj.productsId == item
- );
- console.log("收件货品index ", index);
- var ifHasId = this.contact.list.findIndex(
- (obj) => obj.productsId == item
- );
- console.log("收件货品是否存在列表 ", ifHasId);
- var addRow = Object.assign({}, this.receProductNameList[index]);
- addRow.nums = 1;
- addRow.remark = "";
- if (ifHasId == "-1") {
- this.contact.list.unshift(addRow);
- }
- },
- //小表格中的删除
- form_delete2(row) {
- console.log("小表格中的删除", row);
- var index = this.contact.list.findIndex((obj) => obj.id == row.id);
- this.contact.list.splice(index, 1);
- },
- //新增
- form_add() {
- console.log("点击了新增");
- this.form_reset();
- this.create.dialogStatus = "create";
- this.create.dialogFormVisible = true;
- },
- //新增保存
- add_dialog_save() {
- console.log("点击了新增保存", this.create.temp);
- this.isokDisable = true;
- setTimeout(() => {
- this.isokDisable = false;
- }, 1000);
- this.$refs["temp"].validate((valid) => {
- if (valid) {
- this.isokDisable = true;
- setTimeout(() => {
- this.isokDisable = false;
- }, 1000);
- var customerId = this.create.temp.customerId;
- this.contact.list.map(function (i) {
- return (i.customerId = customerId);
- });
- this.contact.list.map(function (i) {
- return (i.postalId = "");
- });
- if (
- this.create.posterNameList.find(
- (obj) => obj.id == this.create.temp.posterId
- )
- ) {
- console.log("posterNameList下拉直接选的!");
- this.create.temp.receiverChoose = "true";
- } else {
- this.create.temp.posterName = this.create.temp.posterId;
- this.create.temp.receiverChoose = "false";
- console.log("posterNameList下拉自己填的!");
- }
- console.log("点击了新增保存", this.create.temp);
- console.log("点击了新增保存", this.contact.list);
- this.create.temp.receiverId2 = "";
- this.create.temp.createrId = Cookies.get("employeid");
- this.create.temp.posterId2 = "@insertContactsNew.LastInsertId";
- var send_data = {
- common: { returnmap: "0" },
- data: [
- {
- name: "insertContactsNew",
- type: "e",
- parammaps: {
- customerId: this.create.temp.customerId,
- contactName: this.create.temp.posterName,
- telephone: this.create.temp.receiverTel,
- address: "",
- remark: this.create.temp.remark,
- receiverChoose: this.create.temp.receiverChoose,
- },
- },
- {
- name: "insertPostal",
- type: "e",
- parammaps: this.create.temp,
- },
- {
- name: "insertPostalGoods",
- resultmaps: {
- list: this.contact.list,
- },
- children: [
- {
- name: "insertPostalGoods",
- type: "e",
- parammaps: {
- postalId: "@insertPostal.LastInsertId",
- customerId: "@insertPostalGoods.customerId",
- productsId: "@insertPostalGoods.productsId",
- nums: "@insertPostalGoods.nums",
- createrId: "@insertPostalGoods.createrId",
- remark: "@insertPostalGoods.remark",
- },
- },
- ],
- },
- ],
- };
- var isEmpty = this.contact.list.find((i) => i.nums == "");
- console.log(isEmpty);
- if (isEmpty) {
- this.$message({
- type: "error",
- message: "货品数量不可为空",
- duration: 2000,
- });
- } else {
- ExecDataByConfig(send_data).then((response) => {
- console.log("新增保存发送参数", this.requestParam);
- if (response.msg !== "fail") {
- this.$notify({
- title: "成功",
- message: "保存成功",
- type: "success",
- duration: 2000,
- });
- this.create.dialogFormVisible = false;
- this.get_table_data();
- } else {
- this.$notify({
- title: "失败",
- message: "保存失败" + response.data,
- type: "error",
- duration: 2000,
- });
- }
- });
- }
- }
- });
- },
- // 查看
- form_see(row) {
- console.log("点击了查看", row);
- this.create.dialogStatus = "see";
- this.create.dialogFormVisible = true;
- this.$nextTick(() => {
- this.$refs.temp.resetFields();
- this.create.temp = Object.assign({}, row);
- });
- this.create.temp.id = row.id;
- this.create.getdataListParm.parammaps.customerId = row.customerId;
- this.getPosterNameList();
- this.create.getdataListParm3.parammaps.postalId = row.id;
- this.getReceProduct();
- // this.create.getdataListParmCust.parammaps.groupId = row.groupId
- // this.get_customer_list()
- },
- // 编辑
- form_edit(row) {
- console.log("点击了编辑", row);
- this.create.dialogStatus = "update";
- this.create.dialogFormVisible = true;
- this.$nextTick(() => {
- this.$refs.temp.resetFields();
- this.create.temp = Object.assign({}, row);
- });
- this.create.temp.id = row.id;
- // this.create.getdataListParmCust.parammaps.groupId = row.groupId
- // this.get_customer_list()
- this.create.getdataListParm.parammaps.customerId = row.customerId;
- this.getPosterNameList();
- this.create.getdataListParm3.parammaps.postalId = row.id;
- this.getReceProduct();
- },
- // 查看和编辑中的小表格
- getReceProduct() {
- GetDataByName(this.create.getdataListParm3).then((response) => {
- console.log("查看和编辑中的小表格", response.data.list);
- if (response.data.list !== null) {
- this.contact.list = response.data.list;
- }
- });
- },
- // 编辑保存
- form_edit_save() {
- this.isokDisable = true;
- setTimeout(() => {
- this.isokDisable = false;
- }, 1000);
- this.$refs["temp"].validate((valid) => {
- if (valid) {
- this.isokDisable = true;
- setTimeout(() => {
- this.isokDisable = false;
- }, 1000);
- this.create.temp.modifyName = "update";
- var customerId = this.create.temp.customerId;
- var postalId = this.create.temp.id;
- this.contact.list.map(function (i) {
- return (i.customerId = customerId);
- });
- this.contact.list.map(function (i) {
- return (i.postalId = postalId);
- });
- if (
- this.create.posterNameList.find(
- (obj) => obj.id == this.create.temp.posterId
- )
- ) {
- console.log("posterNameList下拉直接选的!");
- this.create.temp.receiverChoose = "true";
- } else {
- this.create.temp.posterName = this.create.temp.posterId;
- this.create.temp.receiverChoose = "false";
- console.log("posterNameList下拉自己填的!");
- }
- this.create.temp.receiverId2 = "";
- this.create.temp.posterId2 = "@insertContactsNew.LastInsertId";
- var send_data = {
- common: { returnmap: "0" },
- data: [
- {
- name: "insertContactsNew",
- type: "e",
- parammaps: {
- customerId: this.create.temp.customerId,
- contactName: this.create.temp.posterName,
- telephone: this.create.temp.receiverTel,
- address: "",
- remark: this.create.temp.remark,
- receiverChoose: this.create.temp.receiverChoose,
- },
- },
- {
- name: "updatePostal",
- type: "e",
- parammaps: this.create.temp,
- },
- {
- name: "delPostalGoods",
- type: "e",
- parammaps: { postalId: this.create.temp.id },
- },
- {
- name: "insertPostalGoods",
- resultmaps: {
- list: this.contact.list,
- },
- children: [
- {
- name: "insertPostalGoods",
- type: "e",
- parammaps: {
- postalId: "@insertPostalGoods.postalId",
- customerId: "@insertPostalGoods.customerId",
- productsId: "@insertPostalGoods.productsId",
- nums: "@insertPostalGoods.nums",
- remark: "@insertPostalGoods.remark",
- },
- },
- ],
- },
- ],
- };
- ExecDataByConfig(send_data).then((response) => {
- console.log("新增保存发送参数", this.requestParam);
- if (response.msg !== "fail") {
- this.$notify({
- title: "成功",
- message: "保存成功",
- type: "success",
- duration: 2000,
- });
- this.create.dialogFormVisible = false;
- this.get_table_data();
- } else {
- this.$notify({
- title: "失败",
- message: "保存失败",
- type: "error",
- duration: 2000,
- });
- }
- });
- }
- });
- },
- // 删除
- form_delete(row) {
- MessageBox.confirm("是否确认删除此信息?", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.requestParam.name = "delPostal";
- this.requestParam.parammaps = {};
- this.requestParam.parammaps.id = row.id;
- PostDataByName(this.requestParam).then((response) => {
- if (response.msg === "fail") {
- this.$notify({
- title: "删除失败",
- message: response.data,
- type: "warning",
- duration: 2000,
- });
- } else {
- this.$notify({
- title: "成功",
- message: "删除成功",
- type: "success",
- duration: 2000,
- });
- this.get_table_data();
- }
- });
- })
- .catch(() => {
- this.$message({ type: "info", message: "已取消删除" });
- });
- },
- // 导出
- form_export(item) {
- this.download.getdataListParm.parammaps =
- this.tableObj.getdataListParm.parammaps;
- GetDataByName(this.download.getdataListParm).then((response) => {
- if (response.data.list !== null) {
- this.download.list = response.data.list;
- } else {
- this.download.list = [];
- }
- var excelDatas = [
- {
- tHeader: [
- "序号",
- "客户名称",
- "客户集团",
- "接收日期",
- "寄件人",
- "寄件电话",
- "寄件单号",
- "快递寄出原因",
- "处理方式",
- "备注",
- "录入日期",
- ],
- filterVal: [
- "sort",
- "customerName",
- "groupName",
- "pdate",
- "posterName",
- "posterTel",
- "postCode",
- "reason",
- "handletypeName",
- "remark",
- "created",
- ],
- tableDatas: this.download.list,
- sheetName: "Sheet1",
- },
- ];
- json2excel(excelDatas, "快递接收", true, "xlsx");
- });
- },
- // 导入
- form_inport() {
- console.log("点击了导入");
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .search {
- padding-top: 10px;
- clear: both;
- }
- .table {
- margin-top: 10px;
- }
- /deep/ .el-input.is-disabled .el-input__inner {
- color: #000000 !important;
- }
- /deep/ .el-textarea.is-disabled .el-textarea__inner {
- color: #000000 !important;
- }
- /deep/ .el-radio__input.is-disabled + span.el-radio__label {
- color: #000000 !important;
- }
- /deep/ .el-checkbox__input.is-disabled + span.el-checkbox__label {
- color: #000000 !important;
- }
- </style>
|