<template>
|
<view>
|
<view class="form-container">
|
<form :modelValue="formData">
|
<view class="form-group">
|
<label class="form-label">检验单号:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.billNo"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">创建时间:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.createTime"/>
|
</view>
|
<view class="uni-form-item uni-column form-item edit">
|
<text class="form-label">首检时机:</text>
|
<picker v-if="isUpdate" class="picker form-input" name="selector" :range="TypeList"
|
@change="onTypeChange">
|
<text>{{ TypeList[TypeIndex] }}</text>
|
</picker>
|
<input v-else class="form-input" disabled="true" type="text" v-model="formData.type"/>
|
</view>
|
<view class="uni-form-item uni-column form-item edit">
|
<text class="form-label">生产线别:</text>
|
<superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="请选择或输入"
|
v-model="formData.line"
|
@select="onDaa020Change"
|
class="picker form-input"
|
style="border: none;"></superwei-combox>
|
<input v-else class="form-input" disabled="true" type="text" v-model="formData.line"/>
|
</view>
|
<view class="uni-form-item uni-column form-item edit">
|
<text class="form-label">物料编码:</text>
|
<superwei-combox v-if="isUpdate" :candidates="ItemList" placeholder="请选择或输入"
|
v-model="formData.itemNo"
|
:isJSON="true" keyName="displayName"
|
@select="onItemChange"
|
class="picker form-input"
|
style="border: none;"></superwei-combox>
|
<input v-else class="form-input" disabled="true" type="text" v-model="formData.itemNo"/>
|
</view>
|
<!-- <view class="uni-form-item uni-column form-item edit">
|
<text class="form-label">生产工单:</text>
|
<picker v-if="isUpdate" class="picker form-input" name="selector" :range="DAA001List"
|
@change="onDaa001Change">
|
<text>{{ DAA001List[DAA001Index] }}</text>
|
</picker>
|
<input v-else class="form-input" disabled="true" type="text" v-model="formData.daa001"/>
|
</view> -->
|
<view class="form-group">
|
<label class="form-label">产品名称:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.daa003"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">规格型号:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.daa004"/>
|
</view>
|
|
<!-- <view class="form-group">-->
|
<!-- <label class="form-label">备注:</label>-->
|
<!-- <input class="form-input" type="text" v-model="formData.comments"/>-->
|
<!-- </view>-->
|
<view class="form-group">
|
<label class="form-label">工单总数:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.daa008"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">不合格描述:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.remarks"/>
|
</view>
|
</form>
|
</view>
|
|
|
<view class="container">
|
<view class="tab-bar">
|
<view
|
class="tab-item"
|
:class="{ active: currentTab === 0 }"
|
@click="changeTab(0)">
|
检验项目明细
|
</view>
|
<view
|
class="tab-item"
|
:class="{ active: currentTab === 1 }"
|
@click="changeTab(1)">
|
生产工单单据
|
</view>
|
</view>
|
|
<!-- 内容区域 -->
|
<scroll-view class="content">
|
<view v-if="currentTab === 0" class="tab-content">
|
<view class="list-container">
|
<uni-table ref="table" border emptyText="暂无更多数据">
|
<uni-tr>
|
<uni-th align="center" class="th" style="color: #FFFFFF;">检验项目</uni-th>
|
<uni-th align="center" class="th" style="color: #FFFFFF">是否合格</uni-th>
|
<uni-th align="center" class="th" style="color: #FFFFFF">记录(点击)</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item, index) in tableData" :key="index">
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.projName"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.result"/>
|
</uni-td>
|
<uni-td>
|
<view class="uni-group">
|
<button v-if="item.isCheck >=item.levelNum" type="default" @click="toDetail(item)">
|
{{ item.levelNum + '/' + item.isCheck }}
|
</button>
|
<button v-else type="warn" @click="toDetail(item)"> {{ item.levelNum + '/' + item.isCheck }}</button>
|
</view>
|
</uni-td>
|
</uni-tr>
|
</uni-table>
|
</view>
|
|
|
|
<view class="plus-button">
|
<button type="warn" v-if="isUpdate && !isShowTable" @click="save">创建检验单并生成部分默认值</button>
|
</view>
|
|
|
|
<view class="plus-button">
|
<button type="warn" v-if="!isUpdate && formData.result == '未完成' && !isShowTable" @click="getTable">获取最新检验项目</button>
|
</view>
|
|
<view class="plus-button">
|
<button type="warn" v-if="!isUpdate && !isShowTable" @click="toFtp">打开图纸文件列表</button>
|
</view>
|
|
<view class="plus-button">
|
<button type="warn" v-if="!isUpdate && !isShowTable" @click="toImage">上传/查看图片</button>
|
</view>
|
|
|
|
<view class="plus-button">
|
<button type="warn" v-if="isShowTable" @click="getTable">获取检验项目</button>
|
</view>
|
|
<view class="plus-button">
|
<button type="warn" v-if="!isUpdate && formData.result == '未完成' && !isShowTable" @click="removeXJ">删除单据
|
</button>
|
</view>
|
|
<view class="plus-button">
|
<button type="warn" v-if="!isUpdate && !isShowTable" @click="saveRemarks">添加不合格描述</button>
|
</view>
|
|
|
|
<view class="plus-button">
|
<button type="warn" v-if="isShowTable && isUpdate" @click="saveTable">生成检验项目</button>
|
</view>
|
|
<view v-if="remarksPopup" class="overlay">
|
<view class="popup">
|
<h3>修改不合格描述</h3>
|
<form>
|
<view class="form-group">
|
<label class="form-label">不合格描述:</label>
|
<input class="form-input" type="text" v-model="remarks"/>
|
</view>
|
<button type="warn" @click="editRemarks">修改</button>
|
<button @click="remarksPopup = !remarksPopup">取消</button>
|
</form>
|
</view>
|
</view>
|
</view>
|
|
<view v-if="currentTab === 1" class="tab-content">
|
<view class="list-container">
|
<uni-table ref="table" border emptyText="暂无更多数据">
|
<uni-tr>
|
<uni-th align="center" class="th" style="color: #FFFFFF;">生产工单</uni-th>
|
<uni-th align="center" class="th" style="color: #FFFFFF">产品名称</uni-th>
|
<uni-th align="center" class="th" style="color: #FFFFFF">工单数量</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item, index) in tableWorkData" :key="index">
|
<uni-td align="center">
|
|
<picker mode="selector" :range="DAA001List" @change="(event) => onPickerChange(event, index)" :value="item.projNameIndex">
|
<input class="form-input" disabled="true" type="text" placeholder="点击选择工单" v-model="item.workNo"/>
|
</picker>
|
|
<!-- /*<input class="form-input" disabled="true" type="text" v-model="item.projName"/>*/ -->
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.itemName"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.workQty"/>
|
</uni-td>
|
</uni-tr>
|
</uni-table>
|
</view>
|
|
|
<view class="plus-button-row">
|
<button type="warn" v-if="isUpdate && !isShowTable" @click="addTableRow">新增</button>
|
|
<button type="warn" v-if="isUpdate && !isShowTable" @click="delOne()">删除</button>
|
</view>
|
|
<view class="plus-button">
|
<button type="warn" v-if="isUpdate && !isShowTable" @tap="saveWorkTable">保存</button>
|
</view>
|
|
<view class="plus-button">
|
|
<button type="warn" v-if="isUpdate && !isShowTable" @tap="onshow">批量选择</button>
|
</view>
|
|
<multiple-select
|
v-model="show"
|
:data="DAA001List"
|
:default-selected="defaultSelected"
|
@confirm="confirm"
|
></multiple-select>
|
|
</view>
|
|
</scroll-view>
|
</view>
|
|
|
</view>
|
</template>
|
|
<script>
|
import multipleSelect from "@/components/momo-multipleSelect/momo-multipleSelect";
|
export default {
|
components: {
|
multipleSelect,
|
},
|
data() {
|
return {
|
formData: {
|
show: false,
|
createTime: "",
|
id: "",
|
billNo: "",
|
itemNo: "",
|
itemName: "",
|
workshopCode: "",
|
workshopName: "",
|
line: "",
|
lineName: "",
|
comments: "",
|
statusUser: "",
|
daa001: "",
|
daa002: "",
|
daa003: "",
|
daa004: "",
|
daa008: "",
|
type:"换线",
|
fsubmit: 0
|
},
|
tableWorkData: [],
|
DAA020List: [],
|
TypeList:["换线","人","机","料","法","环","重送检"],
|
DAA001List: [],
|
DAA001Lists: [],
|
schemeResult: [],
|
DAA001Index: -1,
|
TypeIndex: 0,
|
defaultSelected: [], //默认选中项
|
|
ItemList: [],
|
|
boardItems: [],
|
|
womdaaList: [],
|
|
tableData: [],
|
|
isSubmit: true,
|
|
isUpdate: true,
|
|
isShowTable: false,
|
|
currentTab: 0,
|
remarks: "",
|
remarksPopup: false,
|
show : false,
|
};
|
},
|
onLoad(options) {
|
//options中包含了url附带的参数
|
|
let params = options;
|
|
if (params["id"]) {
|
this.isUpdate = false;
|
this.formData.id = params["id"];
|
this.formData.billNo = params["billNo"];
|
this.init();
|
} else {
|
//初始化检验单号
|
this.$post({
|
url: "/SJ/GetMaxBillNo"
|
}).then(res => {
|
this.formData.billNo = res.data.tbBillList;
|
this.formData.createTime = this.$getDate("yyyy-mm-dd");
|
});
|
|
//产品编码下拉框的初始化
|
this.$post({
|
url: "/XJ/getLineAll"
|
}).then(res => {
|
this.lineList = res.data.tbBillList;
|
this.DAA020List = res.data.tbBillList.map(item => item.lineName);
|
this.formData.itemNo = "";
|
this.formData.itemName = "";
|
this.formData.workshopCode = "";
|
this.formData.workshopName = "";
|
this.formData.line = "";
|
this.formData.lineName = "";
|
this.formData.pbaid = null;
|
})
|
|
this.currentTab = 1;
|
}
|
},
|
// computed: {
|
// availableDAA001List() {
|
// // 使用 filter 方法排除已选择的 projName
|
// console.log('Calculating availableDAA001List'); // 调试输出
|
// return this.DAA001List.filter(item =>
|
// !this.tableWorkData.some(row => row.workNo === item.daa001)
|
// );
|
// }
|
// },
|
methods: {
|
addTableRow() {
|
|
// 检查tableWorkData中的最后一个元素是否为空
|
if (this.tableWorkData.length === 0 || (this.tableWorkData.length > 0
|
&& this.tableWorkData[this.tableWorkData.length - 1].workNo.trim() !== ''
|
&& String(this.tableWorkData[this.tableWorkData.length - 1].workQty).trim() !== '')) {
|
|
// 如果上一行数据不为空,则添加新行
|
this.tableWorkData.push({
|
workNo:"",
|
itemName:"",
|
workQty:0
|
}
|
);
|
|
//每次筛选前获得全部内容
|
this.DAA001List = this.DAA001Lists;
|
|
// 使用提取出来的 workNos 数组来过滤 DAA001List
|
this.DAA001List = this.DAA001List.filter(item => !this.tableWorkData.some(row => String(row.workNo) === String(item))
|
);
|
|
} else {
|
// 如果上一行数据为空,则提示用户填写上一行数据
|
this.$showMessage("请先填写上一行数据");
|
}
|
},
|
|
changeTab(index) {
|
|
this.currentTab = index;
|
},
|
|
onshow(){
|
|
|
|
//每次筛选前获得全部内容
|
this.DAA001List = this.schemeResult.map(item =>{
|
return{
|
value : item.daa001,
|
label : item.daa001,
|
daa003 : item.daa003,
|
daa008 : item.daa008
|
};
|
});
|
|
|
this.defaultSelected = this.tableWorkData.map((el) => el.workNo);
|
|
|
this.show = true;
|
|
|
|
|
|
},
|
confirm(data) {
|
console.log(data);
|
this.tableWorkData = data.map(el => {
|
return {
|
workNo : el.label,
|
itemName: el.daa003,
|
workQty: el.daa008
|
}
|
|
});
|
|
|
|
this.DAA001List = this.DAA001Lists
|
this.DAA001List = this.DAA001List.filter(item => !this.tableWorkData.some(row => String(row.workNo) === String(item))
|
);
|
|
|
|
},
|
|
onPickerChange(event, index) {
|
|
// 获取选择的值
|
var value = event.mp.detail.value;
|
this.formData.daa001 = this.DAA001List[value];
|
|
this.tableWorkData[index].workNo = this.DAA001List[value];
|
//每次筛选前获得全部内容
|
this.DAA001List = this.DAA001Lists;
|
// 使用提取出来的 workNos 数组来过滤 DAA001List
|
this.DAA001List = this.DAA001List.filter(item => !this.tableWorkData.some(row => String(row.workNo) === String(item))
|
);
|
|
|
this.$post({
|
url: "/SJ/getWrokNoDatile",
|
data: {
|
daa001: this.formData.daa001
|
}
|
}).then(res => {
|
//填充当前行数据
|
|
this.tableWorkData[index].itemName = res.data.tbBillList[0].itemName;
|
this.tableWorkData[index].workQty = res.data.tbBillList[0].workQty;
|
|
})
|
|
if ( this.tableWorkData[this.tableWorkData.length - 1].workNo.trim() == ''
|
&& String(this.tableWorkData[this.tableWorkData.length - 1].workQty).trim() == '0'){
|
return;
|
}
|
|
//默认新增添加一行空白
|
this.tableWorkData.push({
|
workNo:"",
|
itemName:"",
|
workQty:0
|
}
|
);
|
|
|
},
|
delOne() {
|
|
//每次筛选前获得全部内容
|
this.DAA001List = this.DAA001Lists;
|
// 使用提取出来的 workNos 数组来过滤 DAA001List
|
this.DAA001List = this.DAA001List.filter(item => !this.tableWorkData.some(row => String(row.workNo) === String(item)));
|
const lastIndex = this.tableWorkData.length - 1;
|
//删除单项
|
this.tableWorkData.splice(lastIndex, 1)
|
},
|
saveWorkTable() {
|
|
|
if (this.tableWorkData.length === 0 || (this.tableWorkData[this.tableWorkData.length - 1].workNo.trim() === '')) {
|
this.$showMessage("生产工单单据不能为空,请选择数据");
|
return;
|
};
|
|
if (this.tableWorkData.length > 0
|
&& this.tableWorkData[this.tableWorkData.length - 1].workNo.trim() == ''
|
&& String(this.tableWorkData[this.tableWorkData.length - 1].workQty).trim() == '0'){
|
|
//保存时最后一行空白默认删除
|
const lastIndex = this.tableWorkData.length - 1;
|
this.tableWorkData.splice(lastIndex, 1)
|
|
}
|
|
|
//表单中的部分字段赋值
|
this.$post({
|
url: "/SJ/SaveWorkNo",
|
data: {
|
Worknos: this.tableWorkData
|
|
}
|
}).then(res => {
|
let data = res.data.tbBillList[0];
|
|
//当返回的结果集为空时置空原有的值
|
if (!data) {
|
this.formData.daa001 = "";
|
this.formData.daa008 = "";
|
this.formData.daa003 = "";
|
this.formData.taskNo = "";
|
this.formData.daa002 = "";
|
this.tableData = [];
|
console.log(this.formData);
|
return;
|
}
|
//不为空时赋值
|
this.formData.daa001 = data.daa001;
|
this.formData.taskNo = data.taskNo;
|
this.formData.daa002 = data.daa002;
|
this.formData.daa003 = data.daa003;
|
this.formData.boardStyle = data.boardStyle;
|
this.formData.daa004 = data.daa004;
|
this.formData.mocode = data.mocode;
|
this.formData.daa008 = data.daa008;
|
this.formData.pbaid = data.id;
|
|
|
this.$post({
|
url: "/SJ/SetQSItems",
|
data: {
|
itemNo: this.formData.itemNo
|
}
|
}).then(res => {
|
if (res.data.tbBillList.length > 0) {
|
this.tableData = res.data.tbBillList; // 在箭头函数中,this 指向外层作用域的 this
|
this.isSubmit = false;
|
} else {
|
//this.$showMessage("此物料没有启用的检验项目,请维护!");
|
this.isSubmit = true;
|
this.tableData = [];
|
}
|
});
|
|
});
|
|
this.currentTab = 0;
|
|
},
|
removeXJ() {
|
if (this.formData.id) {
|
this.$post({
|
url: "/SJ/removeSJ",
|
data: {
|
id: this.formData.id
|
}
|
}).then(res => {
|
if (res.data.tbBillList > 0) {
|
this.$showMessage("删除成功");
|
//关闭当前页面,返回上一页面或多级页面
|
uni.navigateBack();
|
} else {
|
this.$showMessage("删除失败");
|
}
|
});
|
} else {
|
this.$showMessage("请先选择检验单号");
|
}
|
},
|
|
init() {
|
if (this.formData.id) {
|
this.$post({
|
url: "/SJ/GetPage",
|
data: {
|
pageIndex: 1,
|
limit: 1,
|
id: this.formData.id
|
}
|
}).then(res => {
|
let tbBillListElement = res.data.tbBillList[0];
|
if (tbBillListElement) {
|
this.formData = tbBillListElement;
|
this.$post({
|
url: "/SJ/getQSItems",
|
data: {
|
pid: this.formData.id
|
}
|
}).then(res => {
|
this.tableData = res.data.tbBillList;
|
|
this.tableData.sort((a, b) => {
|
if (a.result === '未完成' && b.result === '合格') {
|
return -1;
|
} else if (a.result === '合格' && b.result === '未完成') {
|
return 1;
|
} else {
|
return 0;
|
}
|
});
|
|
if (this.tableData.length <= 0) {
|
this.isShowTable = true;
|
}
|
})
|
|
//获取对应工单信息
|
this.$post({
|
url: "/SJ/getQSWorkno",
|
data: {
|
pid: this.formData.id
|
}
|
}).then(res => {
|
this.tableWorkData = res.data.tbBillList;
|
console.log(JSON.stringify(this.tableWorkData, null, 2));
|
})
|
|
|
|
}
|
})
|
}
|
},
|
onDaa020Change(event) {
|
//获取生产线别的下标地址
|
//this.formData.line = event;
|
|
this.lineNo = this.lineList[this.DAA020List.indexOf(event)].lineNo;
|
|
this.formData.line = this.lineNo;
|
|
this.$post({
|
url: "/XJ/getBoardItem",
|
data: {
|
lineNo: this.lineNo
|
}
|
}).then(res => {
|
//填充工单号的数据源
|
this.boardItems = res.data.tbBillList;
|
this.ItemList = this.boardItems.map(item => {
|
return {
|
...item, // 展开原始对象的属性
|
displayName: '['+item.itemNo + '-----' + item.itemName +']'
|
};
|
});
|
|
})
|
|
this.formData.itemNo = '';
|
this.formData.daa003 = '';
|
this.formData.daa004 = '';
|
|
},
|
onItemChange(event) {
|
|
this.formData.itemNo = event.itemNo;
|
this.formData.daa003 = event.itemName;
|
this.formData.daa004 = event.itemModel;
|
|
|
|
|
this.$post({
|
url: "/XJ/getDaa001",
|
data: {
|
daa020: this.lineNo,
|
item: this.formData.itemNo
|
}
|
}).then(res => {
|
//填充工单号的数据源
|
this.schemeResult = res.data.tbBillList;
|
this.DAA001List = this.schemeResult.map(s => s.daa001);
|
this.DAA001Lists = this.schemeResult.map(s => s.daa001);
|
//变为默认空值的状态
|
this.DAA001Index = -1;
|
this.formData.daa001 = "";
|
this.formData.daa002 = "";
|
//this.formData.daa003 = "";
|
//this.formData.daa004 = "";
|
this.formData.daa008 = "";
|
})
|
this.tableData = []
|
this.tableWorkData = []
|
|
|
|
},
|
//选取工单填充物料号和其他信息
|
onDaa001Change(event) {
|
|
|
this.DAA001Index = event.mp.detail.value;
|
this.formData.daa001 = this.schemeResult[this.DAA001Index].daa001;
|
|
|
//表单中的部分字段赋值
|
this.$post({
|
url: "/XJ/getItem",
|
data: {
|
daa001: this.formData.daa001
|
}
|
}).then(res => {
|
let data = res.data.tbBillList[0];
|
// 使用 filter 方法排除 tableWorkData 中已经存在的 daa001 值
|
|
//当返回的结果集为空时置空原有的值
|
if (!data) {
|
this.formData.daa001 = "";
|
this.formData.daa008 = "";
|
this.formData.daa003 = "";
|
this.formData.taskNo = "";
|
this.formData.daa002 = "";
|
this.tableData = [];
|
return;
|
}
|
|
|
//不为空时赋值
|
this.formData.daa001 = data.daa001;
|
this.formData.taskNo = data.taskNo;
|
this.formData.daa002 = data.daa002;
|
this.formData.daa003 = data.daa003;
|
this.formData.boardStyle = data.boardStyle;
|
this.formData.daa004 = data.daa004;
|
this.formData.mocode = data.mocode;
|
this.formData.daa008 = data.daa008;
|
this.formData.pbaid = data.id;
|
|
|
this.$post({
|
url: "/SJ/SetQSItems",
|
data: {
|
itemNo: this.formData.itemNo
|
}
|
}).then(res => {
|
if (res.data.tbBillList.length > 0) {
|
this.tableData = res.data.tbBillList; // 在箭头函数中,this 指向外层作用域的 this
|
this.isSubmit = false;
|
} else {
|
this.$showMessage("此物料没有启用的检验项目,请维护!");
|
this.isSubmit = true;
|
this.tableData = [];
|
}
|
});
|
|
});
|
},
|
|
onTypeChange(event) {
|
this.TypeIndex = event.mp.detail.value;
|
this.formData.type = this.TypeList[this.TypeIndex];
|
},
|
|
toDetail(item) {
|
if (this.isUpdate) {
|
uni.showToast({
|
icon: "none",
|
title: "请先生成检验项目",
|
duration: 2000,
|
});
|
} else {
|
uni.navigateTo({
|
url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData.id
|
});
|
}
|
},
|
getTable() {
|
this.$post({
|
url: "/SJ/SetQSItems",
|
data: {
|
itemNo: this.formData.itemNo
|
}
|
}).then(res => {
|
if (res.data.tbBillList.length > 0) {
|
this.tableData = res.data.tbBillList; // 在箭头函数中,this 指向外层作用域的 this
|
this.isShowTable = true;
|
this.isUpdate = true;
|
} else {
|
this.$showMessage("此物料没有启用的检验项目,请维护!");
|
this.isShowTable = true;
|
this.isUpdate = false;
|
this.tableData = [];
|
}
|
});
|
},
|
saveTable() {
|
if (this.tableData.length === 0) {
|
return;
|
}
|
|
this.$post({
|
url: "/SJ/SaveItem",
|
data: {
|
gid: this.formData.id,
|
items: this.tableData,
|
statusUser: this.$loginInfo.account
|
}
|
}).then(res => {
|
this.tableData = res.data.tbBillList.items;
|
this.isShowTable = false;
|
this.isUpdate = false;
|
})
|
},
|
save() {
|
|
|
if (this.tableWorkData.length === 0 ) {
|
this.$showMessage("生产工单单据不能为空,请选择数据");
|
return;
|
};
|
|
if (this.tableWorkData.length > 0
|
&& this.tableWorkData[this.tableWorkData.length - 1].workNo.trim() == ''
|
&& String(this.tableWorkData[this.tableWorkData.length - 1].workQty).trim() == '0'){
|
|
//保存时最后一行空白默认删除
|
const lastIndex = this.tableWorkData.length - 1;
|
this.tableWorkData.splice(lastIndex, 1)
|
|
}
|
|
|
this.formData.statusUser = this.$loginInfo.account;
|
|
|
//console.log(JSON.stringify(this.tableData, null, 2));
|
|
|
this.$post({
|
url: "/SJ/Save",
|
data: {
|
from: this.formData,
|
items: this.tableData,
|
worknos: this.tableWorkData
|
}
|
}).then(res => {
|
this.formData = res.data.tbBillList.result;
|
this.tableData = res.data.tbBillList.items;
|
this.isUpdate = false;
|
})
|
}, saveRemarks() {
|
this.remarksPopup = !this.remarksPopup;
|
this.remarks = this.formData.remarks;
|
},
|
toFtp(){
|
uni.navigateTo({
|
url: 'ftpFiles?itemno='+ this.formData.itemNo
|
});
|
},
|
editRemarks() {
|
if (this.remarks) {
|
//saveRemarksGid
|
this.$post({
|
url: "/SJ/saveRemarksGid",
|
data: {
|
gid: this.formData.id,
|
remarks: this.remarks
|
}
|
}).then(res => {
|
if (res.data.tbBillList > 0) {
|
this.formData.remarks = this.remarks;
|
this.remarksPopup = !this.remarksPopup;
|
this.$showMessage("保存成功");
|
}
|
})
|
}
|
},
|
toImage() {
|
uni.navigateTo({
|
url: 'ImageItem?id=' + this.formData.id
|
});
|
}
|
},
|
|
onShow() {
|
//每次进入页面都会执行的方法
|
this.init();
|
}
|
}
|
;
|
</script>
|
|
<style>
|
.form-group {
|
display: flex;
|
align-items: center;
|
border-bottom: 1px solid #c9c9c9;
|
}
|
|
.form-label {
|
margin-bottom: 0;
|
padding: 5px;
|
}
|
|
.form-input {
|
flex: 1;
|
margin-bottom: 0;
|
padding: 5px;
|
}
|
|
.container {
|
display: flex;
|
flex-direction: column;
|
}
|
|
.picker {
|
flex: 1;
|
margin-bottom: 0;
|
padding: 5px;
|
font-size: 12px;
|
}
|
|
.uni-form-item {
|
display: flex;
|
border-bottom: 1px solid #c9c9c9;
|
}
|
|
.edit {
|
background-color: white;
|
}
|
|
.tab-bar {
|
display: flex;
|
justify-content: space-around;
|
background-color: #f5f5f5;
|
padding: 10px;
|
border-bottom: 1px solid #ccc;
|
}
|
|
.tab-item {
|
flex: 1;
|
text-align: center;
|
padding: 10px;
|
border-radius: 5px;
|
background-color: #fff;
|
color: #007aff;
|
cursor: pointer;
|
font-size: 16px;
|
transition: background-color 0.3s, color 0.3s;
|
}
|
|
.tab-item.active {
|
background-color: #007aff;
|
color: #fff;
|
font-weight: bold;
|
}
|
|
/* 默认样式 */
|
.list-container {
|
height: 60vh;
|
/* 设置列表容器的高度为剩余空间,并减去表单容器的高度 */
|
overflow-y: auto;
|
/* 允许列表容器垂直滚动 */
|
padding: 10px;
|
/* 可选:添加一些内边距,使列表内容更美观 */
|
}
|
|
/* 在小屏幕设备上,重置高度为适应屏幕 */
|
@media (max-width: 768px) {
|
.list-container {
|
height: calc(100vh - 505px);
|
/* 适当调整高度 */
|
}
|
}
|
|
|
.form-container {
|
padding: 10px;
|
/* 可选:添加一些内边距,使表单内容更美观 */
|
}
|
|
.th {
|
background-color: lightskyblue;
|
color: #FFFFFF;
|
}
|
|
|
.plus-button {
|
line-height: 59px;
|
font-size: 24px;
|
cursor: pointer;
|
z-index: 1000;
|
margin-bottom: 10px;
|
}
|
|
.plus-button-row {
|
display: flex;
|
align-items: center;
|
margin-bottom: -10px;
|
}
|
|
.plus-button-row button {
|
flex-grow: 1; /* 使按钮填充可用空间 */
|
margin-right: 10px; /* 按钮之间的间隔 */
|
padding: 0px 20px; /* 根据需要调整内边距 */
|
font-size: 18px; /* 根据需要调整字体大小 */
|
}
|
|
.overlay {
|
position: fixed;
|
top: 0;
|
left: 0;
|
width: 100%;
|
height: 100%;
|
background-color: rgba(0, 0, 0, 0.5);
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.popup {
|
background-color: #fff;
|
padding: 20px;
|
border: 1px solid #ccc;
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
width: 68vw;
|
/* 设置宽度为视口宽度的80% */
|
height: 25vh;
|
/* 设置高度为视口高度的80% */
|
}
|
</style>
|