This commit is contained in:
ljx120 2025-01-15 11:44:54 +08:00
parent 04b67fd784
commit 5bf8cee482
7 changed files with 1263 additions and 3 deletions

View File

@ -375,6 +375,54 @@
"bounce": "none"
}
}
},
{
"path" : "pages/colorBlank/colorBlank",
"style" :
{
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true,
"app-plus": {
"bounce": "none"
}
}
},
{
"path" : "pages/colorBlank/defect",
"style" :
{
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true,
"app-plus": {
"bounce": "none"
}
}
},
{
"path" : "pages/colorBlank/quality",
"style" :
{
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true,
"app-plus": {
"bounce": "none"
}
}
},
{
"path" : "pages/colorBlank/physical",
"style" :
{
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true,
"app-plus": {
"bounce": "none"
}
}
}
],
"globalStyle": {

View File

@ -245,6 +245,7 @@
const itemList = ref({} as any)
const submit = () => {
console.log(dataItem.value);
// TODO
// postAction('/tracking', { orderId: itemList.value.id, type: itemList.value.type, data: dataItem.value, status: '' }).then((res : any) => {
// if (res.code === 200) {
@ -323,7 +324,7 @@
{{item.rc}}
</view>
<view class="grid-item">
<van-button :style="{backgroundColor: item.butonColor,color:'#fff'}"
<van-button :style="{backgroundColor: item.butonColor,color:'#fff',border:'none'}"
@click="toDetile(item)">{{item.status}}</van-button>
<p style="color: red;">{{item.processes.processes.find(l=>!l.id)?.name}}</p>
</view>

View File

@ -0,0 +1,663 @@
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue';
import { getAction, postAction } from '../../common/http';
import { formatDate } from '../../utils/date';
import { onShow } from '@dcloudio/uni-app';
import { showToast } from 'vant';
const form = ref({} as any)
const dataItem = ref({ shrq: formatDate(new Date())} as any)
const list = ref([] as any[])
const factory = ref([] as any[])
const nameList = ref([] as any[])
onMounted(() => {
getAction('/fabric/info/all').then((res : any) => {
if (res.code === 200) {
res.data.forEach((l : any) => {
let itemMl = mlList.value.find(m => m.text === l.commodity)
if (itemMl) {
let itemMm = itemMl.children.find(m => m.value === l.momme)
if (itemMm) {
itemMm.children.push({ text: l.width + 'cm', value: l.width })
} else {
itemMl.children.push({
text: l.momme + 'mm',
value: l.momme,
children: [{ text: l.width + 'cm', value: l.width }]
})
}
} else {
mlList.value.push({
text: l.commodity,
value: l.commodity,
children: [{ text: l.momme + 'mm', value: l.momme, children: [{ text: l.width + 'cm', value: l.width }] }]
})
}
})
}
})
//
getAction('/v1/user/getNames').then((res : any) => {
if (res.code === 200) {
nameList.value = res.data.map((l : any) => ({ value: l, text: l }))
}
})
//
getAction('/factory').then((res : any) => {
if (res.code === 200) {
factory.value = res.data.map((l : any) => ({ text: l.name, value: l.name }))
}
})
})
onShow(() => {
list.value = []
init()
//
uni.getStorage({
key: 'info',
success(res) {
let data = JSON.parse(res.data)
dataItem.value.shr = data.userName
},
fail: (err : any) => {
console.log(err);
}
})
})
const onClickLeft = () => {
history.back()
}
const onClickRight = () =>{
console.log(dataItem.value);
}
const total = ref(0)
const currentPage = ref(1)
const finished = ref(false)
const loading = ref(false);
//
const onLoad = () => {
if (list.value.length < total.value) {
currentPage.value++
init()
} else {
finished.value = true
}
};
function init() {
total.value = 0
getAction('/stockroom/uncheck', { page: currentPage.value, size: 10, ...form.value }).then((res : any) => {
if (res.code === 200) {
res.data.record.forEach((l : any) => {
if (isValidJSON(l.craftComment)) {
l.craftComment = JSON.parse(l.craftComment)
}
if (l.zt === '已出厂') {
l.butonColor = '#ff9e49'
l.status='收货'
}
list.value.push(l)
})
total.value += res.data.total * 1
loading.value = false;
finished.value = false
}
})
}
function isValidJSON(str : any) {
if (typeof str !== 'string') return false; //
try {
JSON.parse(str);
return true;
} catch (e) {
return false;
}
}
watch(form.value, () => {
list.value = []
init()
})
const showPicker = ref(false)
const typeData = ref()
const popuList = ref([] as any[])
//
const choosePic = (type : any) => {
showPicker.value = true
typeData.value = type
}
//
const pickerConfirm = (val : any) => {
form.value[typeData.value] = val.selectedValues[0]
showPickerCancel()
}
//
const showPickerCancel = () => {
showPicker.value = false
}
//
const handleOpen = () => {
if (typeData.value === 'factory') {
popuList.value = factory.value
} else {
popuList.value = nameList.value
}
}
//
const show = ref(false)
const dataType = ref('')
const chooseDate = (val : any) => {
show.value = true
dataType.value = val
}
const onConfirmDate = (val : any) => {
if (dataType.value == 'shrq') {
dataItem.value[dataType.value] = formatDate(val)
} else {
form.value[dataType.value] = formatDate(val)
}
show.value = false
}
const pickerList = ref([])//
const pickerContainerList = ref([])
const showPickerList = ref(false)
const searchValue = ref('')//
const searchIndex = ref(0)//
const mlList = ref([])
//
const selectChoose = () => {
showPickerList.value = true
}
//
const mlmcOpen = () => {
pickerList.value = mlList.value
pickerContainerList.value = pickerList.value
searchValue.value = ''
}
//
const pickerCancel = () => {
showPickerList.value = false
}
//
const selectedValue = ref()
const getSeachList = () => {
searchIndex.value = 0
let reg = new RegExp(searchValue.value)
let arr = []
pickerList.value.forEach(l => {
if (reg.test(l.text)) {
arr.push(l)
}
})
pickerContainerList.value = arr
}
//
const upSearch = () => {
if (searchIndex.value === 0 && pickerContainerList.value.length) {
searchIndex.value = pickerContainerList.value.length - 1
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
} else if (pickerContainerList.value.length) {
searchIndex.value--
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
} else {
showToast('没有了!')
}
}
//
const downSearch = () => {
if (pickerContainerList.value.length) {
if (searchIndex.value === pickerContainerList.value.length) {
searchIndex.value = 0
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
} else {
searchIndex.value++
selectedValue.value = [pickerContainerList.value[searchIndex.value].text]
}
} else {
showToast('没有了!')
}
}
//
const timer = ref()
const searchTo = () => {
if (timer.value) {
clearTimeout(timer.value)
}
timer.value = setTimeout(() => {
getSeachList()
}, 800)
}
const onConfirm = (val : any) => {
form.value.fabric = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1]
pickerCancel()
}
const showDialog = ref(false)
const itemList = ref({} as any)
const submit = () => {
console.log(dataItem.value);
// TODO
// postAction('/tracking', { orderId: itemList.value.id, type: itemList.value.type, data: dataItem.value, status: '' }).then((res : any) => {
// if (res.code === 200) {
// showDialog.value = false
// showToast('')
// }
// })
}
//
const computing = (list:any) =>{
let total=list.reduce((accumulator:any, currentValue:any) => {
return accumulator + currentValue.ms*1;
}, 0);
return total
}
//
const toDetile = (item:any) =>{
itemList.value=item
showDialog.value = true
}
</script>
<template>
<view class="flex">
<van-nav-bar title="色胚质检列表" left-text="返回" left-arrow @click-left="onClickLeft" right-text="新增" @click-right="onClickRight()" />
<van-cell-group inset style="display: flex;">
<van-field v-model="form.fabric" name="面料名称" label="面料名称" class="bor" colon label-width="5em" readonly
@click="selectChoose" />
<van-field v-model="form.makeUser" name="做单人员" label="做单人员" colon class="bor" label-width="5em" readonly
@click="choosePic('makeUser')" />
</van-cell-group>
<van-cell-group inset style="display: flex;">
<van-field v-model="form.color" name="颜色色号" label="颜色色号" colon class="bor-a" label-width="5em" />
<van-field v-model="form.belongTo" name="归属人员" label="归属人员" colon class="bor" label-width="5em" readonly
@click="choosePic('belongTo')" />
</van-cell-group>
<van-cell-group inset style="display: flex;">
<van-field v-model="form.sd" name="谁定" label="谁&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;定" colon
class="bor-a" label-width="5em" />
<van-field v-model="form.factory" name="面料来源" label="面料来源" colon class="bor" label-width="5em" readonly
@click="choosePic('factory')" />
</van-cell-group>
<view class="grid-container">
<view class="grid-item">面料/颜色</view>
<view class="grid-item">谁定/做单人/归属人<br>匹数/米数</view>
<view class="grid-item">面料来源</view>
<view class="grid-item">状态</view>
</view>
<view class="content">
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<view class="grid-container" v-for="(item,index) in list" :key="index">
<view class="grid-item">
<view class="grid-container1">
<view :class="indexSecond===(item.mls.length-1)?'grid-item2':'grid-item1'"
v-for="(itemSecond,indexSecond) in item.mls" :key="indexSecond">
{{itemSecond.mz}}<br>{{itemSecond.sh}}
</view>
</view>
</view>
<view class="grid-item">
<view class="grid-container1">
<view :class="indexSecond===(item.mls.length-1)?'grid-item2':'grid-item1'"
v-for="(itemSecond,indexSecond) in item.mls" :key="indexSecond">
{{item.sd}}/{{item.makeUser}}/{{item.belongTo}}<br>{{itemSecond.xxs.length}}/{{computing(itemSecond.xxs)}}
</view>
</view>
</view>
<view class="grid-item">
{{item.rc}}
</view>
<view class="grid-item">
<van-button :style="{backgroundColor: item.butonColor,color:'#fff',border:'none'}"
@click="toDetile(item)">{{item.status}}</van-button>
<p style="color: red;">{{item.processes.processes.find(l=>!l.id)?.name}}</p>
</view>
</view>
</van-list>
</view>
</view>
<van-dialog v-model:show="showDialog">
<view style="margin-top: 10rpx;">
<van-cell-group inset>
<van-field v-model="dataItem.shr" name="收货人" label="收货人" colon readonly label-width="5em"
class="bor-n" label-align="right" />
<van-field v-model="dataItem.shrq" name="收货日期" label="收货日期" colon label-width="5em" class="bor"
readonly @click="chooseDate('shrq')" label-align="right" />
</van-cell-group>
</view>
<template #footer>
<view class="footer-button">
<van-button plain size="small" style="width: 25vw;" @click="showDialog=false">
取消
</van-button>
<van-button size="small" type="success" style="width: 25vw;" @click="submit">
提交
</van-button>
</view>
</template>
</van-dialog>
<!--选择框-->
<van-popup v-model:show="showPicker" round position="bottom" @open="handleOpen">
<van-picker show-toolbar :columns="popuList" @confirm="pickerConfirm" @cancel="showPickerCancel"
ref="pickerRef" />
</van-popup>
<van-calendar v-model:show="show" @confirm="onConfirmDate" :min-date="new Date(2010, 0, 1)"
:max-date="new Date(2050, 0, 31)" />
<!-- 面料选择框-->
<van-popup v-model:show="showPickerList" position="bottom" @open="mlmcOpen">
<view class="select-model">
<van-picker :columns="pickerContainerList" @cancel="pickerCancel" v-model="selectedValue"
@confirm="onConfirm" />
<view>
<view class="top-select">
<view class="confirm-select">
<p>请选择品种</p>
</view>
<view class="search-box">
<view>
<van-search placeholder="请输入品种名字" v-model="searchValue" label="面料搜索:" background="#ffffff"
@input="searchTo()" :clearable="false" />
</view>
<view class="flex-btn">
<button class="search-btn" @click="upSearch()"></button>
<button class="search-btn" @click="downSearch()"></button>
</view>
</view>
</view>
</view>
</view>
</van-popup>
</template>
<style lang="scss" scoped>
.flex {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
font-size: 24rpx;
overflow-y: hidden;
.van-nav-bar {
width: 100%;
}
.grid-container {
display: grid;
grid-template-columns: 1.5fr 2fr 1.5fr 1fr;
padding: 0 15rpx;
.grid-item {
border: 1px solid #f2f2f2;
display: flex;
flex-direction: column;
text-align: center;
align-items: center;
justify-content: center;
.grid-container1 {
display: grid;
grid-template-columns: repeat(1, 1fr);;
width: 100%;
height: 100%;
.grid-item2 {
display: flex;
white-space: pre-line;
align-items: center;
justify-content: center;
padding: 5rpx;
word-break: break-all;
display: -webkit-box; /*将对象转为弹性盒模型展示*/
-webkit-box-orient: vertical; /*设置弹性盒模型子元素的排列方式*/
overflow: hidden; /*超出隐藏*/
}
.grid-item1 {
border-bottom: 1px solid #f2f2f2;
display: flex;
align-items: center;
justify-content: center;
padding: 5rpx;
word-break: break-all;
display: -webkit-box; /*将对象转为弹性盒模型展示*/
-webkit-box-orient: vertical; /*设置弹性盒模型子元素的排列方式*/
overflow: hidden; /*超出隐藏*/
}
}
}
}
.content {
flex: 1;
overflow-y: scroll;
font-size: 24rpx;
}
}
::v-deep .van-cell {
padding: 5px !important;
}
::v-deep .van-field {
font-size: 16px;
}
.bor {
::v-deep .van-field__control {
border: 1px solid #d7d7d7;
text-align: center;
}
::v-deep .van-field__label {
margin: 0;
}
}
.bor-a {
::v-deep .van-field__control {
border-bottom: 1px solid #d7d7d7;
text-align: center;
}
::v-deep .van-field__label {
margin: 0;
}
}
::v-deep .van-button--normal {
padding: 5px 8px;
height: 30px;
font-size: 22rpx;
}
::v-deep .van-field__control {
text-align: center;
font-size: 16px;
}
.footer-button {
margin: 20rpx;
display: flex;
justify-content: space-around;
}
/*面料选择搜索框*/
.select-model {
position: relative;
}
.confirm-select {
width: 100%;
}
.confirm-select>p {
text-align: center;
}
.confirm-select>button {
border: none;
background-color: #ffffff;
color: #388aed;
margin: 10px 30px 0 0;
}
.top-select {
position: absolute;
top: 30px;
left: 0;
right: 0;
margin: auto;
z-index: 999;
}
::v-deep .select-model .van-picker__toolbar {
height: 66px;
align-items: flex-start;
/*justify-content: flex-end;*/
}
::v-deep .select-model .van-picker__cancel,
.select-model .van-picker__confirm {
height: 30px;
padding: 10px 16px 0;
}
.search-btn {
padding: 1px 8px;
border: none;
background-color: #388aed;
color: #ffffff;
margin-left: 5px;
height: 30px;
line-height: 25px;
}
.search-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding-top: 15px;
padding-bottom: 5px;
position: relative;
background-color: #fff;
}
.van-search {
background-color: #f7f7f8;
}
.ml-search-jump {
padding: 3px 10px;
background-color: #388aed;
color: #ffffff;
border: none;
margin-left: 10px;
}
.flex-btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
/*面料选择搜索框*/
.select-model {
position: relative;
}
.confirm-select {
width: 100%;
}
.confirm-select>p {
text-align: center;
}
.confirm-select>button {
border: none;
background-color: #ffffff;
color: #388aed;
margin: 10px 30px 0 0;
}
.top-select {
position: absolute;
top: 30px;
left: 0;
right: 0;
margin: auto;
z-index: 999;
}
::v-deep .select-model .van-picker__toolbar {
height: 66px;
align-items: flex-start;
/*justify-content: flex-end;*/
}
::v-deep .select-model .van-picker__cancel,
.select-model .van-picker__confirm {
height: 30px;
padding: 10px 16px 0;
}
.search-btn {
padding: 1px 8px;
border: none;
background-color: #388aed;
color: #ffffff;
margin-left: 5px;
height: 30px;
line-height: 25px;
}
.search-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding-top: 15px;
padding-bottom: 5px;
position: relative;
background-color: #fff;
}
.van-search {
background-color: #f7f7f8;
}
.ml-search-jump {
padding: 3px 10px;
background-color: #388aed;
color: #ffffff;
border: none;
margin-left: 10px;
}
.flex-btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
</style>

197
pages/colorBlank/defect.vue Normal file
View File

@ -0,0 +1,197 @@
<script lang="ts" setup>
import { showConfirmDialog, showToast } from 'vant';
import { onMounted, ref } from 'vue'
import { deleteAction, getAction, postAction, putAction } from '../../common/http';
const showPop = ref(false)
const list = ref([] as any[])
const form = ref({} as any)
onMounted(() => {
init()
})
const init = () => {
getAction('/blemish',{page:1,size:100}).then((res : any) => {
if (res.code === 200) {
list.value = res.data.record
}
})
}
const onClickLeft = () => {
history.back()
}
const onClickRight = () => {
form.value = {}
showPop.value = true
}
const edit = (item : any) => {
form.value=JSON.parse(JSON.stringify(item))
showPop.value = true
}
const onSubmit = () => {
if (form.value.id) {
putAction('/blemish', form.value).then((res : any) => {
if (res.code === 200) {
init()
showPop.value = false
showToast('提交成功!')
}
})
} else {
postAction('/blemish', form.value).then((res : any) => {
if (res.code === 200) {
init()
showPop.value = false
showToast('提交成功!')
}
})
}
}
const del = (item : any) => {
showConfirmDialog({
title: '提示',
message: '是否确认删除?',
}).then(() => {
let url = '/blemish/' + item.id
deleteAction(url).then((res : any) => {
if (res.code === 200) {
init()
showToast('删除成功!')
}
})
})
.catch(() => {
// on cancel
});
}
</script>
<template>
<view class="flex">
<van-nav-bar title="色胚质检瑕疵维护" left-text="返回" left-arrow right-text="新增" @click-left="onClickLeft"
@click-right="onClickRight" />
<view class="content">
<view class="grid-container">
<view class="grid-item">编号</view>
<view class="grid-item">瑕疵名称</view>
<view class="grid-item">操作</view>
</view>
<view class="grid-container" v-for="(item,index) in list" :key="index">
<view class="grid-item">{{item.id}}</view>
<view class="grid-item">{{item.name}}</view>
<view class="grid-item"><span style="color: #35a5f7" @click="edit(item)">编辑</span> &nbsp;&nbsp; <span
style="color: red" @click="del(item)">删除
</span></view>
</view>
</view>
</view>
<van-popup v-model:show="showPop" style="width: 80%" round>
<view>
<h3 style="text-align: center">{{form.id?'编辑':'新增'}}</h3>
<van-form @submit="onSubmit">
<van-cell-group inset>
<van-field v-model="form.name" name="瑕疵名称" label="瑕疵名称" colon label-width="5em"
:rules="[{ required: true, message: '请填写' }]" />
</van-cell-group>
<view class="a-c">
<van-button type="danger" @click="showPop=false">取消</van-button>
<van-button type="primary" native-type="submit">确认</van-button>
</view>
</van-form>
</view>
</van-popup>
</template>
<style scoped lang="scss">
.flex {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
.van-nav-bar {
width: 100%;
}
.content {
flex: 1;
padding: 0 20rpx;
.grid-container {
display: grid;
grid-template-columns: 1fr 3fr 2fr;
.grid-item {
border: 1rpx solid #f2f2f2;
text-align: center;
::v-deep(.van-cell) {
padding: 0 10rpx;
}
}
}
.card {
margin: 20rpx 30rpx;
padding: 10rpx;
border: 1rpx solid #02a7f0;
border-radius: 20rpx;
}
}
}
.grid-container1 {
display: grid;
grid-template-columns: 2fr 1fr;
.grid-item {
border: 1rpx solid #f2f2f2;
text-align: center;
padding: 10rpx 0;
}
}
.a-b {
margin: 10rpx;
::v-deep .van-button--normal {
padding: 5px 8px;
height: 30px;
}
}
::v-deep .van-field {
font-size: 16px;
}
::v-deep .van-field__control {
border-bottom: 1rpx solid #d7d7d7;
text-align: center;
font-size: 16px;
}
::v-deep .van-field__label {
text-align: end !important;
}
.b-a {
::v-deep .van-field__control {
border-bottom: none;
}
}
.a-c {
display: flex;
align-items: center;
justify-content: space-around;
margin: 30rpx;
::v-deep .van-button--normal {
padding: 10rpx !important;
height: 60rpx;
}
}
</style>

View File

@ -0,0 +1,158 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { getAction, putAction } from '../../common/http';
import { showToast } from 'vant';
const list = ref([] as any[])
onMounted(() => {
init()
})
function init() {
getAction('/extraOption').then((res : any) => {
if (res.code === 200) {
list.value = JSON.parse(res.data.payload)
}
})
}
const onClickLeft = () => {
history.back()
}
const onClickRight = () => {
list.value.push({ options: [{}] })
}
//
const addxx = (item : any) => {
item.options.push({})
}
const onSubmit = () => {
let param = {
id: 1,
payload: JSON.stringify(list.value)
}
putAction('/extraOption', param).then((res : any) => {
if (res.code === 200) {
showToast('提交成功!')
init()
}
})
}
</script>
<template>
<view class="flex">
<van-nav-bar title="理化报告维护" left-text="返回" left-arrow right-text="新增" @click-left="onClickLeft"
@click-right="onClickRight" />
<view class="content">
<view class="card" v-for="(item,index) in list" :key="index">
<van-cell-group inset>
<view class="a-b">
<van-icon name="clear" color="red" size="25" @click="list.splice(index,1)" />
<van-field v-model="item.name" name="项目名称" label="项目名称" colon class="a-c" label-width="6em"
:rules="[{ required: true, message: '请填写' }]" />
<van-button type="primary" @click="addxx(item)">新增选项</van-button>
</view>
<view style="display: flex;align-items: center;margin: 10px 0;">
<view style="width: 80%;">
<van-field v-model="item.name1" name="标准值" label="标准值" colon class="a-c" label-width="3.5em"
:rules="[{ required: true, message: '请填写' }]" />
</view>
<van-field name="是否必填" label="是否必填" colon label-width="4.5em">
<template #input>
<van-radio-group v-model="item.necessary" direction="horizontal">
<van-radio :name="true"></van-radio>
<van-radio :name="false"></van-radio>
</van-radio-group>
</template>
</van-field>
</view>
</van-cell-group>
<view class="grid-container">
<view class="grid-item"></view>
<view class="grid-item">内容</view>
<view class="grid-item">是否符合</view>
<view class="grid-item">操作</view>
</view>
<view class="grid-container" v-for="(itemSecond,indexSecond) in item.options" :key="indexSecond">
<view class="grid-item">选项</view>
<view class="grid-item"> <van-field v-model="itemSecond.name" /></view>
<view class="grid-item" style="display: flex;align-items: center;justify-content: center">
<van-checkbox v-model="itemSecond.default" :name="true"></van-checkbox>
</view>
<view class="grid-item" style="color: red" @click="item.options.splice(indexSecond,1)">删除</view>
</view>
</view>
</view>
<van-button type="primary" style="margin: 10rpx;" @click="onSubmit">提交</van-button>
</view>
</template>
<style scoped lang="scss">
.flex {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
.van-nav-bar {
width: 100%;
}
.content {
flex: 1;
padding: 0 20rpx;
.grid-container {
display: grid;
grid-template-columns: 1fr 2fr 1.5fr 1.5fr;
.grid-item {
border: 1rpx solid #f2f2f2;
text-align: center;
::v-deep .van-cell {
padding: 0 10rpx;
}
}
}
.card {
margin: 16rpx 20rpx;
padding: 10rpx;
border: 1rpx solid #02a7f0;
border-radius: 20rpx;
}
.a-b {
display: flex;
align-items: center;
::v-deep .van-button--normal {
padding: 8rpx;
height: 50rpx;
width: 7em;
}
}
}
::v-deep .van-field {
font-size: 16px;
padding: 0;
}
::v-deep .van-cell-group--inset {
margin: 0;
}
.a-c {
::v-deep .van-field__control {
border-bottom: 1rpx solid #d7d7d7;
}
}
::v-deep .van-field__label {
text-align: end;
}
}
</style>

View File

@ -0,0 +1,172 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { getAction, putAction } from '../../common/http';
import { showToast } from 'vant';
const list = ref([] as any[])
onMounted(() => {
init()
})
function init() {
getAction('/testItem').then((res : any) => {
if (res.code === 200) {
list.value = JSON.parse(res.data.payload)
}
})
}
const onClickLeft = () => {
history.back()
}
const onClickRight = () => {
list.value.push({ options: [{}] })
}
//
const addxx = (item : any) => {
item.options.push({})
}
const onSubmit = () => {
let param = {
id: 1,
payload: JSON.stringify(list.value)
}
putAction('/testItem', param).then((res : any) => {
if (res.code === 200) {
showToast('提交成功!')
init()
}
})
}
</script>
<template>
<view class="flex">
<van-nav-bar title="色胚质检项维护" left-text="返回" left-arrow right-text="新增" @click-left="onClickLeft"
@click-right="onClickRight" />
<view class="content">
<view class="card" v-for="(item,index) in list" :key="index">
<van-cell-group inset>
<view class="a-b">
<van-icon name="clear" color="red" size="25" @click="list.splice(index,1)" />
<van-field v-model="item.name" name="质检项名称" label="质检项名称" colon class="a-c" label-width="6em"
:rules="[{ required: true, message: '请填写' }]" />
<van-button type="primary" @click="addxx(item)">新增选项</van-button>
</view>
<van-field label=" " label-width="7.5em" style="margin: 15rpx 0;">
<template #input>
<van-radio-group v-model="item.type" direction="horizontal">
<van-radio name="Text">填空</van-radio>
<van-radio name="Select">选择</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field name="是否必填" label="是否必填" colon label-width="7.5em">
<template #input>
<van-radio-group v-model="item.necessary" direction="horizontal">
<van-radio :name="true"></van-radio>
<van-radio :name="false"></van-radio>
</van-radio-group>
</template>
</van-field>
</van-cell-group>
<view v-if="item.type=='Select'">
<view class="grid-container">
<view class="grid-item"></view>
<view class="grid-item">内容</view>
<view class="grid-item">是否默认</view>
<view class="grid-item">操作</view>
</view>
<view class="grid-container" v-for="(itemSecond,indexSecond) in item.options" :key="indexSecond">
<view class="grid-item">选项</view>
<view class="grid-item"> <van-field v-model="itemSecond.name" /></view>
<view class="grid-item" style="display: flex;align-items: center;justify-content: center">
<van-checkbox v-model="itemSecond.default" :name="true"></van-checkbox>
</view>
<view class="grid-item" style="color: red" @click="item.options.splice(indexSecond,1)">删除</view>
</view>
</view>
<view v-if="item.type=='Text'" style="margin-top: 15rpx;">
<van-field name="填写内容" label="填写内容" colon label-width="7.5em">
<template #input>
<van-checkbox-group v-model="item.contentType" direction="horizontal"
shape="square">
<van-checkbox name="Text">文字</van-checkbox>
<van-checkbox name="File">图片</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</view>
</view>
</view>
<van-button type="primary" style="margin: 10rpx;" @click="onSubmit">提交</van-button>
</view>
</template>
<style scoped lang="scss">
.flex {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
.van-nav-bar {
width: 100%;
}
.content {
flex: 1;
padding: 0 20rpx;
.grid-container {
display: grid;
grid-template-columns: 1fr 2fr 1.5fr 1.5fr;
.grid-item {
border: 1rpx solid #f2f2f2;
text-align: center;
::v-deep .van-cell {
padding: 0 10rpx;
}
}
}
.card {
margin: 16rpx 20rpx;
padding: 10rpx;
border: 1rpx solid #02a7f0;
border-radius: 20rpx;
}
.a-b {
display: flex;
align-items: center;
::v-deep .van-button--normal {
padding: 8rpx;
height: 50rpx;
width: 7em;
}
}
}
::v-deep .van-field {
font-size: 16px;
padding: 0;
}
::v-deep .van-cell-group--inset {
margin: 0;
}
.a-c {
::v-deep .van-field__control {
border-bottom: 1rpx solid #d7d7d7;
}
}
::v-deep .van-field__label {
text-align: end;
}
}
</style>

View File

@ -103,11 +103,32 @@ const ListData =ref([
name:'跟单列表',
type:'',
},
// {
// path:'../Delivery/Delivery',
// name:'',
// type:'',
// },
{
path:'../Delivery/Delivery',
name:'待收货列表',
path:'../colorBlank/colorBlank',
name:'色胚质检列表',
type:'',
},
{
path:'../colorBlank/defect',
name:'色胚质检瑕疵维护',
type:'',
},
{
path:'../colorBlank/quality',
name:'色胚质检项维护',
type:'',
},
{
path:'../colorBlank/physical',
name:'理化报告选项维护',
type:'',
}
] as any[])