Commit 6b51586c by wangzhihui

```

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

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