|
|
|
|
@ -15,7 +15,7 @@ |
|
|
|
|
ref="dynamicValidateForm" |
|
|
|
|
label-width="100px" |
|
|
|
|
class="demo-dynamic" |
|
|
|
|
:rules="rules" |
|
|
|
|
:rules="dynamicRules" |
|
|
|
|
> |
|
|
|
|
<div class="form-title">基本信息</div> |
|
|
|
|
<el-row> |
|
|
|
|
@ -83,7 +83,9 @@ |
|
|
|
|
v-model="sizeForm.ldTwoOutStorage.proposerInfo" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
style="width: 100%" |
|
|
|
|
:disabled="sizeForm.departmentId == ''" |
|
|
|
|
:disabled=" |
|
|
|
|
sizeForm.departmentId == '' || outDialogType == 'details' |
|
|
|
|
" |
|
|
|
|
clearable |
|
|
|
|
filterable |
|
|
|
|
value-key="userId" |
|
|
|
|
@ -102,7 +104,7 @@ |
|
|
|
|
<el-col :span="12" v-if="outDialogType == 'details'"> |
|
|
|
|
<el-form-item label="填报人"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="sizeForm.ldTwoOutStorage.submitName" |
|
|
|
|
v-model="sizeForm.ldTwoOutStorage.shipperName" |
|
|
|
|
:disabled="outDialogType != 'add'" |
|
|
|
|
></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
@ -114,6 +116,7 @@ |
|
|
|
|
size="mini" |
|
|
|
|
style="margin-bottom: 18px" |
|
|
|
|
@click="inTableAdd()" |
|
|
|
|
v-if="outDialogType != 'details'" |
|
|
|
|
>新增</el-button |
|
|
|
|
> |
|
|
|
|
<el-table |
|
|
|
|
@ -157,44 +160,35 @@ |
|
|
|
|
:min="1" |
|
|
|
|
style="width: 100%" |
|
|
|
|
:disabled="outDialogType != 'add'" |
|
|
|
|
@change="(newValue) => handleQuantityChange(newValue, scope.$index)" |
|
|
|
|
></el-input-number> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="form-title">出库账目表格:</div> |
|
|
|
|
<div class="form-title" v-if="outDialogType != 'details'"> |
|
|
|
|
出库账目表格: |
|
|
|
|
</div> |
|
|
|
|
<el-table |
|
|
|
|
:data="sizeForm.inAccountsTableData" |
|
|
|
|
border |
|
|
|
|
style="width: 100%" |
|
|
|
|
v-if="outDialogType != 'details'" |
|
|
|
|
> |
|
|
|
|
<el-table-column prop="date" label="当前库存"> |
|
|
|
|
<el-table-column prop="str1" label="编码"> </el-table-column> |
|
|
|
|
<el-table-column prop="str2" label="名称"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="sizeForm.type" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
style="width: 100%" |
|
|
|
|
:disabled="outDialogType != 'add'" |
|
|
|
|
> |
|
|
|
|
<el-option label="办公室物资" value="1"></el-option> |
|
|
|
|
<el-option label="其他物资" value="2"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
<el-table-column prop="materialCode" label="编码"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="str3" label="规格"> </el-table-column> |
|
|
|
|
<el-table-column prop="str4" label="类别"> </el-table-column> |
|
|
|
|
<el-table-column prop="str5" label="单位"> </el-table-column> |
|
|
|
|
<el-table-column prop="str6" label="数量"> </el-table-column> |
|
|
|
|
<el-table-column prop="num" label="单价"> </el-table-column> |
|
|
|
|
<el-table-column prop="materialName" label="名称"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="model" label="规格"> </el-table-column> |
|
|
|
|
<el-table-column prop="type" label="类别"> </el-table-column> |
|
|
|
|
<el-table-column prop="unit" label="单位"> </el-table-column> |
|
|
|
|
<el-table-column prop="oldNum" label="数量"> </el-table-column> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="date" label="出库信息"> |
|
|
|
|
<el-table-column prop="str8" label="数量"> </el-table-column> |
|
|
|
|
<el-table-column prop="str9" label="单价"> </el-table-column> |
|
|
|
|
<el-table-column prop="num" label="数量"> </el-table-column> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="date" label="出库后库存"> |
|
|
|
|
<el-table-column prop="str10" label="数量"> </el-table-column> |
|
|
|
|
<el-table-column prop="str11" label="单价"> </el-table-column> |
|
|
|
|
<el-table-column prop="newNum" label="数量"> </el-table-column> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</el-form> |
|
|
|
|
@ -202,7 +196,12 @@ |
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="handleCloseDetail()">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="sumbit()">确 定</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="outDialogType != 'details'" |
|
|
|
|
type="primary" |
|
|
|
|
@click="sumbit()" |
|
|
|
|
>确 定</el-button |
|
|
|
|
> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
@ -213,6 +212,7 @@ import { |
|
|
|
|
getUserList, |
|
|
|
|
getMaterialList, |
|
|
|
|
submit, |
|
|
|
|
getDetails, |
|
|
|
|
} from "@/api/secondOrder/outbound"; |
|
|
|
|
export default { |
|
|
|
|
props: { |
|
|
|
|
@ -232,6 +232,10 @@ export default { |
|
|
|
|
type: String, |
|
|
|
|
default: "", |
|
|
|
|
}, |
|
|
|
|
rowData: { |
|
|
|
|
type: Object, |
|
|
|
|
default: {}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
outDateInfo() { |
|
|
|
|
@ -242,6 +246,18 @@ export default { |
|
|
|
|
return `${year}年${month}月${day}日`; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
outDialogType: { |
|
|
|
|
immediate: true, |
|
|
|
|
handler(newVal) { |
|
|
|
|
if (newVal === "details") { |
|
|
|
|
this.dynamicRules = {}; // 清空校验规则 |
|
|
|
|
} else { |
|
|
|
|
this.dynamicRules = this.rules; // 恢复校验规则 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
outDialogVisible: false, |
|
|
|
|
@ -305,6 +321,7 @@ export default { |
|
|
|
|
materials: [], //物资列表 |
|
|
|
|
userOptions: [], //领用人列表 |
|
|
|
|
departmentOptions: [], //部门列表 |
|
|
|
|
dynamicRules: {}, // 动态校验规则 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
@ -318,6 +335,24 @@ export default { |
|
|
|
|
this.getDetailedItems(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 初始化 汇总库存 inAccountsTableData |
|
|
|
|
summaryTableData() { |
|
|
|
|
this.sizeForm.inAccountsTableData = JSON.parse(JSON.stringify(this.sizeForm.ldTwoOutStorageDetailList)) |
|
|
|
|
}, |
|
|
|
|
handleQuantityChange(newValue, index) { |
|
|
|
|
const currentRow = this.sizeForm.ldTwoOutStorageDetailList[index]; |
|
|
|
|
if (currentRow.materialCode != '') { |
|
|
|
|
currentRow.oldNum = currentRow.materialitem.num |
|
|
|
|
currentRow.num = currentRow.num |
|
|
|
|
currentRow.newNum = currentRow.materialitem.num - currentRow.num |
|
|
|
|
} |
|
|
|
|
this.$set(this.sizeForm.inAccountsTableData,index,currentRow) |
|
|
|
|
this.sizeForm.inAccountsTableData[index] = currentRow |
|
|
|
|
}, |
|
|
|
|
// 更新全局总计 |
|
|
|
|
updateGlobalTotal() { |
|
|
|
|
let totalAmount = 0; |
|
|
|
|
}, |
|
|
|
|
//获取单条选择的物资名称列表 |
|
|
|
|
async getMaterialList(value) { |
|
|
|
|
getMaterialList({ departmentId: value }).then((res) => { |
|
|
|
|
@ -326,6 +361,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 选中物资获取数据 |
|
|
|
|
handleMaterialChange(row, index) { |
|
|
|
|
console.log(99999,row) |
|
|
|
|
this.sizeForm.ldTwoOutStorageDetailList[index].materialId = |
|
|
|
|
row.materialId; |
|
|
|
|
this.sizeForm.ldTwoOutStorageDetailList[index].model = row.model; |
|
|
|
|
@ -335,11 +371,20 @@ export default { |
|
|
|
|
row.materialName; |
|
|
|
|
this.sizeForm.ldTwoOutStorageDetailList[index].type = row.type; |
|
|
|
|
this.sizeForm.ldTwoOutStorageDetailList[index].unit = row.unit; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 获取领用人列表 |
|
|
|
|
getUserList(value) { |
|
|
|
|
getUserList({ departmentId: value }).then((res) => { |
|
|
|
|
this.userOptions = res.data.result; |
|
|
|
|
if (this.outDialogType != "add") { |
|
|
|
|
let userArr = this.userOptions.filter( |
|
|
|
|
(item) => item.userId == this.sizeForm.ldTwoOutStorage.proposerId |
|
|
|
|
); |
|
|
|
|
this.sizeForm.ldTwoOutStorage.proposerInfo = |
|
|
|
|
userArr.length > 0 ? userArr[0] : {}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 获取部门列表 |
|
|
|
|
@ -358,7 +403,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 领用人选中 |
|
|
|
|
proposerChange(value) { |
|
|
|
|
console.log('领用人',value); |
|
|
|
|
console.log("领用人", value); |
|
|
|
|
this.sizeForm.ldTwoOutStorage.proposerId = value.userId; |
|
|
|
|
this.sizeForm.ldTwoOutStorage.proposerName = value.name; |
|
|
|
|
}, |
|
|
|
|
@ -366,7 +411,24 @@ export default { |
|
|
|
|
this.outDialogVisible = false; |
|
|
|
|
this.$emit("handleCloseDetail"); |
|
|
|
|
}, |
|
|
|
|
inInit() {}, |
|
|
|
|
inInit() { |
|
|
|
|
if (this.outDialogType != "add") { |
|
|
|
|
getDetails({ twoOutStorageId: this.rowData.id }).then((res) => { |
|
|
|
|
this.sizeForm = res.data.result; |
|
|
|
|
this.getUserList(this.sizeForm.ldTwoOutStorage.departmentId); |
|
|
|
|
|
|
|
|
|
let departmentArr = this.departmentOptions.filter( |
|
|
|
|
(item) => |
|
|
|
|
item.departmentId == this.sizeForm.ldTwoOutStorage.departmentId |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
this.sizeForm.ldTwoOutStorage.departmentInfo = |
|
|
|
|
departmentArr.length > 0 ? departmentArr[0] : {}; |
|
|
|
|
|
|
|
|
|
// this.sizeForm.ldTwoOutStorage.proposerInfo={} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addInit() { |
|
|
|
|
const now = new Date(); |
|
|
|
|
@ -382,6 +444,7 @@ export default { |
|
|
|
|
// 添加入库数据 |
|
|
|
|
inTableAdd() { |
|
|
|
|
this.sizeForm.ldTwoOutStorageDetailList.push({}); |
|
|
|
|
this.summaryTableData() |
|
|
|
|
}, |
|
|
|
|
// 提交 |
|
|
|
|
sumbit() { |
|
|
|
|
|