|
@@ -329,6 +329,117 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 自定义新增弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="insertFromTitle"
|
|
|
+ :visible.sync="insertFrom"
|
|
|
+ :before-close="insertFromClose"
|
|
|
+ width="800px"
|
|
|
+ >
|
|
|
+ <div style="width: 800px">
|
|
|
+ <el-form ref="form" :label-position="labelPosition" label-width="100px" :model="insertFormData">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="供应商:" prop="supplier">
|
|
|
+ <el-select v-model="insertFormData.supplierNo" style="width: 200px;" placeholder="请选择供应商">
|
|
|
+ <el-option
|
|
|
+ v-for="(option, index) in suppliers"
|
|
|
+ :key="option.id"
|
|
|
+ :label="option.supplierName"
|
|
|
+ :value="option.supplierNo"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="批号:" prop="lotNumber">
|
|
|
+ <el-input v-model="insertFormData.lotNumber" style="width: 200px;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="使用部门:" prop="useDepartment">
|
|
|
+ <el-input v-model="insertFormData.useDepartment" style="width: 200px;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="备注:" prop="remark">
|
|
|
+ <el-input v-model="insertFormData.remark" style="width: 200px;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="insertTable"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+<!-- -->
|
|
|
+<!-- <el-table-column-->
|
|
|
+<!-- align="center"-->
|
|
|
+<!-- prop="id"-->
|
|
|
+<!-- label="序号"-->
|
|
|
+<!-- width="80">-->
|
|
|
+<!-- </el-table-column>-->
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="materielId"
|
|
|
+ label="物料信息"
|
|
|
+ width="180">
|
|
|
+ <template v-slot:default="scope">
|
|
|
+ <el-select v-model="scope.row.materielId" size="small" placeholder="请选择物料">
|
|
|
+ <el-option
|
|
|
+ v-for="(option, index) in materiels"
|
|
|
+ :key="index"
|
|
|
+ :label="option.materielName"
|
|
|
+ :value="option.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="quantity"
|
|
|
+ label="数量/重量"
|
|
|
+ width="180">
|
|
|
+ <template v-slot:default="scope">
|
|
|
+ <el-input v-model="scope.row.quantity" size="small"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="remark"
|
|
|
+ label="备注">
|
|
|
+ <template v-slot:default="scope">
|
|
|
+ <el-input v-model="scope.row.remark" size="small"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template v-slot:default="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ @click="handleRowDelete(scope.$index, scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- 添加一行数据 -->
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="buttonAdd"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="addRow"
|
|
|
+ >添加一行</el-button>
|
|
|
+
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="insertFrom=false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="insertTableRequest">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 打印弹窗 -->
|
|
|
<el-dialog title="采购单详情" :visible.sync="viewPurchaseOrderDetailsShow" width="1000px">
|
|
|
<div class="titleDiv">
|
|
@@ -411,8 +522,8 @@ import {
|
|
|
btnCommonApi,
|
|
|
addTableData,
|
|
|
batchEdit,
|
|
|
- getStatisticList,
|
|
|
} from "@/api/tablelist/commonTable";
|
|
|
+import {getListSupplier, getListMateriel, addPurchase, getPurchaseInfos, updatePurchase} from "@/api/supplier/supplier";
|
|
|
import { listData } from "@/api/system/tenant/data";
|
|
|
import { getPurchaseInfo } from "@/api/tablelist/purchaseInfo";
|
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -434,6 +545,13 @@ export default {
|
|
|
components: { Queryfrom, Menu, DialogTemplate, FormList, BtnMenuList },
|
|
|
data() {
|
|
|
return {
|
|
|
+ insertTable: [],
|
|
|
+ labelPosition: 'right',
|
|
|
+ insertFromTitle:'',
|
|
|
+ insertFormData:{},
|
|
|
+ suppliers:[{"id":1,"name":"供应商1"}],
|
|
|
+ insertFrom:false,
|
|
|
+ materiels:[],
|
|
|
particularsOfSalesNote:{
|
|
|
purchaseOrderNumber:"",
|
|
|
supplierName:"",
|
|
@@ -579,6 +697,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+
|
|
|
// 得到当前展示的table的唯一标识
|
|
|
this.tableKey = this.$route.query.tableKey;
|
|
|
},
|
|
@@ -599,6 +718,118 @@ export default {
|
|
|
// },
|
|
|
},
|
|
|
methods: {
|
|
|
+ caiGouUpdate(btnInfo,row){
|
|
|
+ this.insertFromTitle = "修改采购信息";
|
|
|
+ this.insertFrom = true;
|
|
|
+ this.insertFormData={}
|
|
|
+ this.insertTable=[];
|
|
|
+ this.getListMateriel();
|
|
|
+ this.getListSupplier();
|
|
|
+ console.log(row)
|
|
|
+ // row.purchaseId getInfoEditPurchaseId PurchaseId
|
|
|
+ getPurchaseInfos(row.purchaseSerialNumber).then(res=>{
|
|
|
+ this.insertFormData=res.data;
|
|
|
+ this.insertTable=res.data.purchaseInfos;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ insertTableRequest(){
|
|
|
+ if(this.insertFromTitle=="新增采购信息"){
|
|
|
+ console.log(this.insertFormData.supplierNo)
|
|
|
+ if(this.insertFormData.supplierNo!=undefined&&this.insertFormData.lotNumber!=undefined&&this.insertFormData.useDepartment!=undefined&&this.insertFormData.remark!=undefined){
|
|
|
+ //携带表格数据
|
|
|
+ this.insertFormData.purchaseInfos=this.insertTable;
|
|
|
+ addPurchase(this.insertFormData).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.$message({
|
|
|
+ message: '添加成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.insertFrom = false;
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: '添加失败',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: '请完善表单',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ console.log(this.insertFormData.supplierNo)
|
|
|
+ if(this.insertFormData.supplierNo!=undefined&&this.insertFormData.lotNumber!=undefined&&this.insertFormData.useDepartment!=undefined&&this.insertFormData.remark!=undefined){
|
|
|
+ //携带表格数据
|
|
|
+ this.insertFormData.purchaseInfos=this.insertTable;
|
|
|
+ updatePurchase(this.insertFormData).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.insertFrom = false;
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: '修改失败',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: '请完善表单',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //原材料信息
|
|
|
+ getListMateriel(){
|
|
|
+ getListMateriel().then(res=>{
|
|
|
+ this.materiels=res.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //供应商信息
|
|
|
+ getListSupplier(){
|
|
|
+ getListSupplier().then(res=>{
|
|
|
+ this.suppliers=res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //删除一行
|
|
|
+ handleRowDelete($index,rwo){
|
|
|
+ this.insertTable.splice($index,1)
|
|
|
+ },
|
|
|
+ //添加一行
|
|
|
+ addRow(){
|
|
|
+ // 添加一行数据 id materielId quantity remark
|
|
|
+ const newRow = {
|
|
|
+ id: this.insertTable.length+1,
|
|
|
+ materielId: undefined,
|
|
|
+ quantity: undefined,
|
|
|
+ remark:undefined,
|
|
|
+ disableInput: false,
|
|
|
+ };
|
|
|
+ this.insertTable.push(newRow);
|
|
|
+ },
|
|
|
+ //关闭逻辑
|
|
|
+ insertFromClose(){
|
|
|
+ this.insertFrom = false;
|
|
|
+ },
|
|
|
+ insertFromHander(){
|
|
|
+ this.insertFromTitle = "新增采购信息";
|
|
|
+ // this.insertFormData.supplierNo=undefined
|
|
|
+ // this.insertFormData.lotNumber=undefined
|
|
|
+ // this.insertFormData.useDepartment=undefined
|
|
|
+ // this.insertFormData.remark=undefined
|
|
|
+ this.insertFormData={};
|
|
|
+ this.insertTable=[];
|
|
|
+ this.insertFrom = true;
|
|
|
+ this.getListSupplier();
|
|
|
+ this.getListMateriel();
|
|
|
+ },
|
|
|
//打印逻辑方法
|
|
|
toPrint(rwoIndex,row){
|
|
|
console.log(rwoIndex,row);
|
|
@@ -617,7 +848,6 @@ export default {
|
|
|
stringInner +"@"+
|
|
|
row.materieColorNumber +"@"+
|
|
|
row.materielId
|
|
|
- alert(codeString)
|
|
|
// const encodePwd = Base64.encode(codeString);//加密
|
|
|
const encodePwd = encodeURIComponent(codeString)
|
|
|
|
|
@@ -695,9 +925,17 @@ export default {
|
|
|
btnShowCondition: "",
|
|
|
children: [],
|
|
|
});
|
|
|
+ this.excuteBtnArr[0].children.push({
|
|
|
+ btnName: "采购修改",
|
|
|
+ btnType: "caiGouUpdate",
|
|
|
+ btnIcon: "el-icon-edit",
|
|
|
+ btnShowCondition: "",
|
|
|
+ children: [],
|
|
|
+ });
|
|
|
this.topBtnArr = res.data.resultMap.button?.filter(
|
|
|
(item) => item.btnGroupType == "top"
|
|
|
);
|
|
|
+ console.log(this.topBtnArr,"dddddddddd");
|
|
|
this.calcuteExcuteCol();
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.tableRef.doLayout();
|
|
@@ -742,15 +980,15 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
|
|
|
- // 查询统计信息
|
|
|
- getStatisticList({
|
|
|
- queryMap: {
|
|
|
- tableKey: this.templateInfo.template.tableKey,
|
|
|
- queryCriteriaValue: this.queryParams.queryMap.queryCriteriaValue,
|
|
|
- },
|
|
|
- }).then((res) => {
|
|
|
- this.statisticList = res.data;
|
|
|
- });
|
|
|
+ // // 查询统计信息
|
|
|
+ // getStatisticList({
|
|
|
+ // queryMap: {
|
|
|
+ // tableKey: this.templateInfo.template.tableKey,
|
|
|
+ // queryCriteriaValue: this.queryParams.queryMap.queryCriteriaValue,
|
|
|
+ // },
|
|
|
+ // }).then((res) => {
|
|
|
+ // this.statisticList = res.data;
|
|
|
+ // });
|
|
|
});
|
|
|
},
|
|
|
isUpperCase(char) {
|
|
@@ -1041,13 +1279,13 @@ export default {
|
|
|
let tablesubKey = res.data.result.dragTables[1].tableKey;
|
|
|
|
|
|
// 查询统计信息
|
|
|
- getStatisticList({
|
|
|
- queryMap: {
|
|
|
- tableKey: tablesubKey,
|
|
|
- },
|
|
|
- }).then((res) => {
|
|
|
- this.subCount = res.data;
|
|
|
- });
|
|
|
+ // getStatisticList({
|
|
|
+ // queryMap: {
|
|
|
+ // tableKey: tablesubKey,
|
|
|
+ // },
|
|
|
+ // }).then((res) => {
|
|
|
+ // this.subCount = res.data;
|
|
|
+ // });
|
|
|
|
|
|
let prmKey = this.templateInfo.template.primaryKey;
|
|
|
let pkey = prmKey.replace(/_([a-z])/g, (match, p1) =>
|
|
@@ -1069,9 +1307,9 @@ export default {
|
|
|
data.queryMap[key] =
|
|
|
"'" + obj[this.templateInfo.template.primaryKey] + "'";
|
|
|
|
|
|
- getStatisticList(data).then((res) => {
|
|
|
- this.tableCount = res.data;
|
|
|
- });
|
|
|
+ // getStatisticList(data).then((res) => {
|
|
|
+ // this.tableCount = res.data;
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
// let fieldList = Object.keys(resultMap);
|
|
@@ -2107,6 +2345,9 @@ export default {
|
|
|
case "viewPurchaseOrderDetails":
|
|
|
this.viewPurchaseOrderDetails(btnData, row);
|
|
|
break;
|
|
|
+ case "caiGouUpdate":
|
|
|
+ this.caiGouUpdate(btnData, row);
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -2152,7 +2393,10 @@ export default {
|
|
|
this.handleBatchDelete();
|
|
|
break;
|
|
|
case "INSERT":
|
|
|
+ //拖拽逻辑
|
|
|
this.handleUpdate(row, btnData);
|
|
|
+ //手写逻辑
|
|
|
+ // this.insertFromHander();
|
|
|
break;
|
|
|
case "IMPORT":
|
|
|
this.upload.open = true;
|