Commit 6b51586c by wangzhihui

```

refactor(DeliverList): 优化代码格式和条件判断逻辑

- 移除多余的换行和空格,统一代码格式
- 修复scanEnable变量初始化时的空格问题
- 更新入库和下载凭证的条件判断逻辑
- 优化API调用中的代码结构
- 统一引号使用规范
```
1 parent 48b94a14
......@@ -2,8 +2,7 @@
<template>
<div class="purchase">
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<h2>发货单列表</h2>
<div>
......@@ -12,20 +11,16 @@
</div>
<!-- 表格区域 开始 -->
<GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm"
:tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="uploadFileUrl" slot-scope="scope">
<div v-if="scope.scope.uploadFileUrl">
<el-image :src="scope.scope.uploadFileUrl.split(',')[0]" fit="fill"
:preview-src-list="scope.scope.uploadFileUrl.split(',')" style="width: 36px; height: 36px;"></el-image>
<el-image :src="scope.scope.uploadFileUrl.split(',')[0]" fit="fill" :preview-src-list="scope.scope.uploadFileUrl.split(',')" style="width: 36px; height: 36px;"></el-image>
</div>
<div v-else>--</div>
</template>
<template slot="putStatus" slot-scope="scope">
<div>
<span
:class="[scope.scope.putStatus == 1 ? 'ashSpot' : scope.scope.putStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
<span :class="[scope.scope.putStatus == 1 ? 'ashSpot' : scope.scope.putStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
<span>{{ scope.scope.putStatus | puStatus }}</span>
</div>
</template>
......@@ -33,8 +28,7 @@
<!-- <div>{{ JSON.stringify(scope.scope.suitCarTypeList) }}</div> -->
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top">
<div slot="content" style="max-height: 200px; overflow-y: scroll;">
<div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{
`${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}` }}</div>
<div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{ `${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}` }}</div>
</div>
<div>{{ scope.scope.suitCarTypeList | formatCar }}</div>
</el-tooltip>
......@@ -48,8 +42,7 @@
</div>
<deliver-add v-if="addVisible" :visible.sync="addVisible" :id="id" @handleSuccess="handleSearch"></deliver-add>
<deliver-detail :visible.sync="detailVisible" :id="id"></deliver-detail>
<sign-dialog v-if="signVisible" :visible.sync="signVisible" :info="signInfo" @handleClose="signVisibleChange"
@handleConfirm="handleSignConfirm"></sign-dialog>
<sign-dialog v-if="signVisible" :visible.sync="signVisible" :info="signInfo" @handleClose="signVisibleChange" @handleConfirm="handleSignConfirm"></sign-dialog>
</div>
</template>
......@@ -82,7 +75,7 @@ export default {
},
data() {
return {
scanEnable:0,
scanEnable: 0,
size: 'small',
url: url,
searchForm: {
......@@ -207,7 +200,7 @@ export default {
fn: '入库'
},
condition: row => {
return this.scanEnable ==0&&(row.putStatus == 1 || row.putStatus == 3)
return this.scanEnable == 0 && (row.putStatus == 1 || row.putStatus == 3)
},
listeners: {
click: this.handleWarehousing
......@@ -236,7 +229,7 @@ export default {
fn: '下载凭证'
},
condition: row => {
return this.scanEnable ==1
return this.scanEnable == 1 && row.putStatus == 1
},
listeners: {
......@@ -407,9 +400,9 @@ export default {
methods: {
queryScanConfigByYq() {
this.$apis.delivery.queryScanConfigByYq({ merchantId: this.$globalState?.session?.merchantId }).then(res => {
if(res.code == 0){
this.scanEnable = res.data.scanEnable
}
if (res.code == 0) {
this.scanEnable = res.data.scanEnable
}
})
},
handleDownload(row) {
......@@ -420,17 +413,16 @@ export default {
this.$apis.delivery.downloadLabelCode(params).then(res => {
if (res.code == 0) {
const downloadUrl = res.data
const link = document.createElement("a");
link.style.display = "none";
link.href = downloadUrl;
link.download = '';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
const link = document.createElement('a')
link.style.display = 'none'
link.href = downloadUrl
link.download = ''
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} else {
this.$message.error(res.message)
}
})
},
getTypeList() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!