临时提交

This commit is contained in:
磷叶 2025-02-28 18:03:24 +08:00
parent 6e97ee69f8
commit a8e2a54991
7 changed files with 54 additions and 26 deletions

View File

@ -288,6 +288,16 @@ aside {
padding-left: 0px;
padding-right: 0px;
}
.el-input__inner {
padding: 0 4px;
}
.el-input-number.is-controls-right .el-input__inner{
padding-left: 4px;
padding-right: 28px;
}
.el-textarea__inner {
padding: 4px;
}
}
.table-form.el-table th.el-table__cell > .cell {

View File

@ -51,8 +51,7 @@ export default {
},
templateUrl: {
type: String,
default: null,
required: true
default: null
},
templateName: {
type: String,

View File

@ -20,7 +20,7 @@
<el-descriptions-item label="订单" :span="2">{{ order.orderNo | dv}}</el-descriptions-item>
<el-descriptions-item label="订单日期" :span="2">{{ order.orderDate | dv}}</el-descriptions-item>
<el-descriptions-item label="客户" :span="2">{{ order.customer | dv}}</el-descriptions-item>
<el-descriptions-item label="订单数量" :span="2">{{ order.num | dv}}</el-descriptions-item>
<el-descriptions-item label="订单数量" :span="2">{{ order.num | dv}} {{order.unit}}</el-descriptions-item>
</el-descriptions>
</div>
</div>

View File

@ -21,7 +21,7 @@
</div>
</template>
</el-table-column>
<table-form-col label="加工方式" prop-prefix="prodList" prop="workType" :rules="rules.workType" required width="90">
<table-form-col label="加工方式" prop-prefix="prodList" prop="workType" :rules="rules.workType" required width="70">
<el-select slot-scope="d" v-model="d.row.workType" placeholder="请选择加工方式">
<el-option v-for="item in dict.type.order_prod_work_type" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
@ -29,7 +29,7 @@
<table-form-col label="加工商" prop-prefix="prodList" prop="workName" :rules="rules.workName" >
<el-input slot-scope="d" v-if="d.row.workType === ProdWorkType.BUY" v-model="d.row.workName" placeholder="请输入加工商"/>
</table-form-col>
<table-form-col label="序号" prop-prefix="prodList" prop="no" :rules="rules.no" width="60" >
<table-form-col label="序号" prop-prefix="prodList" prop="no" :rules="rules.no" width="50" >
<el-input slot-scope="d" v-model="d.row.no" placeholder="请输入序号"/>
</table-form-col>
<table-form-col label="图片" prop-prefix="prodList" prop="picture" width="60">
@ -50,10 +50,11 @@
<template v-slot:content-tip="d">{{d.row.name}}</template>
<el-input slot-scope="d" v-model="d.row.name" placeholder="请输入名称"/>
</table-form-col>
<!-- <table-form-col label="成品" prop-prefix="prodList" prop="isEnd" width="60" tips="成品,表示该产品是成品,订单有且仅有一个成品">
<table-form-col label="成品" prop-prefix="prodList" prop="isEnd" width="40" tips="成品,表示该产品是成品,订单有且仅有一个成品">
<el-checkbox slot-scope="d" :value="d.row.isEnd" @change="handleIsEndChange(d.index)"/>
</table-form-col> -->
<table-form-col label="装量" prop-prefix="prodList" prop="contentNum" required :rules="rules.contentNum" width="100">
</table-form-col>
<table-form-col label="装量" prop-prefix="prodList" prop="contentNum" required :rules="rules.contentNum" width="60" show-overflow-tooltip>
<template v-slot:content-tip="d">{{d.row.contentNum}}</template>
<el-input-number
slot-scope="d"
v-model="d.row.contentNum"
@ -64,7 +65,8 @@
@change="(nv, ov) => handleContentNumChange(d.row, nv, ov)"
/>
</table-form-col>
<table-form-col label="订单数量" prop-prefix="prodList" prop="num" required :rules="rules.num">
<table-form-col label="订单数量" prop-prefix="prodList" prop="num" required :rules="rules.num" width="90" show-overflow-tooltip>
<template v-slot:content-tip="d">{{d.row.num}}</template>
<el-input-number slot-scope="d" v-model="d.row.num" placeholder="请输入数量" :min="0" :precision="0" controls-position="right" style="width: 100%"/>
</table-form-col>
<table-form-col label="处理方式" prop-prefix="prodList" prop="handleWay" show-overflow-tooltip>

View File

@ -1,8 +1,8 @@
<template>
<div v-loading="loading">
<edit-header :title="title">
<el-button @click="downloadTemplate" v-permi="['bst:order:parseExcelData']" icon="el-icon-download" size="small" type="text">下载导入模板</el-button>
<el-button plain @click="importExcel" v-permi="['bst:order:parseExcelData']" icon="el-icon-upload" size="small" type="success">从Excel导入</el-button>
<el-button @click="downloadTemplate" v-has-permi="['bst:order:parseExcelData']" icon="el-icon-download" size="small" type="text">下载导入模板</el-button>
<el-button plain @click="importExcel" v-has-permi="['bst:order:parseExcelData']" icon="el-icon-upload" size="small" type="success">从Excel导入</el-button>
<el-button plain @click="cancel" icon="el-icon-close" size="small">取消</el-button>
<el-button type="primary" plain @click="submitForm(false)" icon="el-icon-check" size="small">保存</el-button>
<el-button type="primary" @click="submitForm(true)" icon="el-icon-s-check" size="small" v-if="form.id == null || OrderStatus.canRelease().includes(form.status)">保存并发布</el-button>
@ -32,21 +32,18 @@
<form-col :span="span" label="客人代码" prop="customer">
<el-input v-model="form.customer" placeholder="请输入客人代码"/>
</form-col>
<!-- <form-col :span="span" label="产品名称" prop="name">
<el-input v-model="form.name" placeholder="请输入产品名称"/>
</form-col> -->
<form-col :span="span" label="数量" prop="num">
<el-input-number v-model="form.num" :min="0" controls-position="right" style="width: 100%;"/>
<el-input v-model="form.num" placeholder="请输入数量" type="number">
<template #append>
<el-select v-model="form.unit" placeholder="请选择单位" style="width: 6em">
<el-option v-for="dict of dict.type.order_unit" :label="dict.label" :value="dict.value"/>
</el-select>
</template>
</el-input>
</form-col>
<form-col :span="span" label="用料" prop="material">
<el-input v-model="form.material" placeholder="请输入用料"/>
</form-col>
<!-- <form-col :span="span" label="装量" prop="contentNum">
<el-input-number v-model="form.contentNum" :min="0" controls-position="right" style="width: 100%;" placeholder="请输入装量"/>
</form-col> -->
<!-- <form-col :span="span" label="包装尺寸" prop="packageSize">
<el-input v-model="form.packageSize" placeholder="请输入包装尺寸"/>
</form-col> -->
<form-col :span="24" label="特殊要求" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入特殊要求" :maxlength="1000" show-word-limit :autosize="{minRows: 3, maxRows: 10}"/>
</form-col>
@ -86,6 +83,7 @@ import ImportDialog from '@/components/ImportDialog/index.vue'
export default {
name: "OrderEdit",
dicts: ['order_unit'],
components: { OrderProdList, FormCol, EditHeader, ImportDialog },
data() {
return {
@ -141,7 +139,7 @@ export default {
methods: {
//
downloadTemplate() {
window.open('https://api.ccttiot.com/伟旺-生产订单导入模板-1740563272753.xlsx', '_blank');
window.open('https://api.ccttiot.com/伟旺-生产订单导入模板-1740733089263.xlsx', '_blank');
},
handleImportSuccess(data) {
let head = data.head;
@ -153,6 +151,7 @@ export default {
this.form.num = head['数量'];
this.form.material = head['用料'];
this.form.remark = head['特殊要求'];
this.form.unit = head['单位'];
}
let body = data.body;
if (body != null) {
@ -177,6 +176,7 @@ export default {
this.form = {
id: null,
orderNo: null,
unit: "套",
picture: null,
deliveryDate: null,
num: null,
@ -195,6 +195,11 @@ export default {
submitForm(submit) {
this.$refs["form"].validate(valid => {
if (valid) {
let error = this.validate(this.form);
if (error != null) {
this.$message.error(error);
return;
}
this.$confirm(`确定要保存${submit ? '并发布' : ''}吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -223,6 +228,15 @@ export default {
}
});
},
validate(form) {
//
let endProd = form.prodList.filter(p => p.isEnd);
if (endProd.length != 1) {
return "订单中必须有且只能有一个成品";
}
return null;
},
cancel() {
this.$tab.closeBack();
}

View File

@ -148,6 +148,9 @@
<template v-else-if="column.key === 'progress'">
<el-progress :percentage="d.row.progress" :color="ProgressColors" :format="ProgressFormat"/>
</template>
<template v-else-if="['num', 'reportNum', 'storeNum'].includes(column.key)">
{{d.row[column.key] | dv}}{{d.row.unit}}
</template>
<template v-else>
{{d.row[column.key]}}
</template>

View File

@ -42,19 +42,19 @@
<div class="progress-stats">
<div class="stat-item">
<div class="stat-label">订单数量</div>
<div class="stat-value">{{ detail.num || 0 }}</div>
<div class="stat-value">{{ detail.num | dv }} {{detail.unit}}</div>
</div>
<div class="stat-item">
<div class="stat-label">总数量</div>
<div class="stat-value">{{ detail.totalNum || 0 }}</div>
<div class="stat-value">{{ detail.totalNum | dv }} {{detail.unit}}</div>
</div>
<div class="stat-item">
<div class="stat-label">汇报生产数</div>
<div class="stat-value">{{ detail.reportNum || 0 }}</div>
<div class="stat-value">{{ detail.reportNum | dv }} {{detail.unit}}</div>
</div>
<div class="stat-item">
<div class="stat-label">仓库清点数</div>
<div class="stat-value">{{ detail.storeNum || 0 }}</div>
<div class="stat-value">{{ detail.storeNum | dv }} {{detail.unit}}</div>
</div>
</div>
</div>