报表申报智能运输页面完成
This commit is contained in:
@@ -4,16 +4,16 @@
|
||||
<view class="remarkLine">
|
||||
<text>物料列表</text>
|
||||
<uv-button type="primary" v-if="isAddMaterial" :plain="true" size="small" text="添加物料"
|
||||
@click="toMaterial"></uv-button>
|
||||
@tap="toMaterial"></uv-button>
|
||||
|
||||
<view v-if="isShowRqCode" class="flex align-center justify-between">
|
||||
<span class="f-12 mr-16 grey" style="font-size: 12px;" v-if="num > 0">
|
||||
剩余<span style="color: red;">
|
||||
<text class="f-12 mr-16 grey" style="font-size: 12px;" v-if="num > 0">
|
||||
剩余<text style="color: red;">
|
||||
{{ num }}
|
||||
</span>种物料未生成唯一码
|
||||
</span>
|
||||
</text>种物料未生成唯一码
|
||||
</text>
|
||||
<uv-button type="primary" :plain="true" size="small" text="快速生成唯一码"
|
||||
@click="toGenerateUniqueCodeQuickly"></uv-button>
|
||||
@tap="toGenerateUniqueCodeQuickly"></uv-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -30,18 +30,18 @@
|
||||
</view>
|
||||
<!-- 副标题:简称/型号/规格/类型 -->
|
||||
<view class="subTitle mb-2">
|
||||
<span v-if="item.materialShortName">{{ item.materialShortName }} / </span>
|
||||
<span v-if="item.model">{{ item.model }} / </span>
|
||||
<span v-if="item.specification">{{ item.specification }} / </span>
|
||||
<span v-if="item.typeName">{{ item.typeName }}</span>
|
||||
<text v-if="item.materialShortName">{{ item.materialShortName }} / </text>
|
||||
<text v-if="item.model">{{ item.model }} / </text>
|
||||
<text v-if="item.specification">{{ item.specification }} / </text>
|
||||
<text v-if="item.typeName">{{ item.typeName }}</text>
|
||||
</view>
|
||||
<!-- uniqueCode -->
|
||||
<view class="uniqueCode mb-2">
|
||||
<span class="f-12 " v-if="item.uniqueCode">唯一码:{{ item?.uniqueCode }}</span>
|
||||
<text class="f-12 " v-if="item.uniqueCode">唯一码:{{ item?.uniqueCode }}</text>
|
||||
</view>
|
||||
<!-- 数量 + 单位 -->
|
||||
<view class="tag-row mb-2">
|
||||
<span class="tag-error">{{ getTypeParentNames(item.typeParentNames) }}</span>
|
||||
<text class="tag-error">{{ getTypeParentNames(item.typeParentNames) }}</text>
|
||||
<view class="quantity-form">
|
||||
<uni-forms-item :name="`material[${idx}].quantity`" label-width="0">
|
||||
<uni-easyinput :disabled="!edit || isEdit == '5'"
|
||||
@@ -52,24 +52,24 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 库存状态 -->
|
||||
<view class="flex justify-between mb-2 " v-if="isEdit == 3 && isStockIn">
|
||||
<view class="flex justify-between mb-2 " v-if="isEdit == 3 && includes(keyType, 'stockIn')">
|
||||
<p style="font-size: 13px;">
|
||||
已入库:
|
||||
<span style="color:green">{{ getStockQuantity(item, 'complete') }}</span>
|
||||
<text style="color:green">{{ getStockQuantity(item, 'complete') }}</text>
|
||||
</p>
|
||||
<p style="font-size: 13px;">
|
||||
剩余:
|
||||
<span style="color:red">{{ getStockQuantity(item, 'remaining') }}</span>
|
||||
<text style="color:red">{{ getStockQuantity(item, 'remaining') }}</text>
|
||||
</p>
|
||||
</view>
|
||||
<view class="flex justify-between mb-2 " v-if="isEdit == 3 && !isStockIn">
|
||||
<view class="flex justify-between mb-2 " v-if="isEdit == 3 && includes(keyType, 'stockOut')">
|
||||
<p style="font-size: 13px;">
|
||||
已出库:
|
||||
<span style="color:green">{{ getStockQuantity(item, 'complete') }}</span>
|
||||
<text style="color:green">{{ getStockQuantity(item, 'complete') }}</text>
|
||||
</p>
|
||||
<p style="font-size: 13px;">
|
||||
剩余:
|
||||
<span style="color:red">{{ getStockQuantity(item, 'remaining') }}</span>
|
||||
<text style="color:red">{{ getStockQuantity(item, 'remaining') }}</text>
|
||||
</p>
|
||||
</view>
|
||||
<!-- 备注 -->
|
||||
@@ -92,8 +92,9 @@
|
||||
<!-- 选择物料 -->
|
||||
<uv-modal ref="modalRef" class="chooseModal" :title="none" :showConfirmButton="false" :showCancelButton="false">
|
||||
<p class="title">请选择称重来源</p>
|
||||
<p class="link" @click="toMaterialSelection('0')">无线液位计</p>
|
||||
<p class="link" @click="toMaterialSelection('1')">手动输入</p>
|
||||
<p class="link" v-if="includes(keyType, 'declaration')" @tap="toMaterialSelection('2')">蓝牙电子秤</p>
|
||||
<p class="link" @tap="toMaterialSelection('0')">无线液位计</p>
|
||||
<p class="link" @tap="toMaterialSelection('1')">手动输入</p>
|
||||
|
||||
</uv-modal>
|
||||
|
||||
@@ -123,71 +124,84 @@ const OPERATE_CONFIG = {
|
||||
toMaterialUrl: '/pages/warehousing/uniqueCode/issueUniqueCode/index',
|
||||
title: '入库单开单'
|
||||
},
|
||||
// 申报单开单
|
||||
declaration: {
|
||||
toMaterialUrl: '/pages/warehousing/uniqueCode/issueUniqueCode/materialSelection',
|
||||
title: '申报单开单'
|
||||
},
|
||||
my: {
|
||||
toMaterialUrl: '/pages/warehousing/uniqueCode/issueUniqueCode/index',
|
||||
title: '申报单开单'
|
||||
},
|
||||
|
||||
}
|
||||
const props = defineProps({
|
||||
formData: { type: Object, default: () => ({ material: [], remark: '' }), required: true },//物料信息
|
||||
isEdit: { type: Boolean, default: true, required: true }, //编辑1 / 物料只读2 / 入库单只读3 /入库生成唯一码编辑4 /5数量不可编辑 备注可编辑
|
||||
isEdit: { type: Boolean, default: true, required: true }, //编辑1 / 物料只读2 / 入/出库单只读3 /入库生成唯一码编辑4 /5数量不可编辑 备注可编辑
|
||||
pathParams: { type: Object, default: {} }, //只读时传入对应的code、id
|
||||
extendData: { type: Object, default: {} }, //其他额外参数
|
||||
})
|
||||
const emit = defineEmits(["setStorage"]); //申报开单 选择物料存储所填数据
|
||||
|
||||
const { formData, isEdit, pathParams, extendData } = toRefs(props)
|
||||
|
||||
// 标识:页面
|
||||
const keyType = computed(() => pathParams.value.type)
|
||||
//是否为编辑状态
|
||||
// 标识:是否为编辑状态
|
||||
const edit = computed(() => includes(['1', '4', '5'], `${isEdit.value}`))
|
||||
// 显示添加物料按钮 isEdit编辑、
|
||||
const isAddMaterial = computed(() => `${isEdit.value}` === '1' && keyType != 'issueUniqueCode_inbound' && !includes(keyType.value, 'stockOut'))
|
||||
// 显示快速生成唯一码 isShowRqCode
|
||||
// 标识:显示添加物料按钮 编辑1且非开单页面以及非出库相关页面
|
||||
const isAddMaterial = computed(() => `${isEdit.value}` === '1' && keyType.value != 'stockIn_inbound' && !includes(keyType.value, 'stockOut'))
|
||||
// 标识:显示快速生成唯一码 编辑5数量不可编辑 备注可编辑且非出库相关页面
|
||||
const isShowRqCode = computed(() => `${isEdit.value}` === '5' && !includes(keyType.value, 'stockOut'))
|
||||
const isStockIn = computed(() => includes(keyType.value, 'stockIn'))
|
||||
|
||||
// 删除:数据
|
||||
const delItem = ref(null)
|
||||
// 删除:开关
|
||||
const alertDialog = ref(null)
|
||||
// 删除:开关
|
||||
const isDialog = ref(false)
|
||||
// 数据:开单-可选择的物料列表
|
||||
const selectMaterialList = computed(() => extendData.value?.selectMaterialList)
|
||||
const num = computed(() => selectMaterialList.value?.length || 0)
|
||||
// 弹窗开关:入库单开单
|
||||
// 弹窗:入库单开单
|
||||
const modalRef = ref()
|
||||
|
||||
// 按钮:添加物料
|
||||
const toMaterial = () => {
|
||||
if (keyType.value == 'stockIn') { // 入库单开单 - 添加物料可选择手输入/无线液位计
|
||||
if (keyType.value == 'stockIn' || includes(keyType.value, 'declaration')) { // 入库单开单 - 添加物料可选择手输入/无线液位计
|
||||
modalRef.value.open()
|
||||
} else {
|
||||
const path = objectToQuery(pathParams.value)
|
||||
// 唯一码 - 编辑/新增
|
||||
const value = uni.getStorageSync('app_material');
|
||||
uni.setStorageSync('app_material', [{ ...value[0], uniqueCodeRemark: formData.value?.remark }]); // 将最新的唯一码备注写入缓存
|
||||
uni.navigateTo({
|
||||
url: `${OPERATE_CONFIG.issueUniqueCode.toMaterialUrl}${path}`
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
// 添加物料弹窗: 入库单入库 时可选择手动/无线液
|
||||
// 添加物料弹窗: 入库单入库、申报开单 时可选择手动/无线液
|
||||
const toMaterialSelection = (type) => {
|
||||
// 0无线液 1手动输入
|
||||
// 0无线液 1手动输入 2蓝牙
|
||||
let url = ''
|
||||
const path = objectToQuery(pathParams.value)
|
||||
if (type === '1') {
|
||||
emit("setStorage");
|
||||
url = `${OPERATE_CONFIG.issueUniqueCode.toMaterialUrl}`
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `${url}${path}`
|
||||
})
|
||||
}
|
||||
// 快速生成唯一码 -
|
||||
|
||||
// 快速生成唯一码 -
|
||||
const toGenerateUniqueCodeQuickly = () => {
|
||||
const path = objectToQuery(pathParams.value)
|
||||
console.log(path, 'path==>');
|
||||
|
||||
uni.navigateTo({
|
||||
url: `${OPERATE_CONFIG.stockIn.toMaterialUrl}${path}`
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 删除弹窗:显示 长按事件
|
||||
const handleItemLongPress = (val) => {
|
||||
alertDialog.value.open()
|
||||
@@ -204,7 +218,6 @@ const dialogConfirm = () => {
|
||||
const idx = findIndex(formData.value.material, (i) => `${i.id}` === `${delItem.value.id}`)
|
||||
assign(formData.value.material[idx], { isDelete: '1' });
|
||||
uni.setStorageSync('app_material', formData.value.material)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +264,7 @@ defineExpose({
|
||||
|
||||
}
|
||||
|
||||
span {
|
||||
text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user