|
|
|
@ -215,7 +215,7 @@
|
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="提货费用" prop="pickUpPlate"> |
|
|
|
|
<el-form-item label="提货费用" prop="totalFee"> |
|
|
|
|
<el-input-number |
|
|
|
|
class="w100" |
|
|
|
|
controls-position="right" |
|
|
|
@ -241,6 +241,42 @@
|
|
|
|
|
<span>运单池</span> |
|
|
|
|
</el-divider> |
|
|
|
|
|
|
|
|
|
<div v-h5uShow="!details.search"> |
|
|
|
|
<!-- 查询模块 --> |
|
|
|
|
<el-form :inline="true" ref="oldFormNode" :model="details.query" class="header_search"> |
|
|
|
|
<el-form-item label="开始时间:" class="el-times" prop="stockupDate"> |
|
|
|
|
<!-- <el-input v-model="query.stockupArea" placeholder="请输入备货区"></el-input>--> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="details.query.stockupDate" |
|
|
|
|
type="daterange" |
|
|
|
|
unlink-panels |
|
|
|
|
range-separator="至" |
|
|
|
|
start-placeholder="开始时间" |
|
|
|
|
end-placeholder="结束时间" |
|
|
|
|
:shortcuts="details.shortcuts" |
|
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
|
clearable |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- 查询按钮 --> |
|
|
|
|
<el-form-item class="el-btn"> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleOldSearch" |
|
|
|
|
>搜 索</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
@click=" |
|
|
|
|
() => { |
|
|
|
|
oldFormNode.resetFields(); |
|
|
|
|
handleOldSearch(); |
|
|
|
|
} |
|
|
|
|
" |
|
|
|
|
>清 空</el-button |
|
|
|
|
> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 控件 --> |
|
|
|
|
<div class="flex-c-sb"> |
|
|
|
|
<div class="avue-crud__right"> |
|
|
|
@ -312,10 +348,10 @@
|
|
|
|
|
<!-- 表格 --> |
|
|
|
|
<tablecmt |
|
|
|
|
class="tableNode mt10" |
|
|
|
|
:columnList="details.columnNewList" |
|
|
|
|
:tableData="details.addInfo.newData" |
|
|
|
|
:columnList="details.newColumnNewList" |
|
|
|
|
:tableData="details.addInfo.newRenderData" |
|
|
|
|
:loading="details.loadingObj.newlistLoading" |
|
|
|
|
@inputTxt="inputsc" |
|
|
|
|
@inputTxt="newInputsc" |
|
|
|
|
@timeCheck="timesc" |
|
|
|
|
@selectCheck="selectsc" |
|
|
|
|
@selection="list => selectionChange(list, 2)" |
|
|
|
@ -358,12 +394,6 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { |
|
|
|
|
remove, |
|
|
|
|
getListOwn, |
|
|
|
|
getListOwnNUm, |
|
|
|
|
getBillLadingExport, |
|
|
|
|
} from '@/api/distribution/distrilbutionBillLading'; |
|
|
|
|
// 引入页面请求 |
|
|
|
|
import { |
|
|
|
|
postPageList, |
|
|
|
@ -394,9 +424,11 @@ import dayjs from 'dayjs';
|
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
|
import type { FormInstance, FormRules } from 'element-plus'; |
|
|
|
|
import { downloadXls, setNodeHeight, debounce } from '@/utils/util'; |
|
|
|
|
import { computed, ref, reactive, onMounted, nextTick } from 'vue'; |
|
|
|
|
import func from '@/utils/func'; |
|
|
|
|
import { computed, ref, reactive, onMounted, nextTick, watch } from 'vue'; |
|
|
|
|
import { useRoute, useRouter } from 'vue-router'; |
|
|
|
|
import { useStore } from 'vuex'; |
|
|
|
|
import { deepClone } from 'avue-plugin-ueditor/packages/ueditor/src/upload/util'; |
|
|
|
|
|
|
|
|
|
// 实例化router |
|
|
|
|
const $router = useRouter(); |
|
|
|
@ -407,9 +439,12 @@ const $store = useStore();
|
|
|
|
|
|
|
|
|
|
// 表单实例 |
|
|
|
|
const ruleFormRef = ref<FormInstance>(); |
|
|
|
|
const oldFormNode = ref<FormInstance>(); |
|
|
|
|
const newFormNode = ref<FormInstance>(); |
|
|
|
|
|
|
|
|
|
const details = reactive({ |
|
|
|
|
columnNewList, |
|
|
|
|
newColumnNewList: deepClone(columnNewList), |
|
|
|
|
/** 列表配置抽屉 */ |
|
|
|
|
drawerShow: false, |
|
|
|
|
// 弹框标题 |
|
|
|
@ -476,6 +511,10 @@ const details = reactive({
|
|
|
|
|
oldData: [], |
|
|
|
|
/** 已选择数据 */ |
|
|
|
|
newData: [], |
|
|
|
|
/** 已选择渲染数据 */ |
|
|
|
|
newRenderData: [], |
|
|
|
|
/** 调度池查询信息 */ |
|
|
|
|
newQuery: {}, |
|
|
|
|
/** 未选择 -- 复选框 */ |
|
|
|
|
oldSelectionList: [], |
|
|
|
|
/** 已选择 -- 复选框 */ |
|
|
|
@ -537,6 +576,8 @@ const details = reactive({
|
|
|
|
|
pageType: 'add', |
|
|
|
|
/** 提货Id */ |
|
|
|
|
billladingId: '', |
|
|
|
|
/** 页面id 新增为: 1, */ |
|
|
|
|
pageId: 0, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** 节点信息 */ |
|
|
|
@ -584,6 +625,7 @@ const onLoad = async (isRefresh = false) => {
|
|
|
|
|
...details.addInfo.oldPages, |
|
|
|
|
waybillNos: details.waybillNosList, |
|
|
|
|
id: details.billladingId, |
|
|
|
|
...details.query, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const { code, data } = res.data; |
|
|
|
@ -603,8 +645,8 @@ const onLoad = async (isRefresh = false) => {
|
|
|
|
|
const initPage = async () => { |
|
|
|
|
await initData(); |
|
|
|
|
|
|
|
|
|
console.log('$route :>> ', $route); |
|
|
|
|
const { type, id } = $route.query; |
|
|
|
|
|
|
|
|
|
details.pageType = type; |
|
|
|
|
details.billladingId = id; |
|
|
|
|
|
|
|
|
@ -629,12 +671,34 @@ const initPage = async () => {
|
|
|
|
|
|
|
|
|
|
delete details.form.waybillList; |
|
|
|
|
delete details.form.lineList; |
|
|
|
|
} else if (details.pageType === 'add') { |
|
|
|
|
details.addInfo.newData = []; |
|
|
|
|
details.waybillNosList = []; |
|
|
|
|
nextTick(() => { |
|
|
|
|
ruleFormRef.value.resetFields(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
initPage(); |
|
|
|
|
// initPage(); |
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
() => $route.fullPath, |
|
|
|
|
() => { |
|
|
|
|
const _id = $route.query.type === 'add' ? 1 : $route.query.id; |
|
|
|
|
console.log('$route :>> ', $route); |
|
|
|
|
if ( |
|
|
|
|
details.pageId === _id || |
|
|
|
|
$route.path !== '/distribution/inventory/addArteryDistrilbutionBillLadingList' |
|
|
|
|
) |
|
|
|
|
return; |
|
|
|
|
details.pageId = _id; |
|
|
|
|
initPage(); |
|
|
|
|
}, |
|
|
|
|
{ immediate: true } |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// 设置表格高度 |
|
|
|
|
const setTableHeight = async () => { |
|
|
|
@ -694,8 +758,38 @@ const timesc = (index, row) => {
|
|
|
|
|
const inputsc = (index, row) => { |
|
|
|
|
console.log(index, row); |
|
|
|
|
details.query[row.prop] = index; |
|
|
|
|
if (!index) delete details.query[row.prop]; |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
const newInputsc = (value, row) => { |
|
|
|
|
// newRenderData |
|
|
|
|
try { |
|
|
|
|
// 动态设置正则 |
|
|
|
|
const reg = new RegExp(value, 'i'); |
|
|
|
|
|
|
|
|
|
details.addInfo.newQuery[row.prop] = reg; |
|
|
|
|
|
|
|
|
|
if (value === '') delete details.addInfo.newQuery[row.prop]; |
|
|
|
|
|
|
|
|
|
if (Object.keys(details.addInfo.newQuery).length === 0) |
|
|
|
|
return (details.addInfo.newRenderData = details.addInfo.newData); |
|
|
|
|
|
|
|
|
|
const _data = details.addInfo.newData.filter(value => { |
|
|
|
|
let _flag = true; |
|
|
|
|
for (let key in details.addInfo.newQuery) { |
|
|
|
|
if (!details.addInfo.newQuery[key].test(value[key])) _flag = false; |
|
|
|
|
if (!_flag) break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return _flag; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
details.addInfo.newRenderData = _data; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
/** 是否显示搜索控件 */ |
|
|
|
|
const searchHide = () => { |
|
|
|
|
details.search = !details.search; |
|
|
|
@ -720,6 +814,7 @@ const handleRefresh = type => {
|
|
|
|
|
else { |
|
|
|
|
details.addInfo.newData = []; |
|
|
|
|
details.waybillNosList = []; |
|
|
|
|
newInputsc('', { prop: 'aaa' }); |
|
|
|
|
onLoad(true); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -762,10 +857,21 @@ const getTime = dat => {
|
|
|
|
|
return formattedDate.replace(/\//g, '-'); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 搜索 -- 运单池 */ |
|
|
|
|
const handleOldSearch = () => { |
|
|
|
|
if (details.query.stockupDate && details.query.stockupDate.length !== 0) { |
|
|
|
|
details.query.startDateStr = details.query.stockupDate[0]; |
|
|
|
|
details.query.endDateStr = details.query.stockupDate[1]; |
|
|
|
|
} else { |
|
|
|
|
delete details.query.startDateStr; |
|
|
|
|
delete details.query.endDateStr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onLoad(true); |
|
|
|
|
}; |
|
|
|
|
/** 搜索节点 */ |
|
|
|
|
const remoteMethod = val => |
|
|
|
|
debounce(async () => { |
|
|
|
|
console.log('11231 :>> ', 11231); |
|
|
|
|
details.loadingObj.nodeLoading = true; |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
@ -894,6 +1000,7 @@ const handleAddWaybill = () => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
details.addInfo.newData = [...details.addInfo.newData, ..._arr]; |
|
|
|
|
newInputsc('', { prop: 'aaa' }); |
|
|
|
|
|
|
|
|
|
// clearSelectionList(); |
|
|
|
|
onLoad(true); |
|
|
|
@ -913,7 +1020,7 @@ const handleRemoveWaybill = () => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
details.addInfo.newData = _copyNewData; |
|
|
|
|
|
|
|
|
|
newInputsc('', { prop: 'aaa' }); |
|
|
|
|
onLoad(true); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -1293,4 +1400,7 @@ const handleSubmit = async (formEl: FormInstance | undefined) => {
|
|
|
|
|
) { |
|
|
|
|
--el-color-danger: #f00; |
|
|
|
|
} |
|
|
|
|
.header_search > div { |
|
|
|
|
width: 50%; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|