马远东 1 year ago
parent
commit
b950592ae2
  1. 234
      src/views/distribution/signfor/distributionSignforedt.vue

234
src/views/distribution/signfor/distributionSignforedt.vue

@ -376,75 +376,26 @@
>
<template v-for="item in Tabs" :key="item.name">
<el-tab-pane :label="item.label" :name="item.name">
<div class="el-Cart">
<tablecmt
class="goodsTable"
:columnList="item.columnList"
:tableData="item.data"
:loading="false"
@inputTxt="(value, row) => inputsc(value, row, item.type)"
<template v-if="item.type === 'package'">
<el-tabs
tabPosition="left"
v-model="item.activeName"
class="demo-tabs"
@tab-change="handleChooseSigneState"
>
</tablecmt>
<el-tab-pane label="已签收" name="haveBeenSigned"></el-tab-pane>
<el-tab-pane label="未签收" name="unreceipted"></el-tab-pane>
</el-tabs>
</template>
<!-- 表格列开始 -->
<!-- <el-table
:data="data"
row-key="name"
border
height="500"
style="width: 100%"
ref="tableRef"
@select-all="qsselectAll"
@select="qsselectChange"
>
<el-table-column type="selection" width="55" fixed />
<el-table-column
type="index"
fixed
width="50"
height="100"
label="#"
align="center"
/> -->
<!--
Type ===1 普通文本
Type ===2 图片显示
Type ===3 操作功能
label: 标题
width: 宽度
prop: 数据字段
-->
<!-- <el-table-column
:prop="item.prop"
:label="item.label"
:width="item.width"
:fixed="item.fixed"
align="center"
v-for="(item, index) in menuData"
:key="item.label"
>
<template #default="props">
<img :src="props.row[item.prop]" class="el-Img" v-if="item.type === 2" />
<span v-else>{{
props.row[item.prop] != null ? props.row[item.prop] : '/'
}}</span>
</template>
</el-table-column>
<template>
<el-table-column
v-if="item.head"
fixed="right"
label="操作"
width="280"
align="center"
>
</el-table-column>
</template>
</el-table> -->
</div>
<tablecmt
class="goodsTable"
:columnList="item.columnList"
:tableData="item.renderData"
:loading="false"
@inputTxt="(value, row) => inputsc(value, row, item.type)"
>
</tablecmt>
</el-tab-pane>
</template>
</el-tabs>
@ -833,40 +784,40 @@ const menuData1 = ref([
{
prop: 'orderCode',
label: '订单自编号',
type: 1,
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
fixed: true,
sortable: true,
head: false,
},
{
prop: 'serviceNumber',
label: '服务号',
type: 1,
type: 2,
values: '',
width: '250',
checkarr: [],
fixed: false,
fixed: true,
sortable: true,
head: false,
},
{
prop: 'waybillNumber',
label: '运单号',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
fixed: true,
sortable: true,
head: false,
},
{
prop: 'warehouse',
label: '仓库',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -938,7 +889,7 @@ const menuData1 = ref([
{
prop: 'brand',
label: '品牌',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -949,7 +900,7 @@ const menuData1 = ref([
{
prop: 'mallName',
label: '商场名称',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -960,7 +911,7 @@ const menuData1 = ref([
{
prop: 'storeName',
label: '门店名称',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -972,7 +923,7 @@ const menuData1 = ref([
{
prop: 'descriptionGoods',
label: '货物名称',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -995,7 +946,7 @@ const menuData1 = ref([
{
prop: 'consigneeUnit',
label: '收获单位',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -1006,7 +957,7 @@ const menuData1 = ref([
{
prop: 'consigneePerson',
label: '运单收货人',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -1017,7 +968,7 @@ const menuData1 = ref([
{
prop: 'consigneeAddress',
label: '运单收货地址',
type: 1,
type: 2,
values: '',
width: '250',
checkarr: [],
@ -1028,7 +979,7 @@ const menuData1 = ref([
{
prop: 'consigneeMobile',
label: '运单收获电话',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -1039,7 +990,7 @@ const menuData1 = ref([
{
prop: 'customerName',
label: '终端收货人',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -1050,7 +1001,7 @@ const menuData1 = ref([
{
prop: 'customerAddress',
label: '终端收获地址',
type: 1,
type: 2,
values: '',
width: '400',
checkarr: [],
@ -1061,7 +1012,7 @@ const menuData1 = ref([
{
prop: 'customerTelephone',
label: '终端收获电话',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1240,7 +1191,7 @@ const menuData2 = ref([
{
prop: 'firsts',
label: '一级品类',
type: 1,
type: 2,
values: '',
width: '150',
checkarr: [],
@ -1251,7 +1202,7 @@ const menuData2 = ref([
{
prop: 'second',
label: '二级品类',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1262,7 +1213,7 @@ const menuData2 = ref([
{
prop: 'thirdProduct',
label: '三级品类',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1350,7 +1301,7 @@ const menuData2 = ref([
{
prop: 'driverName',
label: '计划装车人',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1361,7 +1312,7 @@ const menuData2 = ref([
{
prop: 'scanUser',
label: '实际装车人',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1386,7 +1337,7 @@ const menuData3 = ref([
{
prop: 'sku',
label: 'sku',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1397,7 +1348,7 @@ const menuData3 = ref([
{
prop: 'descriptionGoods',
label: '物料名称',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1408,7 +1359,7 @@ const menuData3 = ref([
{
prop: 'cargoNumber',
label: '物料编号',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1419,7 +1370,7 @@ const menuData3 = ref([
{
prop: 'cargoNorms',
label: '物料规格',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1441,7 +1392,7 @@ const menuData3 = ref([
{
prop: 'category',
label: '品分类',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1498,7 +1449,7 @@ const menuData3 = ref([
{
prop: 'signUser',
label: '签收人',
type: 1,
type: 2,
values: '',
width: '200',
checkarr: [],
@ -1670,14 +1621,26 @@ const Tabs = ref([
type: 'order',
query: {},
data: [],
renderData: [],
},
{
label: '包件列表',
name: '1',
/** 列表表头 */
columnList: menuData2.value,
type: 'package',
/** 搜索值 */
query: {},
/** 所有值 */
data: [],
/** 已签收数组 */
signeData: [],
/** 未签收数组 */
noSigneData: [],
/** 渲染值 */
renderData: [],
/** 把内部激活Tab值 */
activeName: 'haveBeenSigned',
},
{
label: '库存品列表',
@ -1686,6 +1649,7 @@ const Tabs = ref([
type: 'inventory',
query: {},
data: [],
renderData: [],
},
]);
//
@ -1751,7 +1715,7 @@ const doubledCount = computed(() => {
const setTableHeight = () => {
const node = document.querySelectorAll('.goodsTable');
setNodeHeight(node, '500px');
setNodeHeight(node, '600px');
};
onMounted(async () => {
@ -2045,7 +2009,9 @@ getDetail(RouterId.value).then(res => {
active.value = 3; //
}
form.value = res.data.data; //
InitializeTable.value = res.data.data.orderInfo; //()
// InitializeTable.value = res.data.data.orderInfo; //()
Tabs.value[0].data = res.data.data.orderInfo || []; //()
Tabs.value[0].renderData = res.data.data.orderInfo || [];
onLoad();
//
DoorstepPhoto.value = [];
@ -2094,8 +2060,23 @@ function PackageList() {
const { code } = res.data;
if (code !== 200) return;
console.log(res.data.data, '包件列表');
data.value = res.data.data || [];
Tabs.value[1].data = res.data.data;
// data.value = res.data.data || [];
const data = res.data.data || [];
const _item = Tabs.value[1];
_item.signeData = [];
_item.noSigneData = [];
data.forEach(val => {
if (Number(val.orderPackageStatus) === 70) _item.signeData.push(val);
else _item.noSigneData.push(val);
});
_item.data = _item.activeName === 'haveBeenSigned' ? _item.signeData : _item.noSigneData;
_item.renderData = _item.data;
editLoading.value = false; //
});
}
@ -2104,9 +2085,11 @@ function InventoryList() {
editLoading.value = true; //
data.value = [];
signforInventoryList(RouterId.value).then(res => {
if (res.data.code !== 200) return;
console.log(res, '库存品列表');
data.value = res.data.data || [];
Tabs.value[2].data = data;
// data.value = res.data.data || [];
Tabs.value[2].data = data || [];
Tabs.value[2].renderData = data || [];
editLoading.value = false; //
});
}
@ -2117,7 +2100,7 @@ const tabClick = val => {
case '0':
console.log(data.value, 'datavalue');
switchTableFields(menuData1.value);
data.value = InitializeTable.value;
// data.value = InitializeTable.value;
break;
case '1':
switchTableFields(menuData2.value);
@ -2299,9 +2282,34 @@ const inputsc = (value, row, type) => {
console.log('reg :>> ', reg);
if (Object.keys(_item.query).length === 0) return (_item.data = data.value);
if (Object.keys(_item.query).length === 0) return (_item.renderData = _item.data);
const _data = _item.data.filter(value => {
let _flag = true;
for (let key in _item.query) {
console.log('_item.query[key].test(value[key]) :>> ', _item.query[key].test(value[key]));
if (!_item.query[key].test(value[key])) _flag = false;
if (!_flag) break;
}
return _flag;
});
console.log('_data :>> ', _data);
_item.renderData = _data;
};
/** 选择签收状态 */
const handleChooseSigneState = val => {
console.log('val :>> ', val);
console.log('Tabs.value :>> ', Tabs.value);
const _item = Tabs.value[1];
console.log('_item :>> ', _item);
_item.data = val === 'haveBeenSigned' ? _item.signeData : _item.noSigneData;
if (Object.keys(_item.query).length === 0) return (_item.renderData = _item.data);
const _data = data.value.filter(value => {
const _data = _item.data.filter(value => {
let _flag = true;
for (let key in _item.query) {
console.log('_item.query[key].test(value[key]) :>> ', _item.query[key].test(value[key]));
@ -2313,7 +2321,7 @@ const inputsc = (value, row, type) => {
});
console.log('_data :>> ', _data);
_item.data = _data;
_item.renderData = _data;
};
</script>
@ -2466,4 +2474,18 @@ const inputsc = (value, row, type) => {
margin-top: 20px;
display: block;
}
//
:deep(.el-tab-pane) {
display: flex;
}
:deep(.el-tabs--left) {
flex: none;
}
//
.goodsTable {
flex: 1;
}
</style>

Loading…
Cancel
Save