|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
<div style="width: 100%; padding: 0px 15px">
|
|
|
- <el-form :model="formData.data" :rules="rules" ref="formDom" label-position="top" :disabled="judgeStatus()">
|
|
|
+ <el-form
|
|
|
+ :model="formData.data"
|
|
|
+ :rules="rules"
|
|
|
+ ref="formDom"
|
|
|
+ label-position="top"
|
|
|
+ :disabled="judgeStatus()"
|
|
|
+ >
|
|
|
<div class="_t">申购信息</div>
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="6">
|
|
@@ -24,56 +30,116 @@
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="申购部门" prop="deptName">
|
|
|
- <el-input v-model="formData.data.deptName" placeholder="请输入" disabled> </el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="formData.data.deptName"
|
|
|
+ placeholder="请输入"
|
|
|
+ disabled
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="申购人" prop="subcribeName">
|
|
|
- <el-input v-model="formData.data.subcribeName" placeholder="请输入" disabled> </el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="formData.data.subcribeName"
|
|
|
+ placeholder="请输入"
|
|
|
+ disabled
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="申购时间" prop="subcribeTime">
|
|
|
- <el-date-picker v-model="formData.data.subcribeTime" type="datetime" placeholder="请选择" disabled />
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formData.data.subcribeTime"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="请选择"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-form-item label="申购说明" prop="subcribeContent">
|
|
|
- <el-input v-model="formData.data.subcribeContent" placeholder="请输入" type="textarea"> </el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="formData.data.subcribeContent"
|
|
|
+ placeholder="请输入"
|
|
|
+ type="textarea"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
<div class="_t">申购明细</div>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="openProduct = true" style="margin: 10px 0"> 添加货品 </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="openProduct = true"
|
|
|
+ style="margin: 10px 0"
|
|
|
+ >
|
|
|
+ 添加货品
|
|
|
+ </el-button>
|
|
|
<el-table :data="formData.data.subscribeDetailList">
|
|
|
- <el-table-column prop="goodType" label="货品类型" :formatter="(row) => (row.goodType == 1 ? '产品' : '物料')" />
|
|
|
+ <el-table-column
|
|
|
+ prop="goodType"
|
|
|
+ label="货品类型"
|
|
|
+ :formatter="(row) => (row.goodType == 1 ? '产品' : '物料')"
|
|
|
+ />
|
|
|
<el-table-column prop="code" label="货品编码" />
|
|
|
<el-table-column prop="name" label="货品名称" min-width="150" />
|
|
|
<el-table-column prop="spec" label="规格型号" />
|
|
|
- <el-table-column prop="unit" label="单位" :formatter="(row) => dictValueLabel(row.unit, productUnit)" />
|
|
|
+ <el-table-column
|
|
|
+ prop="unit"
|
|
|
+ label="单位"
|
|
|
+ :formatter="(row) => dictValueLabel(row.unit, productUnit)"
|
|
|
+ />
|
|
|
<el-table-column prop="count" label="申购数量" min-width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item :prop="'subscribeDetailList.' + $index + '.count'" :rules="rules.count" :inline-message="true">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="row.count" :precision="4" :controls="false" :min="1" />
|
|
|
+ <el-form-item
|
|
|
+ :prop="'subscribeDetailList.' + $index + '.count'"
|
|
|
+ :rules="rules.count"
|
|
|
+ :inline-message="true"
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ onmousewheel="return false;"
|
|
|
+ v-model="row.count"
|
|
|
+ :precision="4"
|
|
|
+ :controls="false"
|
|
|
+ :min="1"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="remark" label="备注" min-width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item :prop="'subscribeDetailList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'subscribeDetailList.' + $index + '.remark'"
|
|
|
+ :rules="rules.remark"
|
|
|
+ :inline-message="true"
|
|
|
+ >
|
|
|
<el-input v-model="row.remark" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="zip" label="操作" width="100">
|
|
|
<template #default="{ $index }">
|
|
|
- <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
|
|
|
+ <el-button type="primary" link @click="handleRemove($index)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-dialog v-if="openProduct" v-model="openProduct" title="选择货品" width="70%" append-to-body>
|
|
|
- <SelectGoods :selectList="acquireSelectList()" @cancel="openProduct = false" @pushGoods="pushGoods"></SelectGoods>
|
|
|
+ <el-dialog
|
|
|
+ v-if="openProduct"
|
|
|
+ v-model="openProduct"
|
|
|
+ title="选择货品"
|
|
|
+ width="70%"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <SelectGoods
|
|
|
+ :selectList="acquireSelectList()"
|
|
|
+ @cancel="openProduct = false"
|
|
|
+ @pushGoods="pushGoods"
|
|
|
+ ></SelectGoods>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -96,10 +162,16 @@ let formData = reactive({
|
|
|
},
|
|
|
});
|
|
|
let rules = ref({
|
|
|
- corporationId: [{ required: true, message: "请选择归属公司", trigger: "change" }],
|
|
|
+ corporationId: [
|
|
|
+ { required: true, message: "请选择归属公司", trigger: "change" },
|
|
|
+ ],
|
|
|
deptName: [{ required: true, message: "请输入申购部门", trigger: "blur" }],
|
|
|
- subcribeName: [{ required: true, message: "请输入申购人名称", trigger: "blur" }],
|
|
|
- subcribeTime: [{ required: true, message: "请选择申购时间", trigger: "change" }],
|
|
|
+ subcribeName: [
|
|
|
+ { required: true, message: "请输入申购人名称", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ subcribeTime: [
|
|
|
+ { required: true, message: "请选择申购时间", trigger: "change" },
|
|
|
+ ],
|
|
|
// subcribeContent: [
|
|
|
// { required: true, message: "请输入申购事由", trigger: "blur" },
|
|
|
// ],
|
|
@@ -120,9 +192,14 @@ const handleRemove = (index) => {
|
|
|
const pushGoods = (goods) => {
|
|
|
if (goods && goods.length > 0) {
|
|
|
let afterFiltering = [];
|
|
|
- if (formData.data.subscribeDetailList && formData.data.subscribeDetailList.length > 0) {
|
|
|
+ if (
|
|
|
+ formData.data.subscribeDetailList &&
|
|
|
+ formData.data.subscribeDetailList.length > 0
|
|
|
+ ) {
|
|
|
afterFiltering = goods.filter((item) => {
|
|
|
- let data = formData.data.subscribeDetailList.filter((itemProduct) => itemProduct.bussinessId === item.id);
|
|
|
+ let data = formData.data.subscribeDetailList.filter(
|
|
|
+ (itemProduct) => itemProduct.bussinessId === item.id
|
|
|
+ );
|
|
|
if (data && data.length > 0) {
|
|
|
return false;
|
|
|
}
|
|
@@ -141,7 +218,8 @@ const pushGoods = (goods) => {
|
|
|
count: "",
|
|
|
remark: "",
|
|
|
}));
|
|
|
- formData.data.subscribeDetailList = formData.data.subscribeDetailList.concat(arr);
|
|
|
+ formData.data.subscribeDetailList =
|
|
|
+ formData.data.subscribeDetailList.concat(arr);
|
|
|
openProduct.value = false;
|
|
|
return ElMessage({
|
|
|
message: "添加成功!",
|
|
@@ -184,27 +262,16 @@ const judgeStatus = () => {
|
|
|
return true;
|
|
|
}
|
|
|
if (props.queryData.recordList && props.queryData.recordList.length > 0) {
|
|
|
- let data = props.queryData.recordList.filter((item) => item.status === 2 && item.nodeType !== 1);
|
|
|
+ let data = props.queryData.recordList.filter(
|
|
|
+ (item) => item.status === 2 && item.nodeType !== 1
|
|
|
+ );
|
|
|
if (data && data.length > 0) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
-};;
|
|
|
+};
|
|
|
|
|
|
-watch(
|
|
|
- props.queryData,
|
|
|
- () => {
|
|
|
- if (props.queryData && ["10", "20", "30"].includes(route.query.processType)) {
|
|
|
- for (const key in props.queryData) {
|
|
|
- formData.data[key] = props.queryData[key];
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- deep: true,
|
|
|
- }
|
|
|
-);
|
|
|
const productUnit = ref([]);
|
|
|
const companyData = ref([]);
|
|
|
|
|
@@ -232,7 +299,10 @@ defineExpose({
|
|
|
});
|
|
|
const acquireSelectList = () => {
|
|
|
let data = [];
|
|
|
- if (formData.data.subscribeDetailList && formData.data.subscribeDetailList.length > 0) {
|
|
|
+ if (
|
|
|
+ formData.data.subscribeDetailList &&
|
|
|
+ formData.data.subscribeDetailList.length > 0
|
|
|
+ ) {
|
|
|
data = formData.data.subscribeDetailList.map((item) => {
|
|
|
return {
|
|
|
id: item.bussinessId,
|
|
@@ -246,35 +316,34 @@ const emit = defineEmits(["auxiliaryChange"]);
|
|
|
let auxiliaryData = ref([
|
|
|
{
|
|
|
label: "最近合同",
|
|
|
- data:[
|
|
|
+ data: [
|
|
|
[
|
|
|
{
|
|
|
- label:"合同编号",
|
|
|
- value:'12312312312456',
|
|
|
- fn:()=>{
|
|
|
- console.log(formData.data)
|
|
|
+ label: "合同编号",
|
|
|
+ value: "12312312312456",
|
|
|
+ fn: () => {
|
|
|
+ console.log(formData.data);
|
|
|
},
|
|
|
- style:{
|
|
|
- color:'red'
|
|
|
+ style: {
|
|
|
+ color: "red",
|
|
|
},
|
|
|
- num:1,
|
|
|
+ num: 1,
|
|
|
},
|
|
|
{
|
|
|
- label:"合同编号",
|
|
|
- value:'123456',
|
|
|
- fn:()=>{
|
|
|
- alert('点击事件')
|
|
|
- }
|
|
|
- }
|
|
|
+ label: "合同编号",
|
|
|
+ value: "123456",
|
|
|
+ fn: () => {
|
|
|
+ alert("点击事件");
|
|
|
+ },
|
|
|
+ },
|
|
|
],
|
|
|
-
|
|
|
],
|
|
|
},
|
|
|
]);
|
|
|
const auxiliaryChange = (data) => {
|
|
|
emit("auxiliaryChange", data);
|
|
|
};
|
|
|
-auxiliaryChange(auxiliaryData)
|
|
|
+auxiliaryChange(auxiliaryData);
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|