|
@@ -12,12 +12,35 @@
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
<el-button
|
|
|
+ v-if="disabled"
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
class="el-button--small-yh"
|
|
|
@click.stop="openEdit"
|
|
|
>编 辑</el-button>
|
|
|
<el-button
|
|
|
+ v-if="checker && form.status != 3"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ class="el-button--small-yh"
|
|
|
+ @click.stop="openCheckDialog">
|
|
|
+ 审批
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="form.status > 0"
|
|
|
+ @click.native="checkScheduleDialog = true, checkId=form.id"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ >审核进度</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="!checkDisabled"
|
|
|
+ :disabled="!form.id || disabled"
|
|
|
+ size="small"
|
|
|
+ @click="pleaseCheck"
|
|
|
+ :loading="btnLoading"
|
|
|
+ >请核</el-button>
|
|
|
+ <el-button
|
|
|
type="success"
|
|
|
:disabled="!form.id"
|
|
|
size="small"
|
|
@@ -41,31 +64,33 @@
|
|
|
v-model="form"
|
|
|
:option="option"
|
|
|
>
|
|
|
- <template slot="createUser">
|
|
|
+ <template slot="applyUser">
|
|
|
<el-select
|
|
|
- v-model="form.createUser"
|
|
|
+ v-model="form.applyUser"
|
|
|
filterable
|
|
|
clearable
|
|
|
size="small"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item,index) in userList"
|
|
|
:key="index"
|
|
|
:label="item.realName"
|
|
|
- :value="item.realName"
|
|
|
+ :value="item.id"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
- <template slot="deptId">
|
|
|
+ <template slot="applyDept">
|
|
|
<avue-input-tree
|
|
|
leaf-only
|
|
|
style="width: 100%;"
|
|
|
size="small"
|
|
|
:props="{ label: 'title' }"
|
|
|
- v-model="form.deptId"
|
|
|
+ v-model="form.applyDept"
|
|
|
placeholder=" "
|
|
|
type="tree"
|
|
|
:dic="dic"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
></avue-input-tree>
|
|
|
</template>
|
|
|
</avue-form>
|
|
@@ -86,6 +111,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
@click.stop="newDetails"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>录入明细</el-button>
|
|
|
<el-button
|
|
|
type="info"
|
|
@@ -99,12 +125,14 @@
|
|
|
icon="el-icon-edit"
|
|
|
type="text"
|
|
|
@click="rowCell(row, index)"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
|
type="text"
|
|
|
@click="rowDel(row, index)"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
<template slot="code" slot-scope="{ row, index }">
|
|
@@ -207,6 +235,22 @@
|
|
|
<template slot="storageQuantity" slot-scope="{ row, index }">
|
|
|
<span>{{ row.storageQuantity | IntegerFormat }}</span>
|
|
|
</template>
|
|
|
+ <template slot="storageId" slot-scope="{ row, index }">
|
|
|
+ <el-select
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.storageId"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in storageOptions"
|
|
|
+ :key="index"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.cname"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <span v-else>{{ row.storageName }}</span>
|
|
|
+ </template>
|
|
|
<template slot="remarks" slot-scope="{ row, index }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
@@ -304,6 +348,43 @@
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ append-to-body
|
|
|
+ title="审批"
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="checkDialog"
|
|
|
+ width="50%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ v-dialog-drag
|
|
|
+ >
|
|
|
+ <check
|
|
|
+ :checkData="checkData"
|
|
|
+ :checkDetail="false"
|
|
|
+ :idList="[]"
|
|
|
+ @choceCheckFun="choceCheckFun"
|
|
|
+ >
|
|
|
+ </check>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ append-to-body
|
|
|
+ title="审批进度"
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="checkScheduleDialog"
|
|
|
+ width="40%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ v-dialog-drag
|
|
|
+ >
|
|
|
+ <check-schedule
|
|
|
+ :checkId="checkId"
|
|
|
+ :batchNo="batchNo"
|
|
|
+ @choceScheduleFun="choceScheduleFun"
|
|
|
+ >
|
|
|
+ </check-schedule>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -322,11 +403,26 @@ import { gainUser } from "@/api/basicData/customerInquiry";
|
|
|
import {getUserInfo} from "@/api/system/user";
|
|
|
import {getDeptTree} from "@/api/system/dept";
|
|
|
import { getCurrentDate } from "@/util/date";
|
|
|
+import {dataDetail, typeSave, removeGoods, pleaseCheck} from "@/api/officeSupplies/requisition";
|
|
|
+import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
+import check from "@/components/check/check";
|
|
|
+import checkSchedule from "@/components/check/checkSchedule";
|
|
|
+import {customerList as storageList} from "@/api/basicData/basicStorageDesc";
|
|
|
|
|
|
export default {
|
|
|
name: "detail",
|
|
|
+ props: {
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ check,
|
|
|
+ checkSchedule,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ disabled: false,
|
|
|
pageLoading: false,
|
|
|
btnLoading: false,
|
|
|
form: {},
|
|
@@ -336,7 +432,7 @@ export default {
|
|
|
column: [
|
|
|
{
|
|
|
label: "领用人",
|
|
|
- prop: "createUser",
|
|
|
+ prop: "applyUser",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -349,7 +445,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "部门",
|
|
|
- prop: "deptId",
|
|
|
+ prop: "applyDept",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -362,7 +458,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "领用时间",
|
|
|
- prop: "b",
|
|
|
+ prop: "applyTime",
|
|
|
span: 8,
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
@@ -446,6 +542,16 @@ export default {
|
|
|
total: 0
|
|
|
},
|
|
|
dic: [],
|
|
|
+ oldForm: {},
|
|
|
+ oldDataList: [],
|
|
|
+ checkDisabled: false, // 审核状态
|
|
|
+ checker: false,
|
|
|
+ checkId: '',
|
|
|
+ batchNo:'',
|
|
|
+ checkDialog: false,
|
|
|
+ checkScheduleDialog: false,
|
|
|
+ checkData: {},
|
|
|
+ storageOptions: [],
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
@@ -457,23 +563,46 @@ export default {
|
|
|
this.getColumnName(93),
|
|
|
goodsOption
|
|
|
);
|
|
|
- getGoods(1, 500).then(res => {
|
|
|
- this.goodsoptions = res.data.data.records;
|
|
|
+ getGoods(1, 10).then(res => {
|
|
|
+ if (res.data.data.total > 0) {
|
|
|
+ this.goodsoptions = res.data.data.records;
|
|
|
+ if (Math.ceil(res.data.data.total / 10) > 1) {
|
|
|
+ for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
|
|
|
+ getGoods(i, 10).then(e => {
|
|
|
+ this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
gainUser().then(res => {
|
|
|
this.userList = res.data.data;
|
|
|
});
|
|
|
getUserInfo().then(res => {
|
|
|
- this.$set(this.form, 'createUser', res.data.data.realName);
|
|
|
- this.$set(this.form, 'deptId', res.data.data.deptId);
|
|
|
+ this.$set(this.form, 'applyUser', res.data.data.id);
|
|
|
+ this.$set(this.form, 'applyDept', res.data.data.deptId);
|
|
|
})
|
|
|
getDeptTree().then(res => {
|
|
|
this.dic = res.data.data
|
|
|
})
|
|
|
+ storageList().then(res => {
|
|
|
+ this.storageOptions = res.data.data.records;
|
|
|
+ })
|
|
|
this.getWorkDicts('unit').then(res => {
|
|
|
this.unitOption = res.data.data;
|
|
|
})
|
|
|
- this.$set(this.form, 'b', getCurrentDate()); // 默认当前日期
|
|
|
+ this.$set(this.form, 'applyTime', getCurrentDate()); // 默认当前日期
|
|
|
+ if (this.detailData.query) {
|
|
|
+ this.disabled = true;
|
|
|
+ this.option.column.map(e => {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ })
|
|
|
+ this.queryData(this.detailData.id);
|
|
|
+ } else if (this.detailData.auditId) {
|
|
|
+ this.checker = true;
|
|
|
+ this.batchNo = this.detailData.check.batchNo
|
|
|
+ this.queryData(this.detailData.id);
|
|
|
+ }
|
|
|
},
|
|
|
filters: {
|
|
|
IntegerFormat(num) {
|
|
@@ -484,12 +613,40 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 查询
|
|
|
+ queryData(id) {
|
|
|
+ this.pageLoading = true;
|
|
|
+ dataDetail(id).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.dataList = this.form.orderItemsList? this.form.orderItemsList: [];
|
|
|
+ this.oldForm = {...this.form};
|
|
|
+ this.oldDataList = [...this.dataList];
|
|
|
+ delete this.form.orderItemsList;
|
|
|
+ this.checkDisabled = this.form.status > 0? true: false;
|
|
|
+ if (this.form.status > 0) {
|
|
|
+ this.option.column.map(e => {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.pageLoading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
this.$emit("goBack");
|
|
|
},
|
|
|
// 编辑按钮触发
|
|
|
- openEdit() {},
|
|
|
+ openEdit() {
|
|
|
+ this.disabled = false;
|
|
|
+ this.option.column.map(e => {
|
|
|
+ if (this.checkDisabled) {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ } else {
|
|
|
+ this.$set(e, 'disabled', false)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 复制
|
|
|
copyDoc() {
|
|
|
this.$emit("copyOrder", this.form.id);
|
|
@@ -499,13 +656,16 @@ export default {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
- // this.btnLoading = true;
|
|
|
- // typeSave(this.form).then(res => {
|
|
|
- // this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
|
- // this.queryData(res.data.data.id);
|
|
|
- // }).finally(() => {
|
|
|
- // this.btnLoading = false;
|
|
|
- // })
|
|
|
+ this.btnLoading = true;
|
|
|
+ this.form.billType = 'OLY';
|
|
|
+ this.form.tradeType = 'OLY';
|
|
|
+ this.$set(this.form, 'orderItemsList', this.dataList);
|
|
|
+ typeSave(this.form).then(res => {
|
|
|
+ this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
|
+ this.queryData(res.data.data);
|
|
|
+ }).finally(() => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ })
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
@@ -567,13 +727,13 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- // removeGoods(row.id).then(res => {
|
|
|
- // this.$message({
|
|
|
- // type: 'success',
|
|
|
- // message: '删除成功!'
|
|
|
- // })
|
|
|
- // this.dataList.splice(row.$index, 1);
|
|
|
- // })
|
|
|
+ removeGoods(row.id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ })
|
|
|
+ this.dataList.splice(row.$index, 1);
|
|
|
+ })
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
@@ -751,6 +911,7 @@ export default {
|
|
|
price: e.price,
|
|
|
amount: 0,
|
|
|
orderQuantity: 0,
|
|
|
+ storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
|
|
|
$cellEdit: true
|
|
|
});
|
|
|
});
|
|
@@ -766,6 +927,7 @@ export default {
|
|
|
amount: 0,
|
|
|
orderQuantity: 0,
|
|
|
price: e.price,
|
|
|
+ storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
|
|
|
$cellEdit: true
|
|
|
});
|
|
|
});
|
|
@@ -773,6 +935,57 @@ export default {
|
|
|
}
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
+ // 验证新旧值对比
|
|
|
+ verification() {
|
|
|
+ if (contrastObj(this.form, this.oldForm) ||
|
|
|
+ contrastList(this.dataList, this.oldDataList)) {
|
|
|
+ this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.editCustomer();
|
|
|
+ }).catch(() => {
|
|
|
+ return false; //取消改动数据
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //打开审核
|
|
|
+ openCheckDialog(){
|
|
|
+ this.checkData = this.detailData.check
|
|
|
+ this.checkDialog = true;
|
|
|
+ },
|
|
|
+ //关闭审核
|
|
|
+ choceCheckFun(){
|
|
|
+ this.checkDialog = false;
|
|
|
+ },
|
|
|
+ choceScheduleFun(){
|
|
|
+ this.checkScheduleDialog = false
|
|
|
+ },
|
|
|
+ // 请核
|
|
|
+ pleaseCheck() {
|
|
|
+ if (this.verification()) {
|
|
|
+ const data = {
|
|
|
+ id : this.form.id,
|
|
|
+ checkType: 'oly',
|
|
|
+ url: '/workManagement/requisition/index',
|
|
|
+ pageStatus:"this.$store.getters.officeLyStatus",
|
|
|
+ pageLabel:"领用",
|
|
|
+ checkFlag: 2,
|
|
|
+ }
|
|
|
+ this.btnLoading = true;
|
|
|
+ pleaseCheck(data).then(res => {
|
|
|
+ this.$message.success('请核成功')
|
|
|
+ this.queryData(this.form.id)
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('请核失败')
|
|
|
+ }).finally(() => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|