<template>
|
<!-- 组盘 -->
|
<view style="padding-bottom:100px">
|
<u-form labelPosition="left" label-width="150rpx" :model="formData" ref="warehouseRef">
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="12">
|
<u-form-item label="标签条码:" class="itemWB">
|
|
<u-input id="materialRef" :focus="curFoucus2" v-model="formData.extendField06" ref="materialRef" placeholder="请扫码录入"
|
@focus="formData.extendField06 = ''" @confirm="getMaterialDetails"
|
style="font-weight: bolder;margin-left: 15rpx;" class="width padding_left25rpx">
|
</u-input>
|
|
</u-form-item>
|
</u-col>
|
</u-row>
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="12">
|
<u-form-item label="托盘号:" prop="plateCode" required class="itemWB">
|
<u-input v-model.trim="formData.plateCode" placeholder="请扫码录入"
|
style="font-weight: bolder;margin-left: 15rpx;" class="width padding_left25rpx">
|
</u-input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="12">
|
<u-form-item label-width="200rpx" label="占用空间(%):" class="itemWB">
|
<u-input v-model="formData.percentAge" type="number" ref="percentAge" :min="1" :max="100"
|
placeholder="请输入占用空间" style="font-weight: bolder;margin-left: 15rpx;"
|
class="width padding_left25rpx">
|
</u-input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
</u-form>
|
<modal-code :rescode='rescode' :resmessage='resmessage' ref="resmodal" />
|
<view style="margin-bottom: 200rpx;" class="margin_top10rpx">
|
<view v-for="(item, eindex) in tableData" :key="eindex" class="margin_bottom10rpx">
|
<u-swipe-action :show="item.show" :index="eindex" @click="longpress" @open="open" @close='close'
|
:options="options" style="width: 100vw;">
|
<view class="title-wrap fontSize32rpx background_fff padding10"
|
:class="item.enAbled==0? 'bg_item' : '' ">
|
<u-row>
|
<u-col span="12" class="flex">
|
<text class="flex justify-center align-center circkle06">{{ eindex + 1 }}</text>
|
<text class="color_f18202 padding_left10rpx">
|
{{item.productCode}}
|
</text>
|
<!-- <u-icon name="plus-circle" v-if="item.enAbled!=1"></u-icon> -->
|
</u-col>
|
</u-row>
|
<u-row>
|
<u-col span="12">
|
<text class="color_80">
|
物料名称:{{ item.productName }}
|
</text>
|
</u-col>
|
</u-row>
|
<u-row>
|
<u-col span="12">
|
<view class="color_80 flex" style="vertical-align: middle;align-items: center;">
|
是否需要助力臂:
|
<!-- @change="change" -->
|
<!-- <view style="margin-top: 2rpx;"> -->
|
<u-switch size="40" v-model="item.isBoosterArm"></u-switch>
|
<!-- </view> -->
|
</view>
|
</u-col>
|
</u-row>
|
<u-row>
|
<u-col span="12">
|
<text class="color_80">
|
标签条码:{{ item.extendField06 }}
|
</text>
|
</u-col>
|
</u-row>
|
|
<u-row>
|
<u-col span="6">
|
<text class="color_80">
|
库存单位:{{item.smallUnit}}
|
</text>
|
</u-col>
|
<u-col span="6" class="flex color_f18202">
|
<view class="color_80">
|
数量:
|
</view>
|
{{ item.finishedQuantity }}
|
<!-- <input :class="item.enAbled?'':'border_bottom_f18202 inputGray'"
|
class="text-left color_f18202 fontSize32rpx inputGray2" v-model="item.quantity"
|
type="number" :disabled="item.enAbled==1" @blur="changeNum(item)"
|
@click="clicki(item)" placeholder="0" /> -->
|
</u-col>
|
</u-row>
|
|
</view>
|
</u-swipe-action>
|
</view>
|
</view>
|
<!-- <button-modal :BottomModal="true" :issueShow='true' issueTitle="重置" subTitle='组盘' restTiltle='入库' @reset='goWarhouse'
|
@submit='submit' @issue="reset" /> -->
|
|
<u-popup v-model="detailshow" border-radius="14" @close="detailshow = false" mode="bottom">
|
<h2 class="text_align_center padding_bottom18 padding15">物料信息</h2>
|
<scroll-view scroll-y="true" style="height: 550rpx;">
|
|
<view class="line flex justify-between">
|
<text class="text-gray">采购单号</text>
|
<text>{{ materlist.poCode }}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">采购项号</text>
|
<text>{{ materlist.itemNumber }}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">跟踪号</text>
|
<text>{{ materlist.extendField04 }}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">销售单号</text>
|
<text>{{ materlist.saleCode }}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">销售项号</text>
|
<text>{{ materlist.extendField08 }}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">到期日期</text>
|
<text>{{ materlist.limitDate }}</text>
|
</view>
|
<!-- <view class="line flex justify-between">
|
<text class="text-gray">重量</text>
|
<text>{{ materlist.totalWeight }}</text>
|
</view> -->
|
</scroll-view>
|
</u-popup>
|
|
<button-modal :empTytowerShow='true' cleaningTitle="重置" garmenTitle='确认码盘' @submit='saveCheck' @reset='rest' />
|
|
</view>
|
</template>
|
<script>
|
import ButtonModal from '@/components/BottomModal.vue'
|
import ModalCode from '@/components/ModalCode.vue'
|
import {
|
addGroupDisk,
|
getContainDetail,
|
getBhbMaterialList,
|
getArea
|
} from '@/src/api/artificial.js'
|
import {
|
getAttrValue
|
} from '@/src/untils/tool.js'
|
export default {
|
data() {
|
return {
|
curFoucus: true,
|
curFoucus2: true,
|
rescode: 0,
|
resmessage: "",
|
putCode: '', //容器二维码
|
detailshow: false,
|
operator: '',
|
focu: false, //清空按钮隐显
|
focuM: false, //物料隐显按钮
|
// Datetime: getDate(),
|
tableData: [], //物料详情
|
options: [{
|
text: '详情',
|
style: {
|
backgroundColor: '#fc9f35'
|
}
|
},
|
{
|
text: '删除',
|
style: {
|
backgroundColor: '#fc4b4b'
|
}
|
}
|
],
|
materlist: {},
|
formData: {
|
plateCode: '',
|
extendField06: '',
|
percentAge: 100,
|
},
|
gridable: true,
|
gridFocus: false,
|
detailable: false,
|
detailableZb: false,
|
batchNo: '', //扫码到的当前物料的批次
|
warehouseRules: {
|
plateCode: [{
|
required: true,
|
message: '托盘号不能为空',
|
trigger: 'blur'
|
}]
|
},
|
orderType: 1,
|
warhouseTph: '',
|
timerPrint: null,
|
kwbhAllowed: false, //是否禁用库位编号
|
arrD: [],
|
disabled_extendField06: false,
|
// 当前正在扫描的数据 {}
|
currentRow: null,
|
// SKU列表
|
findProductList: [],
|
productPosition_Id:"",
|
existRows: [],//
|
};
|
},
|
components: {
|
ButtonModal,
|
ModalCode
|
},
|
onLoad(option) {},
|
onReady() {
|
this.$refs.warehouseRef.setRules(this.warehouseRules)
|
},
|
mounted() {
|
let tokenInfouser = uni.getStorageSync('$tokenInfouser');
|
if(!tokenInfouser){
|
uni.navigateTo({
|
url: '../Login/login?id=1'
|
})
|
}
|
// formatTime("2024-01-16")
|
// this.formatTime("2024-1-16")
|
|
this.addDate("2024-1-16 16:28:01");
|
},
|
methods: {
|
|
//物料查询
|
getMaterialDetails() {
|
|
this.timerPrint = setTimeout(() => {
|
this.getProductInfo()
|
clearTimeout(this.timerPrint)
|
this.timerPrint = null
|
}, 300);
|
},
|
//物料查询
|
// _getMaterialDetails() {
|
// //console.log('我是:'+this.warehouse.materialCode);
|
// // if (!this.warehouse.plateCode) {
|
// // return
|
// // }
|
|
// // if (this.warehouse.materialCode.length > 50) {
|
// // 错误码提示
|
// // let str = this.warehouse.materialCode.replace(/\s/g, '')
|
// // if (str.indexOf('LOTNO') == -1 || str.indexOf('PARTSNUMBER') == -1) {
|
// // uni.showToast({
|
// // title: '二维码格式错误,格式为:' + str,
|
// // icon: 'none',
|
// // duration: 2000
|
// // })
|
// // return
|
// // }
|
|
// // this.batchNo = getAttrValue(this.warehouse.materialCode, 'LOTNO')
|
// // let quantity = getAttrValue(this.warehouse.materialCode, 'QUANTITY')
|
// // // let boxNum = getAttrValue(this.warehouse.materialCode,'BOXNUM')
|
// // // let sap_location = getAttrValue(this.warehouse.materialCode,'SAP')
|
// // if (quantity == '' || Number(quantity) <= 0) {
|
// // this.rescode = 400
|
// // this.resmessage = '标贴中没有数量'
|
// // this.$refs.resmodal.show = true
|
// // return
|
// // }
|
// // //扫描的物料是否有批次
|
// // if (!this.batchNo) {
|
// // this.rescode = 400
|
// // this.resmessage = '无批次'
|
// // this.$refs.resmodal.show = true
|
// // return
|
// // }
|
// // this.warehouse.materialCode = getAttrValue(this.warehouse.materialCode, 'PARTSNUMBER')
|
// let param1 = this.warehouse.extendField06;
|
// var qty = "";
|
// if (param1.length > 12) {
|
// param1 = getAttrValue(this.warehouse.extendField06, 6);
|
// qty = getAttrValue(this.warehouse.extendField06, 4) || "";
|
// }
|
// if (!param1) {
|
// uni.showToast({
|
// title: '标签条码获取失败!',
|
// icon: 'none'
|
// })
|
// return
|
// }
|
// getBhbMaterialList({
|
// 'extendField06': param1,
|
// }).then((resWm) => {
|
// if (resWm.data.result) { //200
|
// let res = resWm.data;
|
// if (res.result) {
|
// if (res.data == null) {
|
// this.rescode = 400
|
// this.resmessage = '无此物料'
|
// this.$refs.resmodal.show = true
|
// return
|
// } else {
|
// if (res.data.length == 0) {
|
// this.rescode = 400
|
// this.resmessage = '无此物料'
|
// this.$refs.resmodal.show = true
|
// return
|
// } else {
|
// // 根据id 判断物料是否存在
|
// res.data.forEach(item => {
|
// //根据标签码extendField06
|
// let index = this.tableData.findIndex(v => v.extendField06 == item
|
// .extendField06);
|
// console.log(index)
|
// if (index == -1) {
|
// this.tableData.unshift({
|
// ...item,
|
// finishedQuantity: qty || item.quantity
|
// // show: false,
|
// // enAbled: 0 //控制数量是否可以输入
|
// })
|
// } else {
|
// //有的 置顶
|
// this.tableData.unshift(...this.tableData.splice(index, 1))
|
// // this.tableData[index].quantity = Number(Number(this.tableData[
|
// // index].quantity) + Number(quantity)).toFixed(3);
|
// // this.tableData.unshift(...this.tableData.splice(index, 1))
|
// }
|
// });
|
// }
|
// }
|
// } else {
|
// this.resmessage = res.message
|
// this.rescode = res.code
|
// this.$refs.resmodal.show = true
|
// }
|
// } else {
|
// this.resmessage = resWm.data.msg;
|
// this.rescode = 400
|
// this.$refs.resmodal.show = true
|
// }
|
|
// })
|
// // }
|
// },
|
|
// 获取物料信息
|
getProductInfo() {
|
var _this = this;
|
// this.disabled_extendField06 = true //禁用控件 【EditBy shaocx,2022-08-29】
|
// // 标签条码
|
// var extendField06 = this.formData.extendField06
|
// var extendField06Arr = Object.values(extendField06)
|
// var extendField06Length = extendField06Arr.length
|
// // 字符长度如果为5就获取器具的焦点
|
// if (extendField06Length === 5) {
|
// // 器具框获得焦点
|
// this.formData.plateCode = extendField06
|
// this.disabled_extendField06 = false //启用控件 【EditBy shaocx,2022-08-29】
|
// return
|
// }
|
// extendField06 = extendField06.trim()
|
// this.formData.extendField06 = extendField06
|
// if (!extendField06) {
|
// this.$message({
|
// message: '条码值不能为空!',
|
// type: 'warning'
|
// })
|
// this.disabled_extendField06 = false //启用控件
|
// return
|
// }
|
// this.findProductList = []
|
|
let extendField06 = this.formData.extendField06;
|
if(extendField06.length == 5){
|
this.formData.plateCode = extendField06;
|
this.formData.extendField06 = ''
|
this.autoFocusPdaInput(); //客户要求 扫码后 清空数值 自动聚焦focus
|
return
|
}
|
var qty = "";
|
if (extendField06.length > 12) {
|
extendField06 = getAttrValue(this.formData.extendField06, 6);
|
qty = getAttrValue(this.formData.extendField06, 4) || "";
|
}
|
if (!extendField06) {
|
uni.showToast({
|
title: '标签条码获取失败!',
|
icon: 'none'
|
})
|
return
|
}
|
var params = {
|
extendField06: extendField06
|
}
|
getBhbMaterialList(params).then((resWm) => {
|
if (resWm.data.result) { //200
|
let res = resWm.data;
|
if (res.result) {
|
if (res.data == null) {
|
this.rescode = 400
|
this.resmessage = '无此物料'
|
this.$refs.resmodal.show = true
|
return
|
} else {
|
if (res.data.length == 0) {
|
this.rescode = 400
|
this.resmessage = '无此物料'
|
this.$refs.resmodal.show = true
|
return
|
} else {
|
// --------------pc端
|
this.findProductList = res.data.map(row => {
|
// row.finishedQuantity = qty || row.quantity;
|
row.finishedQuantity = row.quantity;
|
if (row.limitDate) {
|
// row.limitDate = moment(row.limitDate).format('YYYY-MM-DD')
|
row.limitDate = row.limitDate.split('T')[0];
|
}
|
row.extendField06 = extendField06;
|
//this.formData.scanQty = row.finishedQuantity
|
return row;
|
})
|
for (var index in this.findProductList) {
|
this.currentRow = this.findProductList[index]
|
}
|
|
// -------------第一个
|
// this.$set(this.tableData, this.tableData.length, this.currentRow)
|
// this.existRows.push(this.currentRow)
|
// this.sortRow()
|
|
// -----------------pc端
|
|
// 根据id 判断物料是否存在
|
res.data.forEach(item => {
|
//根据标签码extendField06
|
let index = this.tableData.findIndex(v => v.extendField06 == item
|
.extendField06);
|
console.log(index)
|
if (index == -1) {
|
this.tableData.unshift({
|
...item,
|
// finishedQuantity: qty || item.quantity,
|
finishedQuantity: item.quantity
|
})
|
} else {
|
//有的 置顶
|
this.tableData.unshift(...this.tableData.splice(index, 1))
|
}
|
});
|
}
|
}
|
} else {
|
this.resmessage = res.message
|
this.rescode = res.code
|
this.$refs.resmodal.show = true
|
}
|
} else {
|
this.resmessage = resWm.data.msg;
|
this.rescode = 400
|
this.$refs.resmodal.show = true
|
}
|
this.formData.extendField06 = ''
|
this.autoFocusPdaInput(); //客户要求 扫码后 清空数值 自动聚焦focus
|
})
|
// }
|
|
// this.common.ajax(
|
// url,
|
// params,
|
// res => {
|
// this.common.showMsg(res)
|
// if (res.result) {
|
// this.findProductList = res.data.map(row => {
|
// row.finishedQuantity = row.quantity
|
// if (row.limitDate) {
|
// row.limitDate = moment(row.limitDate).format('YYYY-MM-DD')
|
// }
|
// row.extendField06 = this.formData.extendField06
|
|
// this.formData.scanQty = row.finishedQuantity
|
// return row
|
// })
|
// for (var index in this.findProductList) {
|
// this.currentRow = this.findProductList[index]
|
// }
|
// this.$set(this.tableData, this.tableData.length, this.currentRow)
|
// // this.existRows.push(this.currentRow)
|
// this.sortRow()
|
// }
|
// this.disabled_extendField06 = false //启用控件 【EditBy shaocx,2022-08-29】
|
// },
|
// true
|
// )
|
},
|
|
//客户要求 扫码后 清空数值 自动聚焦focus
|
autoFocusPdaInput(){
|
//客户要求 扫码后 清空数值在聚焦
|
// #ifdef H5
|
try {
|
document.getElementById('materialRef').querySelector('input').focus()
|
} catch (e) {}
|
// #endif
|
|
// #ifdef APP
|
try{
|
this.curFoucus2 = false
|
this.timerPrint = setTimeout(()=>{
|
this.curFoucus2 = true
|
clearTimeout(this.timerPrint)
|
this.timerPrint = null
|
}, 2000)
|
}catch(e){
|
//TODO handle the exception
|
}
|
// #endif
|
//客户要求 扫码后 清空数值在聚焦
|
},
|
//删除详情
|
longpress(index, eindex) {
|
this.tableData[index].cardNum = true
|
if (eindex == 1) {
|
uni.showModal({
|
title: '提示',
|
content: '是否确认删除?',
|
showCancel: true,
|
cancelColor: '#333333',
|
success: (res => {
|
if (res.confirm) {
|
this.tableData[index].cardNum = true
|
if (eindex == 0) { //删除
|
this.tableData.splice(index, 1)
|
} else {
|
this.materlist = this.tableData[index]
|
this.detailshow = true
|
}
|
} else if (res.cancel) {
|
|
}
|
})
|
});
|
|
} else {
|
this.materlist = this.tableData[index]
|
this.detailshow = true
|
}
|
},
|
|
|
//编辑状态样式
|
dc(e) {
|
e.cardNum = true
|
this.$forceUpdate()
|
},
|
//卡片选中
|
clicki(e) {
|
e.cardNum = true
|
this.$forceUpdate()
|
},
|
// 如果打开一个的时候,不需要关闭其他,则无需实现本方法
|
open(index) {
|
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
// 原本为'false',再次设置为'false'会无效
|
this.tableData[index].cardNum = true;
|
this.$forceUpdate()
|
this.tableData[index].show = true;
|
this.tableData.map((val, idx) => {
|
if (index != idx) this.tableData[idx].show = false;
|
})
|
},
|
close(index) {
|
this.tableData[index].show = false;
|
this.tableData[index].cardNum = false;
|
this.$forceUpdate()
|
},
|
//改变组盘数量
|
changeNum(val) {
|
val.cardNum = false
|
if (!val.quantity) {
|
uni.showModal({
|
title: '提示',
|
content: '组盘数量不能为空',
|
showCancel: false
|
})
|
}
|
if (val.quantity < 0) {
|
uni.showModal({
|
title: '提示',
|
content: '组盘数量必须大于0',
|
showCancel: false
|
})
|
}
|
|
},
|
|
//重置页面信息
|
rest() {
|
this.formData.extendField06 = ''
|
this.formData.plateCode = ''
|
this.formData.percentAge = 100
|
this.tableData = [];
|
this.$refs.warehouseRef.resetFields();
|
},
|
//确认
|
// submit() {
|
// this.$refs.warehouseRef.setRules(this.warehouseRules)
|
// this.$refs.warehouseRef.validate(valid => {
|
// if (valid) {
|
// if (this.tableData.length <= 0) {
|
// uni.showToast({
|
// title: '物料明细不能为空',
|
// icon: 'none',
|
// duration: 2000
|
// });
|
// return
|
// }
|
|
// //请求参数
|
// let params = {
|
// datalist: this.tableData,
|
// percentAge: this.formData.percentAge, //空间占比
|
// plateCode: this.formData.plateCode,
|
// productPosition_Id: null,
|
// shelveType: "码盘上架"
|
// }
|
// uni.showModal({
|
// title: '提示',
|
// content: '是否确认码盘上架?',
|
// showCancel: true,
|
// cancelColor: '#333333',
|
// success: (res => {
|
// if (res.confirm) {
|
// addGroupDisk(params).then(res => {
|
// if (res.data.result) { //200
|
// this.rescode = 200
|
// this.resmessage = "码盘上架成功!"
|
// this.$refs.resmodal.show = true
|
// this.rest()
|
// } else {
|
// this.resmessage = res.data.msg || "";
|
// this.rescode = 400
|
// this.$refs.resmodal.show = true
|
// }
|
|
|
// })
|
// } else if (res.cancel) {
|
|
// }
|
// })
|
// });
|
// }
|
// })
|
// },
|
|
|
// 确认入库
|
saveCheck() {
|
// if (!window.confirm('当前扫描要确认码盘吗?')) return
|
if (!this.formData.plateCode) {
|
this.$message.error('请输入码盘的母托盘号!')
|
return
|
}
|
var emptyPositionName = this.tableData.filter(item => item.product_Id && item.finishedQuantity > 0 && !item
|
.positionName)
|
if (emptyPositionName.length) {
|
this.$message.error('条形码[' + emptyPositionName.join(',') + ']货位不能为空!')
|
return
|
}
|
var dataList = this.tableData.filter(item => item.position_Id && item.finishedQuantity > 0).map(item => {
|
return {
|
storage_Id: 87,
|
storageName: '立体库',
|
product_Id: item.product_Id,
|
productCode: item.productCode,
|
productName: item.productName,
|
finishedQuantity: item.finishedQuantity,
|
positionName: item.positionName,
|
produceDate: item.produceDate,
|
purchasePrice: item.purchasePrice,
|
batchNumber: null,
|
productSpec: item.productSpec,
|
plateCode: item.plateCode,
|
enterMode: '',
|
isBoosterArm: item.isBoosterArm || 0,
|
quantity: item.quantity,
|
poCode: item.poCode,
|
extendField04: item.extendField04,
|
saleCode: item.saleCode,
|
itemNumber: item.itemNumber,
|
extendField08: item.extendField08,
|
limitDate: item.limitDate,
|
totalWeight: item.totalWeight,
|
extendField06: item.extendField06
|
}
|
});
|
|
var dataListss = this.tableData.filter(item => item.finishedQuantity > item.quantity)
|
const detailList = JSON.stringify(
|
dataListss.map(m => {
|
return {
|
poCode: m.poCode,
|
productCode: m.productCode,
|
number: m.finishedQuantity - m.quantity,
|
saleCode: m.saleCode,
|
trackting: m.extendField04
|
}
|
})
|
)
|
|
if (dataList.length === 0) {
|
this.$message.error('至少录入一条数据')
|
return
|
}
|
//增加对重复条形码的验证
|
for (var i = 0; i < dataList.length; i++) {
|
for (var j = i + 1; j < dataList.length; j++) {
|
if (dataList[i].extendField06 == dataList[j].extendField06) {
|
this.$message.error('检测到列表中有重复的标签条码' + dataList[j].extendField06 + ',请重新刷新界面重新扫码!')
|
return
|
}
|
}
|
}
|
|
var msg = '当前码盘上架共' + dataList.length + '条物料明细,请确认数量是否跟现场实物一致?,如果不一致请点取消按钮!';
|
var params = {
|
datalist: dataList,
|
plateCode: this.formData.plateCode,
|
percentAge: this.formData.percentAge,
|
productPosition_Id: this.productPosition_Id,
|
detailList: detailList,
|
shelveType: '码盘上架'
|
}
|
uni.showModal({
|
title: '提示',
|
//content: '是否确认码盘上架?',
|
content: msg,
|
showCancel: true,
|
cancelColor: '#333333',
|
success: (res => {
|
if (res.confirm) {
|
addGroupDisk(params).then(res => {
|
if (res.data.result) { //200
|
this.rescode = 200
|
this.resmessage = "码盘上架成功!"
|
this.$refs.resmodal.show = true
|
this.rest()
|
} else {
|
this.resmessage = res.data.msg || "";
|
this.rescode = 400
|
this.$refs.resmodal.show = true
|
}
|
})
|
} else if (res.cancel) {}
|
})
|
});
|
},
|
|
// 排序高亮行靠前
|
sortRow() {
|
this.tableData.forEach(element => {
|
element.sortIndex = 0
|
})
|
this.currentRow.sortIndex = 1
|
this.tableData = this.tableData.sort(function(a, b) {
|
return b.sortIndex - a.sortIndex
|
})
|
this.tableData.forEach(element => {
|
element.sortIndex = 0
|
})
|
},
|
|
// formatTime (strDate){
|
// let dateFormat = new Date(strDate);
|
// dateFormat = dateFormat.setDate(dateFormat.getDate() + 1);
|
// dateFormat = new Date(dateFormat);
|
// let y = dateFormat.getFullYear();
|
// let m = (dateFormat.getMonth() + 1).tostring().padstart(2, '0');
|
// let d = dateFormat.getDate().tostring().padstart(2, '0');
|
// return `${y} - ${m} - ${d}`
|
// },
|
|
|
addDate(dateC, days) {
|
if (days == undefined || days == '') {
|
days = 1;
|
}
|
const date = new Date(dateC);
|
date.setDate(date.getDate() + days);
|
const month = date.getMonth() + 1;
|
const day = date.getDate();
|
return date.getFullYear() + '-' + getFormatDate(month) + '-' + getFormatDate(day);
|
|
function getFormatDate(arg) {
|
if (arg == undefined || arg == '') {
|
return '';
|
}
|
let re = arg + '';
|
if (re.length < 2) {
|
re = '0' + re;
|
}
|
return re;
|
}
|
|
}
|
|
}
|
}
|
</script>
|
|
|
<style lang="scss" scoped>
|
page {
|
width: 100%;
|
min-height: 100vh;
|
background-color: #F2F2F2;
|
box-sizing: border-box;
|
}
|
.bg_item {
|
background: #FFEBCD !important;
|
}
|
|
.inputGray2 {
|
line-height: 30px;
|
border-top: 10rpx solid transparent;
|
}
|
|
.inputGray {
|
border-top: 0rpx solid transparent;
|
|
}
|
</style>
|