jinhui.wang

特殊规格页面增加,航班输入长度限制增加

...@@ -60,7 +60,7 @@ export function downloadExcel(data) { ...@@ -60,7 +60,7 @@ export function downloadExcel(data) {
60 }) 60 })
61 } 61 }
62 62
63 -//释放 63 +//释放
64 export function releaseCargo(data) { 64 export function releaseCargo(data) {
65 return request({ 65 return request({
66 url: '/cargo/releaseCargo', 66 url: '/cargo/releaseCargo',
......
1 +import request from '@/utils/request'
2 +
3 +//特殊规则查询
4 +/**
5 + * @param page * 页数
6 + * @param size * 页长
7 + * @param shipperAccount shipperAccount集合
8 + */
9 +export function queryShipperAccountRule(data) {
10 + return request({
11 + url: 'shipperAccount/queryShipperAccountRule',
12 + method: 'post',
13 + data: data
14 + })
15 +}
16 +
17 +//特殊规则新增
18 +/**
19 + * @param id ID (修改必填)
20 + * @param shipperAccount * shipperAccount
21 + * @param flightNo * 航班号
22 + * @param flightRoute * 航线
23 + * @param flightDate * 航班日期
24 + * @param groupAllWeight 预配重量
25 + * @param includeUrsa * ursa包含
26 + * @param notIncludeUrsa ursa不包含
27 + * @param classificationList 申报类型
28 + * @param serviceCodeList servceCode
29 + */
30 +export function saveOrUpdate(data) {
31 + return request({
32 + url: 'shipperAccount/saveOrUpdate',
33 + method: 'post',
34 + data: data
35 + })
36 +}
37 +
38 +//特殊规则详情
39 +/**
40 + * @param id * ID
41 + */
42 +export function queryShipperAccountRuleById(data) {
43 + return request({
44 + url: 'shipperAccount/queryShipperAccountRuleById',
45 + method: 'post',
46 + data: data
47 + })
48 +}
49 +
50 +//特殊规则删除
51 +/**
52 + * @param accsFlightNo * 航班号
53 + * @param shipperAccount * shipperAccount
54 + * @param status * 状态 0 停用 1启用 2 已删除
55 + */
56 +export function changeStatusById(data) {
57 + return request({
58 + url: '/shipperAccount/changeStatusById',
59 + method: 'post',
60 + data: data
61 + })
62 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -539,6 +539,18 @@ let tableHeaders = { ...@@ -539,6 +539,18 @@ let tableHeaders = {
539 status: 1 539 status: 1
540 }, 540 },
541 { 541 {
542 + columnChineseName: "预留特殊舱位重量",
543 + columnName: "accountTotalWeight",
544 + columnWidth: "130",
545 + status: 1
546 + },
547 + {
548 + columnChineseName: "特殊舱位已配重量",
549 + columnName: "accountAllocatedWeight",
550 + columnWidth: "130",
551 + status: 1
552 + },
553 + {
542 columnChineseName: "已配体积(m³)", 554 columnChineseName: "已配体积(m³)",
543 columnName: "alloctedVolume", 555 columnName: "alloctedVolume",
544 columnWidth: "120", 556 columnWidth: "120",
...@@ -1493,87 +1505,64 @@ let tableHeaders = { ...@@ -1493,87 +1505,64 @@ let tableHeaders = {
1493 //特殊配舱规则 1505 //特殊配舱规则
1494 "superAllocation": [ 1506 "superAllocation": [
1495 { 1507 {
1496 - columnChineseName: "ShipperAccount", 1508 + columnChineseName: "发件人账号",
1497 columnName: "shipperAccount", 1509 columnName: "shipperAccount",
1498 columnWidth: "", 1510 columnWidth: "",
1499 ext1: "", 1511 ext1: "",
1500 status: 1 1512 status: 1
1501 }, 1513 },
1502 { 1514 {
1503 - columnChineseName: "原航班",
1504 - columnName: "accsFlightNo",
1505 - columnWidth: "150",
1506 - ext1: "",
1507 - status: 1
1508 - },
1509 - {
1510 - columnChineseName: "操作人",
1511 - columnName: "updateUserName",
1512 - columnWidth: "100",
1513 - ext1: "",
1514 - status: 1
1515 - },
1516 - {
1517 - columnChineseName: "操作时间",
1518 - columnName: "updateTime",
1519 - columnWidth: "200",
1520 - ext1: "",
1521 - status: 1
1522 - },
1523 - ],
1524 - "newSuperAllocation": [
1525 - {
1526 columnChineseName: "航班日期", 1515 columnChineseName: "航班日期",
1527 - columnName: "", 1516 + columnName: "flightDate",
1528 columnWidth: "", 1517 columnWidth: "",
1529 ext1: "", 1518 ext1: "",
1530 status: 1 1519 status: 1
1531 }, 1520 },
1532 { 1521 {
1533 columnChineseName: "航班号", 1522 columnChineseName: "航班号",
1534 - columnName: "", 1523 + columnName: "flightNo",
1535 columnWidth: "", 1524 columnWidth: "",
1536 ext1: "", 1525 ext1: "",
1537 status: 1 1526 status: 1
1538 }, 1527 },
1539 { 1528 {
1540 columnChineseName: "航线", 1529 columnChineseName: "航线",
1541 - columnName: "", 1530 + columnName: "flightRoute",
1542 columnWidth: "", 1531 columnWidth: "",
1543 ext1: "", 1532 ext1: "",
1544 status: 1 1533 status: 1
1545 }, 1534 },
1546 { 1535 {
1547 columnChineseName: "URSA", 1536 columnChineseName: "URSA",
1548 - columnName: "", 1537 + columnName: "includeUrsa",
1549 columnWidth: "", 1538 columnWidth: "",
1550 ext1: "", 1539 ext1: "",
1551 status: 1 1540 status: 1
1552 }, 1541 },
1553 { 1542 {
1554 columnChineseName: "申报类型", 1543 columnChineseName: "申报类型",
1555 - columnName: "", 1544 + columnName: "classification",
1556 columnWidth: "", 1545 columnWidth: "",
1557 ext1: "", 1546 ext1: "",
1558 status: 1 1547 status: 1
1559 }, 1548 },
1560 { 1549 {
1561 columnChineseName: "服务类型", 1550 columnChineseName: "服务类型",
1562 - columnName: "", 1551 + columnName: "serviceCode",
1563 columnWidth: "", 1552 columnWidth: "",
1564 ext1: "", 1553 ext1: "",
1565 status: 1 1554 status: 1
1566 }, 1555 },
1567 { 1556 {
1568 - columnChineseName: "预留位", 1557 + columnChineseName: "预留位",
1569 - columnName: "", 1558 + columnName: "groupAllWeight",
1570 columnWidth: "", 1559 columnWidth: "",
1571 ext1: "", 1560 ext1: "",
1572 status: 1 1561 status: 1
1573 }, 1562 },
1574 { 1563 {
1575 - columnChineseName: "已配位", 1564 + columnChineseName: "已配位",
1576 - columnName: "", 1565 + columnName: "accountAllocatedWeight",
1577 columnWidth: "", 1566 columnWidth: "",
1578 ext1: "", 1567 ext1: "",
1579 status: 1 1568 status: 1
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 <el-form ref="form" class="form-header" label-position="right" label-width="auto" 14 <el-form ref="form" class="form-header" label-position="right" label-width="auto"
15 style="width: 400px; margin: 30px auto" :model="formData" :rules="rules"> 15 style="width: 400px; margin: 30px auto" :model="formData" :rules="rules">
16 <el-form-item label="航班号" prop="fltNo"> 16 <el-form-item label="航班号" prop="fltNo">
17 - <el-input class="formItem" v-model="fltNo" size="medium" placeholder="请输入航班号" maxlength="10" 17 + <el-input class="formItem" v-model="fltNo" size="medium" placeholder="请输入航班号" maxlength="50"
18 style="width: 350px" @change="dateChange"></el-input> 18 style="width: 350px" @change="dateChange"></el-input>
19 </el-form-item> 19 </el-form-item>
20 <el-form-item label="航班日期:" prop="fltDate"> 20 <el-form-item label="航班日期:" prop="fltDate">
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
81 <el-row> 81 <el-row>
82 <el-col :span="8"> 82 <el-col :span="8">
83 <el-form-item label="原航班" prop="sourceFlightNo"> 83 <el-form-item label="原航班" prop="sourceFlightNo">
84 - <el-input v-model="form.sourceFlightNo" placeholder="请输入原航班号" maxlength="10" /> 84 + <el-input v-model="form.sourceFlightNo" placeholder="请输入原航班号" maxlength="50" />
85 </el-form-item> 85 </el-form-item>
86 </el-col> 86 </el-col>
87 <el-col :span="8"> 87 <el-col :span="8">
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
89 <el-col :span="12"> 89 <el-col :span="12">
90 <el-form-item label="航班号" prop="fltNo"> 90 <el-form-item label="航班号" prop="fltNo">
91 <el-input class="wid80" @blur="blurfltNo" :disabled="formdisabled.fltNo" v-model="form.fltNo" 91 <el-input class="wid80" @blur="blurfltNo" :disabled="formdisabled.fltNo" v-model="form.fltNo"
92 - placeholder="请输入航班号" maxlength="10" /> 92 + placeholder="请输入航班号" maxlength="50" />
93 </el-form-item> 93 </el-form-item>
94 </el-col> 94 </el-col>
95 <el-col :span="12"> 95 <el-col :span="12">
......
...@@ -509,7 +509,7 @@ export default { ...@@ -509,7 +509,7 @@ export default {
509 this.$refs.newTables.clearTable(); 509 this.$refs.newTables.clearTable();
510 this.cargoTotal(); 510 this.cargoTotal();
511 }, 511 },
512 - //释放 512 + //释放
513 release() { 513 release() {
514 let idList = [] 514 let idList = []
515 this.selectTable.map(item => { 515 this.selectTable.map(item => {
...@@ -532,7 +532,7 @@ export default { ...@@ -532,7 +532,7 @@ export default {
532 val === item.id ? item.msg = item.msg + '正在释放中,请勿重复释放。' : '' 532 val === item.id ? item.msg = item.msg + '正在释放中,请勿重复释放。' : ''
533 }) 533 })
534 res.data['noFlight'].map(val => { 534 res.data['noFlight'].map(val => {
535 - val === item.id ? item.msg = item.msg + '已释放位。' : '' 535 + val === item.id ? item.msg = item.msg + '已释放位。' : ''
536 }) 536 })
537 res.data['pushFalse'].map(val => { 537 res.data['pushFalse'].map(val => {
538 val === item.id ? item.msg = item.msg + '该货物配舱结果已回推ACCS,不能释放。' : '' 538 val === item.id ? item.msg = item.msg + '该货物配舱结果已回推ACCS,不能释放。' : ''
......
1 +<template>
2 + <div>
3 + <el-dialog :title="title" :visible.sync="dialogVisible" width="60%" top="8vh" :before-close="close"
4 + append-to-body :close-on-click-modal="false" @submit.native.prevent>
5 + <el-form class="form-header" ref="superAllocationForm" :model="formData" label-width="auto"
6 + label-position="left" style="margin-bottom:10px" @submit.native.prevent size="small" :rules="rules">
7 + <el-row>
8 + <el-col :span="22">
9 + <el-form-item label="发件人账号" prop="shipperAccount">
10 + <el-input type="textarea" v-model="formData.shipperAccount" placeholder="请输入发件人账号,多个以“;”分割"
11 + maxlength="50" rows="4" :disabled="disabled" />
12 + </el-form-item>
13 + </el-col>
14 + <el-col :span="12">
15 + <el-form-item label="航班号" prop="flightNo">
16 + <el-input class="formItem" ref="flightNoFormItem" v-focus v-model="formData.flightNo"
17 + placeholder="请输入航班号" @change="getRoute" :disabled="disabled">
18 + </el-input>
19 + </el-form-item>
20 + </el-col>
21 + <el-col :span="12">
22 + <el-form-item label="航班日期" prop="flightDate">
23 + <el-date-picker class="formItem" v-model="formData.flightDate" type="date"
24 + placeholder="选择日期" value-format="yyyy-MM-dd" @change="getRoute" :disabled="disabled">
25 + </el-date-picker>
26 + </el-form-item>
27 + </el-col>
28 + </el-row>
29 + <el-row>
30 + <el-col :span="12">
31 + <el-form-item label="航线" prop="flightRoute">
32 + <el-select class="formItem" v-model="formData.flightRoute" placeholder="未设置"
33 + :disabled="routeList.length == 0 || disabled" @change="routeChange">
34 + <el-option v-for="(item, index) in routeList" :label="item.route" :value="item.route"
35 + :key="item.id">
36 + <Tooltips :content="item.route" :refName="item.route"></Tooltips>
37 + </el-option>
38 + </el-select>
39 + </el-form-item>
40 + </el-col>
41 + <el-col :span="12">
42 + <el-form-item label="预留舱位(KG)" prop="groupAllWeight">
43 + <el-input class="formItem" v-model="formData.groupAllWeight" placeholder="请输入预留舱位"
44 + oninput="value=value.replace(/[^\d\.\-]/g,'')">
45 + </el-input>
46 + </el-form-item>
47 + </el-col>
48 + </el-row>
49 + <el-row>
50 + <el-col :span="12">
51 + <el-form-item label="URSA包含" prop="includeUrsa">
52 + <el-input class="formItem" v-model="formData.includeUrsa"
53 + placeholder="URSA之间用分号分隔,例:F2;F3;P_" type="textarea" rows="3" maxlength="100">
54 + </el-input>
55 + </el-form-item>
56 + </el-col>
57 + <el-col :span="12">
58 + <el-form-item label="URSA不包含" prop="notIncludeUrsa">
59 + <el-input class="formItem" v-model="formData.notIncludeUrsa"
60 + placeholder="URSA之间用分号分隔,例:F2;F3;P_" type="textarea" rows="3" maxlength="100">
61 + </el-input>
62 + </el-form-item>
63 + </el-col>
64 + </el-row>
65 + <el-row>
66 + <el-col :span="24">
67 + <el-form-item label="申报类别" prop="classificationList">
68 + <el-card shadow="never" style="width: 95%">
69 + <el-checkbox-group v-model="formData.classificationList">
70 + <el-row>
71 + <el-col v-for="item in checkBoxItem.cargoType" :span="2" :key="item.id">
72 + <el-checkbox v-if="item.status === 1" :label="item.chineseName"
73 + :name="item.chineseName" :key="item.code">
74 + <Tooltips :content="item.chineseName" :refName="item.chineseName">
75 + </Tooltips>
76 + </el-checkbox>
77 + </el-col>
78 + </el-row>
79 + </el-checkbox-group>
80 + </el-card>
81 + </el-form-item>
82 + </el-col>
83 + </el-row>
84 + <el-row>
85 + <el-col :span="24">
86 + <el-form-item label="Service Code" prop="serviceCodeList">
87 + <el-card shadow="never" style="width: 95%">
88 + <el-checkbox-group v-model="formData.serviceCodeList">
89 + <el-row>
90 + <el-col v-for="item in checkBoxItem.serviceCode" :span="2" :key="item.id">
91 + <el-checkbox
92 + v-if="item.status === 1 || checkBoxItem.serviceCode.includes(item.chineseName)"
93 + :label="item.chineseName" :name="item.chineseName"
94 + :disabled="checkBoxItem.serviceCode.includes(item.chineseName) && item.status == 0"
95 + :key="item.code">
96 + <Tooltips :content="item.chineseName" :refName="item.chineseName">
97 + </Tooltips>
98 + </el-checkbox>
99 + </el-col>
100 + </el-row>
101 + </el-checkbox-group>
102 + </el-card>
103 + </el-form-item>
104 + </el-col>
105 + </el-row>
106 + </el-form>
107 + <span slot="footer" class="dialog-footer">
108 + <el-button type="primary" :loading="loading" @click="submit">确 定</el-button>
109 + <el-button @click="close">取 消</el-button>
110 + </span>
111 + </el-dialog>
112 + </div>
113 +</template>
114 +
115 +<script>
116 +import { findFlightRoute } from "@/api/cargoSelect";
117 +import { allDictData } from "@/api/destinationFlight";
118 +import { saveOrUpdate } from "@/api/supserAllocation"
119 +
120 +export default {
121 + name: '',
122 + props: {
123 + dialogVisible: {
124 + type: Boolean,
125 + default: false
126 + },
127 + ruleData: {
128 + type: Object,
129 + default: null
130 + },
131 + status: {
132 + type: String,
133 + default: ''
134 + }
135 + },
136 + data() {
137 + return {
138 + formData: {
139 + flightNo: '',
140 + flightDate: '',
141 + flightRoute: null,
142 + classificationList: [],
143 + serviceCodeList: []
144 + },
145 + routeList: [],
146 + checkBoxItem: {
147 + cargoType: [],
148 + serviceCode: []
149 + },
150 + rules: {
151 + shipperAccount: [
152 + {
153 + required: true,
154 + message: "发件人账号不能为空",
155 + trigger: "blur",
156 + },
157 + ],
158 + flightDate: [
159 + {
160 + required: true,
161 + message: "航班日期不能为空",
162 + trigger: "blur",
163 + },
164 + ],
165 + flightNo: [
166 + {
167 + required: true,
168 + message: "航班号不能为空",
169 + trigger: "blur",
170 + },
171 + ],
172 + flightRoute: [
173 + {
174 + required: true,
175 + message: "航线不能为空",
176 + trigger: "change",
177 + },
178 + ],
179 + groupAllWeight: [
180 + {
181 + required: true,
182 + message: "预留舱位不能为空",
183 + trigger: "blur",
184 + },
185 + ],
186 + includeUrsa: [
187 + {
188 + required: true,
189 + message: "URSA不能为空",
190 + trigger: "blur",
191 + },
192 + ],
193 + },
194 + title: '',
195 + loading: false,
196 + disabled: false
197 + }
198 + },
199 + created() {
200 + this.getCheckData()
201 + },
202 + watch: {
203 + dialogVisible(val) {
204 + if (val) {
205 + if (this.status == 'add') {
206 + this.title = '新增'
207 + this.$nextTick(() => {
208 + this.$refs["superAllocationForm"].clearValidate();
209 + })
210 + } else if (this.status == 'update') {
211 + this.title = '修改'
212 + this.formData = this.ruleData
213 + this.disabled = true
214 + this.getRoute(1)
215 + } else if (this.status == 'copy') {
216 + this.title = '复制'
217 + this.formData = this.ruleData
218 + this.getRoute(1)
219 + }
220 + }
221 + }
222 + },
223 + methods: {
224 + //获取复选框数据
225 + getCheckData() {
226 + allDictData().then(res => {
227 + if (res.code === 200) {
228 + this.checkBoxItem.cargoType = res.data.cargoType
229 + this.checkBoxItem.serviceCode = res.data.serviceCode
230 + } else {
231 + this.msgWarning(res.msg)
232 + }
233 + }).catch(err => {
234 + console.log(err)
235 + })
236 + },
237 + //获取航线
238 + getRoute(val) {
239 + this.routeList = []
240 + if (val != 1) {
241 + this.formData.flightRoute = null
242 + }
243 + this.formData.flightNo = this.formData.flightNo.toUpperCase()
244 + let obj = {
245 + fltNo: this.formData.flightNo,
246 + fltDate: this.formData.flightDate
247 + }
248 + findFlightRoute(obj).then(res => {
249 + if (res.code === 200) {
250 + this.routeList = res.data
251 + } else {
252 + this.msgWarning(res.msg)
253 + }
254 + }).catch(err => {
255 + console.log(err)
256 + })
257 + },
258 + //提交
259 + submit() {
260 + this.$refs["superAllocationForm"].validate((valid) => {
261 + if (valid) {
262 + this.loading = true
263 + this.formData.shipperAccount = this.formData.shipperAccount.replace(/;/g, ";")
264 + this.formData.includeUrsa = this.formData.includeUrsa.replace(/;/g, ";")
265 + if (this.formData.notIncludeUrsa && this.formData.notIncludeUrsa != null && this.formData.notIncludeUrsa != '') {
266 + this.formData.notIncludeUrsa = this.formData.notIncludeUrsa.replace(/;/g, ";")
267 + }
268 + saveOrUpdate(this.formData).then(res => {
269 + this.loading = false
270 + if (res.code === 200) {
271 + this.msgSuccess('操作成功!')
272 + this.close()
273 + } else {
274 + this.msgWarning(res.msg)
275 + }
276 + }).catch(err => {
277 + this.loading = false
278 + console.log(err)
279 + })
280 + }
281 + })
282 + },
283 + routeChange() {
284 + this.$forceUpdate()
285 + },
286 + close() {
287 + this.formData = {
288 + flightNo: '',
289 + flightDate: '',
290 + classificationList: [],
291 + serviceCodeList: []
292 + }
293 + this.$refs["superAllocationForm"].clearValidate();
294 + this.routeList = []
295 + this.disabled = false
296 + this.$emit('close')
297 + }
298 + }
299 +}
300 +</script>
301 +
302 +<style lang="scss" scoped>
303 +
304 +</style>
...\ No newline at end of file ...\ No newline at end of file
1 +<template>
2 + <div style="padding:20px 0">
3 + <el-form class="form-header" ref="dictForm" label-width="auto" label-position="left" style="margin-bottom:10px"
4 + @submit.native.prevent size="small">
5 + <el-row>
6 + <el-col :span="6">
7 + <el-form-item label="发件人账号">
8 + <el-input type="textarea" v-model="selectionData.shipperAccount" placeholder="请输入发件人账号,多个以“;”分割"
9 + maxlength="50" rows="4" />
10 + </el-form-item>
11 + </el-col>
12 + </el-row>
13 + </el-form>
14 + <div style="margin-left:20px;margin-bottom:10px">
15 + <el-button icon="el-icon-search" type="primary" size="small" @click="selection(1)">查 询
16 + </el-button>
17 + <el-button icon="el-icon-plus" type="primary" size="small" @click="add">添 加
18 + </el-button>
19 + </div>
20 + <Tables ref="supserAllocation" ductName="supserAllocation" :data="tableData" :headerData="tableHeader"
21 + :selection="false" :order="true" :selectFixed="false" :pagination="true" :totalCount="totalCount"
22 + :loading="loading" :limitSize="selectionData.size" :page="selectionData.page"
23 + layout="total,prev, pager, next, jumper, ->" :pageSizes="[100]" :height="tableHeight"
24 + @currentChange="currentChange">
25 + <template slot="optionColumn">
26 + <el-table-column label="操作" width="250" align="center">
27 + <template slot-scope="scope">
28 + <el-button size="mini" type="text" icon="el-icon-edit" @click="update(scope.row,'update')">修改
29 + </el-button>
30 + <el-button type="text" v-if="scope.row.status === 1" size="mini" icon="el-icon-video-pause"
31 + @click="changeStatus(scope.row)">
32 + 停 用</el-button>
33 + <el-button type="text" v-if="scope.row.status === 0" size="mini" icon="el-icon-video-pause"
34 + @click="changeStatus(scope.row)">
35 + 启 用</el-button>
36 + <el-button type="text" icon="el-icon-document-copy" size="mini"
37 + @click="update(scope.row,'copy')">复 制
38 + </el-button>
39 + <el-button size="mini" type="text" icon="el-icon-delete" style="color:#ff4949"
40 + @click="del(scope.row)">删除</el-button>
41 + </template>
42 + </el-table-column>
43 + </template>
44 + </Tables>
45 + <Dialog :dialogVisible="dialogVisible" :ruleData="ruleData" :status="dialogStatus" @close="close" />
46 + </div>
47 +</template>
48 +
49 +<script>
50 +import { queryShipperAccountRule, changeStatusById, queryShipperAccountRuleById } from "@/api/supserAllocation"
51 +import Dialog from './dialog.vue';
52 +
53 +export default {
54 + name: 'SuperAllocation',
55 + components: {
56 + Dialog
57 + },
58 + data() {
59 + return {
60 + selectionData: {
61 + shipperAccount: null,
62 + page: 1,
63 + size: 20,
64 + },
65 + tableData: [],
66 + tableHeader: this.tableHeaders['superAllocation'],
67 + ruleData: {
68 + classificationList: [],
69 + serviceCodeList: []
70 + },
71 + dialogStatus: 'add',
72 + tableHeight: null,
73 + totalCount: 0,
74 + dialogVisible: false,
75 + loading: false,
76 + }
77 + },
78 + created() {
79 + },
80 + mounted() {
81 + this.tableHeight = window.innerHeight - this.$refs.supserAllocation.$el.offsetHeight - 250
82 + this.selection(1)
83 + },
84 + methods: {
85 + //查询
86 + selection(val) {
87 + this.tableData = []
88 + this.loading = true
89 + if (val === 1) {
90 + this.selectionData.page = 1
91 + }
92 + queryShipperAccountRule(this.selectionData).then(res => {
93 + this.loading = false
94 + if (res.code === 200) {
95 + this.tableData = res.data.list
96 + this.totalCount = res.data.total
97 + } else {
98 + this.msgWarning(res.msg)
99 + }
100 + }).catch(err => {
101 + this.loading = false
102 + console.log(err)
103 + })
104 + },
105 + //新增
106 + add() {
107 + this.dialogStatus = 'add'
108 + this.dialogVisible = true
109 + },
110 + //修改
111 + update(val, status) {
112 + this.dialogStatus = status
113 + queryShipperAccountRuleById({ id: val.id }).then(res => {
114 + if (res.code === 200) {
115 + this.ruleData = res.data
116 + if (this.ruleData.classificationList == null || this.ruleData.classificationList.length < 1) {
117 + this.ruleData.classificationList = []
118 + }
119 + if (this.ruleData.serviceCodeList == null || this.ruleData.serviceCodeList.length < 1) {
120 + this.ruleData.serviceCodeList = []
121 + }
122 + if (status == 'copy') {
123 + this.ruleData.id = undefined
124 + }
125 + this.dialogVisible = true
126 + } else {
127 + this.msgWarning(res.msg)
128 + }
129 + }).catch(err => {
130 + console.log(err)
131 + })
132 + },
133 + //删除
134 + del(val) {
135 + this.$confirm("是否要删除记录!", "注意!", {
136 + confirmButtonText: "确定",
137 + cancelButtonText: '取消',
138 + type: "warning",
139 + }).then(() => {
140 + changeStatusById({ id: val.id, status: 2 }).then(res => {
141 + if (res.code === 200) {
142 + this.msgSuccess('删除成功!')
143 + this.selection(1)
144 + } else {
145 + this.msgWarning(res.msg)
146 + }
147 + }).catch(err => {
148 + console.log(err)
149 + })
150 + }).catch(() => { })
151 + },
152 + //停用启用
153 + changeStatus(val) {
154 + let status = 0
155 + let tip = ''
156 + if (val.status == 0) {
157 + status = 1
158 + tip = '启用'
159 + } else if (val.status == 1) {
160 + status = 0
161 + tip = '停用'
162 + }
163 + this.$confirm(`是否要${tip}记录!`, "注意!", {
164 + confirmButtonText: "确定",
165 + cancelButtonText: '取消',
166 + type: "warning",
167 + }).then(() => {
168 + changeStatusById({ id: val.id, status: status }).then(res => {
169 + if (res.code === 200) {
170 + this.msgSuccess(tip + '成功!')
171 + this.selection(1)
172 + } else {
173 + this.msgWarning(res.msg)
174 + }
175 + }).catch(err => {
176 + console.log(err)
177 + })
178 + }).catch(() => { })
179 + },
180 + //复制
181 + copy(val) {
182 + this.dialogStatus = 'copy'
183 + this.ruleData = JSON.parse(JSON.stringify(val))
184 + this.ruleData.id = undefined
185 + this.dialogVisible = true
186 + },
187 + //关闭
188 + close() {
189 + this.dialogVisible = false
190 + this.ruleData = {}
191 + this.selection(1)
192 + },
193 + //翻页
194 + currentChange(val) {
195 + this.selectionData.page = val.page
196 + this.selection()
197 + },
198 + }
199 +}
200 +
201 +</script>
202 +
203 +<style lang="scss" scoped>
204 +
205 +</style>
...\ No newline at end of file ...\ No newline at end of file