commit by yzf

master
Yang 3 years ago
parent 22128711a3
commit d594af6475

@ -0,0 +1,64 @@
import http from '../http';
//获取协同集合
export async function getTeamworkPageList(param) {
param = param || { FPageIndex: 1, FPageSize: 10 };
let result = {};
await http.post('/api/MaterialTeamwork/GetTeamworkPageList', param).then((data) => {
result = data;
});
return result;
}
//获取流程集合
export async function getTeamProcessList(teamId) {
let param = { FPageIndex: 1, FPageSize: 999, FTeamID: teamId };
let result = [];
await http.post('/api/MaterialTeamwork/GetTeamProcessList', param).then((data) => {
result = data.Data.List || [];
});
return result;
}
//获取协同视图信息
export async function getTeamworkView(param) {
let result = {};
await http.post('/api/MaterialTeamwork/GetTeamworkView', param).then((data) => {
result = data.Data;
});
return result;
}
//下载BOM
export async function downloadBOM(teamId) {
let param = { FTeamID: teamId };
let result = [];
await http.post('/api/MaterialTeamwork/DockDownBomData', param).then((data) => {
result = data;
});
return result;
}
export async function EditTypeList(param) {
let result = [];
await http.post('/api/MaterialTeamwork/EditTypeList', param).then((data) => {
result = data;
});
return result;
}
export async function InsertDataModel(param) {
let result = [];
await http.post('/api/MaterialTeamwork/InsertDataModel', param).then((data) => {
result = data;
});
return result;
}
export async function GetMaterialTeamworkPageList(param) {
let result = [];
await http.post('/api/MaterialTeamwork/GetTeamworkPageList', param).then((data) => {
result = data;
});
return result;
}

@ -203,9 +203,10 @@ export default {
viewType: this.dataInfoObj.FViewType
});
console.log('_data', _data);
debugger
if (this.dataInfoObj.FViewType == 1 || this.dataInfoObj.FViewType == 10) {
this.inputCodeValue = _data.rows[0].HalfCode;
this.inputDescValue = _data.rows[0].HalfDesc;
this.inputCodeValue = _data.rows[0]?_data.rows[0].HalfCode:"";
this.inputDescValue = _data.rows[0]?_data.rows[0].HalfDesc:"";
this.isShow = true;
} else if (this.dataInfoObj.FViewType == 2 || this.dataInfoObj.FViewType == 3 || this.dataInfoObj.FViewType == 4) {
this.isBomShow = true;

@ -1,21 +1,21 @@
<template>
<lay-form :model="dataInfo" class="dataInfo">
<lay-form-item label="原配方" prop="formula1" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="formula1" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in formulaList" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
</lay-select>
<lay-form-item label="原配方" label-width="120" prop="formula1Name" required :initValidate="false">
<lay-input v-model="formula1Name" style="width:calc(100% - 76px);margin-right:10px" disabled="true"></lay-input>
<lay-button type="normal" @click="selectMaterial(1)" >选择
</lay-button>
<p class="note">配方号+版本号+描述</p>
</lay-form-item>
<lay-form-item label="变更后的配方" prop="formula2" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="formula2" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in formulaList" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
</lay-select>
<lay-form-item label="变更后的配方" label-width="120" prop="formula2Name" required :initValidate="false">
<lay-input v-model="formula2Name" style="width:calc(100% - 76px);margin-right:10px" disabled="true"></lay-input>
<lay-button type="normal" @click="selectMaterial(2)" >选择
</lay-button>
<p class="note">配方号+版本号+描述</p>
</lay-form-item>
<lay-form-item label="模式" prop="FFormulaName" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="dataInfo.FCreateFactoryID" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
<lay-form-item label="模式" prop="factoryID" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="factoryID" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID"
:label="fIdv.FName"></lay-select-option>
</lay-select>
</lay-form-item>
@ -23,8 +23,7 @@
<lay-form-item>
<p class="note3">配方变更影响的旧物料</p>
<lay-table :columns="dataColumn" v-model:selected-key="selectedKey" id="FID"
:dataSource="dataList">
<lay-table :columns="dataColumn" v-model:selected-key="selectedKey" id="FID" :dataSource="dataList">
</lay-table>
</lay-form-item>
<lay-form-item class="remark">
@ -41,6 +40,10 @@
<lay-button @click="cancelClick"></lay-button>
</lay-form-item>
</div>
<lay-layer :area="['70%', '80%']" v-model="showEditBox" title="选择包材">
<MaterialSelect @_getSeachData="_getSeachData" :dataType1="dataType" @cancelClick="showEditBox = false">
</MaterialSelect>
</lay-layer>
</template>
<style scoped>
@ -92,7 +95,8 @@
.FSearchName {
color: var(--global-primary-color)
}
.remark{
.remark {
line-height: 2;
font-size: 18px;
}
@ -110,13 +114,20 @@ import {
updateDataInfo,
getDataModel
} from "/src/api/api/common";
import MaterialSelect from "./MaterialSelect.vue";
import {
getFactoryList
} from "/src/api/api/factory";
import{
import {
getFormulaList
} from '/src/api/api/formula'
} from '/src/api/api/formula';
import{
InsertDataModel
} from'/src/api/api/materialteamwork'
export default {
components: {
MaterialSelect
},
setup() {
const dataInfo = ref({
FMaterialType: "ZMAT",
@ -129,31 +140,32 @@ export default {
]);
const typeList = ref([]);
let dataColumn = [ {
let dataColumn = [{
title: "物料号",
key: "F1",
key: "FCode",
width: "160px"
},
{
title: "试验号",
key: "F2",
key: "FTestCode",
width: "160px"
},
{
title: "物料描述",
key: "F3",
key: "FDesc",
width: "110px",
width: "260px"
},
{
title: "产品分类",
key: "F4",
key: "FTypeName",
width: "160px"
}
];
dataColumn.forEach((item) => {
item.align = "center";
});
const dataType=ref("");
const pageInfo = ref({
total: 0,
limit: 5,
@ -175,9 +187,12 @@ export default {
const showButton = ref(true);
const saleList = ref([]);
const factoryLists = ref([]);
const factoryValue=ref(null);
const formula1=ref(null);
const formula2=ref(null);
const factoryValue = ref(null);
const formula1 = ref(-1);
const formula1Name=ref("");
const formula2 = ref(-1);
const formula2Name = ref("");
const factoryID=ref("");
return {
dataInfo,
formulaList,
@ -193,14 +208,18 @@ export default {
factoryLists,
factoryValue,
formula1,
formula2
formula2,
formula1Name,
formula2Name,
dataType,
factoryID
}
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
}
},
},
mounted() {
//
@ -226,8 +245,11 @@ export default {
}, "Teamwork");
this.dataInfo = result || this.dataInfo;
},
async _getFormulaList(){
this.formulaList=await getFormulaList();
async _getFormulaList() {
this.formulaList = await getFormulaList();
},
async _getMateriaList() {
this._getPageList(true);
},
async _getSelectList() {
let result = await getDataCode({
@ -260,6 +282,24 @@ export default {
this.pageInfo.limit = obj.limit;
this._getPageList();
},
selectMaterial(str) {
this.dataType=str;
this.showEditBox = true;
this.editDataInfo.FName = "";
},
_getSeachData(data){
debugger
if(this.dataType==1){
this.formula1=data.FTestCode;
this.formula1Name=data.FName;
this._getPageList(true);
}else{
this.formula2=data.FTestCode;
this.formula2Name=data.FName;
}
this.showEditBox=false;
},
//
async _getPageList(isFirst) {
if (isFirst) {
@ -268,49 +308,29 @@ export default {
}
let postData = {
FPageIndex: this.pageInfo.current,
FPageSize: this.pageInfo.limit
FPageSize: this.pageInfo.limit,
FTestCode: this.formula1
}
let search = this.dataInfo.FSearchName;
if (search && search != "") {
postData.Or_FPlmCode = postData.Or_FTestCode = postData.Or_FName = postData.Or_FVersionCode =
search;
}
let result = await getPageList(postData, "Formula");
let result = await getPageList(postData, "Material");
result.Data.List = result.Data.List || [];
result.Data.List.forEach((item) => {
let type = this.typeList.find(s => s.FValue == item.FType);
item.FTypeName = type == null ? item.FType : type.FName;
if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID
});
debugger
this.pageInfo.total = result.Data.Total || 0;
this.dataList = [{F1:"10000271",F2:"KTFTS22111101",F3:"KTFTS22111101-K001@测试",F4:"产成品"},
{F1:"",F2:"KTFTS22111101",F3:"12",F4:"半成品"},
{F1:"10000270",F2:"KTFTS22111101",F3:"KTFTS22111101-K001@测试",F4:"产成品"}];
this.dataList = result.Data.List;
},
//-
async submitClick(isCreate) {
let postData = this.dataInfo;
postData.FSaleCode = (postData.FSaleCode || "").trim();
postData.FTestCode = (postData.FTestCode || "").trim();
postData.FMaterialGroup = (postData.FMaterialGroup || "").trim();
postData.FWeightUnit = (postData.FWeightUnit || "").trim();
postData.FFormulaName = (postData.FFormulaName || "").trim();
postData.FCreateFactoryID=(postData.FCreateFactoryID==-1?"":postData.FCreateFactoryID);
for (let key in postData) {
if (postData[key] == "") return false;
}
// let indexs = [postData.FSaleCode.indexOf("-"), postData.FSaleCode.indexOf("@")];
// if (indexs[0] == -1 || indexs[1] == -1 || indexs[1] - indexs[0] < 2) {
// layer.msg('')
// return false;
// }
postData.FState = isCreate ? 1 : 0;
postData = JSON.parse(JSON.stringify(postData));
if (postData.FTestCode != postData.FFormulaTestCode) {
this.sureTextCode(postData);
return false;
}
this._postTermData(postData);
let postData = {"FTestCode":this.formula1,"FNewTestCode":this.formula2,"FCreateFactoryID":this.factoryID};
let result=await InsertDataModel(postData);
},
//-
sureTextCode(postData) {

File diff suppressed because one or more lines are too long

@ -0,0 +1,160 @@
<template>
<lay-container fluid="true" style="padding:10px;">
<lay-row space="10">
<lay-col span="24">
<lay-card>
<lay-form :model="searchObj" class="search-box">
<lay-row class="search-items">
<lay-form-item label="试验号" prop="FTestCode">
<lay-input v-model="searchObj.FTestCode"></lay-input>
</lay-form-item>
<lay-form-item label="配方名称" prop="FName">
<lay-input v-model="searchObj.FName"></lay-input>
</lay-form-item>
</lay-row>
<lay-form-item class="search-btn">
<lay-button size="sm" type="primary" @click="_clickSearch"></lay-button>
<lay-button size="sm" @click="_clickReset"></lay-button>
</lay-form-item>
</lay-form>
<lay-table :columns="dataColumn" id="id" :dataSource="dataList"
:page="dataList.length>0?pageInfo:null" @change="changePage">
<template v-slot:operator="{ data }">
<lay-button type="normal" @click="_choseData(data)"></lay-button>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
</lay-container>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getPageList
} from "/src/api/api/common";
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
setup() {
let dataColumn = [{
title: "编号",
key: "FID",
align: 'center'
},
{
title: "试验号",
key: "FTestCode",
align: 'center'
},
{
title: "配方名称",
key: "FName",
align: 'center'
},
{
title: "操作",
key: "operator",
width: "100px",
customSlot: 'operator',
align: 'center'
}
];
const pageInfo = ref({
total: 0,
limit: 10,
current: 1
});
const dataList = ref([]);
const searchObj = ref({});
const postData = ref({});
const objInfoObj = ref({});
return {
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
objInfoObj,
};
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
},
dataType1: "",
},
mounted() {
this._getPageList(true);
},
methods: {
changePage(obj) {
this.pageInfo.current = obj.current;
this._getPageList();
},
//
async _getPageList(isFirst, showOk) {
this.pageInfo.total = 0;
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit;
let result = await getPageList(this.postData, "Formula");
result.Data.List = result.Data.List || [];
this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List;
debugger
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
_choseData(data) {
let $this = this;
debugger
layer.confirm("您确定要选择此子项吗?", {
title: "提示",
btn: [{
text: '确定',
callback: function(id) {
layer.close(id);
//$this.$emit('selectClick', data)
$this.$emit("_getSeachData",data)
}
},
{
text: '取消',
callback: function(id) {
layer.close(id);
}
}
]
});
},
//-
_clickSearch() {
this.postData = {};
for (let key in this.searchObj) {
let val = this.searchObj[key];
if (val != null && val !== "") this.postData[key] = val;
}
this._getPageList(true);
},
//-
_clickReset() {
this.searchObj = {};
this._clickSearch();
}
}
}
</script>

@ -1,6 +1,6 @@
<template>
<div class="box-data">
<lay-scroll height="800px">
<lay-scroll>
<lay-container class="dataInfo">
<lay-row space="10">

@ -73,6 +73,7 @@ import {
import ShowData1 from '../half/components/ShowData1.vue';
import EditMateria from '../half/components/EditMateria.vue';
import EditView from '../half/components/EditView.vue';
import {GetMaterialTeamworkPageList} from"/src/api/api/materialteamwork"
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
@ -80,58 +81,59 @@ export default {
components: {
EditMateria,
EditView,
ShowData1
ShowData1,
},
setup() {
let dataColumn = [
{
title: "序号",
key: "F1",
key: "FID",
width: "160px",
align: 'center',
hide: false
}, {
title: "原试验号",
key: "F2",
key: "FTestCode",
width: "300px",
align: 'center',
hide: false
},
{
title: "原版本号",
key: "F3",
key: "FVersionCode",
width: "160px",
align: 'center',
hide: false
},
{
title: "新试验号",
key: "F4",
key: "NewFTestCode",
width: "160px",
align: 'center',
hide: false
},
{
title: "新版本号",
key: "F5",
key: "NewFVersionCode",
width: "400px",
align: 'center'
},
{
title: "产品分类",
key: "F6",
key: "FType",
width: "400px",
align: 'center'
},
{
title: "发起时间",
key: "F7",
key: "FAddDate",
width: "180px",
align: 'center'
},
{
title: "发起人",
key: "F8",
key: "FName",
width: "178px",
align: 'center'
},
@ -233,8 +235,25 @@ export default {
//
async _getPageList(isFirst, showOk) {
this.pageInfo.total = 0;
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit;
if (this.dataInfoObj != undefined) {
this.postData.FDataType = this.dataInfoObj;
}
let $this=this;
let result = await GetMaterialTeamworkPageList(this.postData);
this.dataList = result.Data.List.map(function(item){
item.FAddDate = item.FAddDate == null ? "" : $this.dateFormat(item.FAddDate);
return item;
});
debugger
this.dataList = [{ F1: 1, F2: "10020421", F3: "1.0", F4: "10020421", F5: "2.0", F6: "半成品", F7: "2022-10-24 11:00", F8: "kai" }];
this.hasLoaded = true;
},
//
@ -275,7 +294,7 @@ export default {
} else if (data.FType == 14) {
data.FBoxType = 8; //
} else if (data.FType == 15) {
data.FBoxType = 9; //
data.FBoxType = 3; //
} else if (data.FType == 16) {
this.dataItem = data;
data.FBoxType = 10; //

@ -1,6 +1,5 @@
<template>
<lay-container fluid="true"
:style="'padding:10px;height:'+(dataInfoObj!=undefined?(dataInfoObj.FHeight+'px'):'auto')">
<lay-container fluid="true" :style="'padding:10px;height:' + (dataInfoObj != undefined ? (dataInfoObj.FHeight + 'px') : 'auto')">
<lay-row space="10">
<lay-col span="24">
<lay-card>
@ -11,14 +10,14 @@
</lay-form-item>
<lay-form-item label="当前流程" prop="FType">
<lay-select v-model="searchObj.FType">
<lay-select-option v-for="(tIdv,tIdx) in typeList" :key="tIdx" :value="tIdv.FValue"
:label="tIdv.FName"></lay-select-option>
<lay-select-option v-for="(tIdv, tIdx) in typeList" :key="tIdx" :value="tIdv.FValue"
:label="tIdv.FName"></lay-select-option>
</lay-select>
</lay-form-item>
<lay-form-item v-if="postData.FState!=99" label="事项状态" prop="FState">
<lay-form-item v-if="postData.FState != 99" label="事项状态" prop="FState">
<lay-select v-model="searchObj.FState">
<lay-select-option v-for="(tv,tx) in stateList" :key="tx" :value="tv.id"
:label="tv.name"></lay-select-option>
<lay-select-option v-for="(tv, tx) in stateList" :key="tx" :value="tv.id"
:label="tv.name"></lay-select-option>
</lay-select>
</lay-form-item>
<lay-form-item label="发起日期" prop="FDateRange">
@ -32,19 +31,20 @@
</lay-form-item>
</lay-form>
<lay-table v-if="hasLoaded" :columns="dataColumn" id="id" :dataSource="dataList"
v-model:selectedKeys="selectedKeys" :checkbox="checkbox" :default-toolbar="defaultToolbar"
:page="dataList.length>0?pageInfo:null" @change="changePage">
v-model:selectedKeys="selectedKeys" :checkbox="checkbox" :default-toolbar="defaultToolbar"
:page="dataList.length > 0 ? pageInfo : null" @change="changePage">
<template v-slot:toolbar>
<lay-button size="sm" @click="_getPageList(false,true)"></lay-button>
<lay-button size="sm" type="normal" style="float:right" @click="showEditMaterial(1)"></lay-button>
<lay-button size="sm" @click="_getPageList(false, true)">刷新</lay-button>
<lay-button size="sm" type="normal" style="float:right"
@click="showEditMaterial(1)">导出</lay-button>
</template>
<template v-slot:FStateName="{ data }">
<span v-if="data.FStateName=='已完成'" style="color:#5FB878">{{ data.FStateName }}</span>
<span v-if="data.FStateName == '已完成'" style="color:#5FB878">{{ data.FStateName }}</span>
<span v-else style="color:#1E9FFF">{{ data.FStateName }}</span>
</template>
<template v-if="dataInfoObj == undefined|| !dataInfoObj.FID" v-slot:operator="{ data }">
<lay-button size="xs" type="primary" @click="showEditMaterial(3)"></lay-button>
<template v-if="dataInfoObj == undefined || !dataInfoObj.FID" v-slot:operator="{ data }">
<lay-button size="xs" type="primary" @click="_clickSetInfo(data,1)"></lay-button>
</template>
</lay-table>
</lay-card>
@ -59,279 +59,269 @@
</lay-container>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getBasicList,
getPageList
} from "/src/api/api/common";
import EditMateria from '../half/components/EditMateria.vue';
import EditView from '../half/components/EditView.vue';
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
import {
ref,
watch
} from "vue";
import {
getBasicList,
getPageList
} from "/src/api/api/common";
import EditMateria from '../half/components/EditMateria.vue';
import EditView from '../half/components/EditView.vue';
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
components: {
EditMateria,
EditView
},
setup() {
let dataColumn = [
export default {
components: {
EditMateria,
EditView
},
setup() {
let dataColumn = [
{
title: "序号",
key: "F1",
key: "FID",
width: "160px",
align: 'center',
hide: false
},{
}, {
title: "新试验号",
key: "F2",
key: "FNewTestCode",
width: "300px",
align: 'center',
hide: false
},
{
title: "新版本号",
key: "F3",
width: "160px",
align: 'center',
hide: false
},
{
title: "事项",
key: "F4",
width: "160px",
align: 'center',
hide: false
},
{
title: "产品分类",
key: "F5",
width: "400px",
align: 'center'
},
{
title: "发起时间",
key: "F6",
width: "180px",
align: 'center'
},
{
title: "发起人",
key: "F7",
width: "178px",
align: 'center'
},
{
title: "负责人",
key: "F8",
width: "98px",
align: 'center',
customSlot: '',
},
{
title: "操作",
key: "operator",
width: "130px",
fixed: "right",
customSlot: 'operator',
align: 'center'
}
];
const selectedKeys = ref(["1"]);
const checkbox = ref(false);
const defaultToolbar = ref(true);
const pageInfo = ref({
total: 0,
limit: 10,
current: 1
});
const dataList = ref([]);
const typeList = ref([]);
const searchObj = ref({});
const postData = ref({});
const MaterialModel= ref({});
const showEditBox = ref([false, false, false, false, false, false, false, false, false, false, false, false,false]);
const modelArea = ref(["70%", "70%", "70%", "86%", "70%", "70%", "70%", "70%", "700px", "70%", "70%","70%","70%"]);
const objInfoObj = ref({});
const editType = ref(1);
const stateList = ref([{
id: 1,
name: "进行中"
}, {
id: 2,
name: "已完成"
}]);
const hasLoaded = ref(false);
const dataItem=ref([]);
return {
selectedKeys,
checkbox,
defaultToolbar,
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
typeList,
showEditBox,
modelArea,
objInfoObj,
editType,
stateList,
hasLoaded,
MaterialModel,
dataItem
};
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
{
title: "新版本号",
key: "FVersionCode",
width: "160px",
align: 'center',
hide: false
},
pageTypeObj: {
type: Number,
default: () => 1,
{
title: "事项",
key: "FName",
width: "160px",
align: 'center',
hide: false
},
{
title: "产品分类",
key: "FormulaType",
width: "400px",
align: 'center'
},
{
title: "发起时间",
key: "FAddDate",
width: "180px",
align: 'center'
},
{
title: "发起人",
key: "FUserName",
width: "178px",
align: 'center'
},
{
title: "负责人",
key: "F8",
width: "98px",
align: 'center',
customSlot: '',
},
{
title: "操作",
key: "operator",
width: "130px",
fixed: "right",
customSlot: 'operator',
align: 'center'
}
];
const selectedKeys = ref(["1"]);
const checkbox = ref(false);
const defaultToolbar = ref(true);
const pageInfo = ref({
total: 0,
limit: 10,
current: 1
});
const dataList = ref([]);
const typeList = ref([]);
const searchObj = ref({});
const postData = ref({});
const MaterialModel = ref({});
const showEditBox = ref([false, false, false, false, false, false, false, false, false, false, false, false, false]);
const modelArea = ref(["70%", "70%", "70%", "86%", "70%", "70%", "70%", "70%", "700px", "70%", "70%", "70%", "70%"]);
const objInfoObj = ref({});
const editType = ref(1);
const stateList = ref([{
id: 1,
name: "进行中"
}, {
id: 2,
name: "已完成"
}]);
const hasLoaded = ref(false);
const dataItem = ref([]);
return {
selectedKeys,
checkbox,
defaultToolbar,
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
typeList,
showEditBox,
modelArea,
objInfoObj,
editType,
stateList,
hasLoaded,
MaterialModel,
dataItem
};
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
},
pageTypeObj: {
type: Number,
default: () => 1,
}
},
mounted() {
if (this.dataInfoObj) {
this.dataColumn.pop();
this.dataColumn[0].hide = true;
this.dataColumn[1].hide = true;
this.dataColumn[2].hide = true;
this.dataColumn[7].hide = false;
}
this._getTypeList();
this._getPageList(true);
},
methods: {
changePage(obj) {
this.pageInfo.current = obj.current;
this.pageInfo.limit = obj.limit;
this._getPageList();
},
mounted() {
if (this.dataInfoObj) {
this.dataColumn.pop();
this.dataColumn[0].hide = true;
this.dataColumn[1].hide = true;
this.dataColumn[2].hide = true;
this.dataColumn[7].hide = false;
cancelClick(isRefresh, onlyRefresh) {
if (isRefresh) {
this._getPageList(true);
}
if (onlyRefresh) return false;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
this._getTypeList();
this._getPageList(true);
},
methods: {
changePage(obj) {
this.pageInfo.current = obj.current;
this.pageInfo.limit = obj.limit;
this._getPageList();
},
cancelClick(isRefresh, onlyRefresh) {
if (isRefresh) {
this._getPageList(true);
}
if (onlyRefresh) return false;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
},
async _getTypeList() {
this.typeList = await getBasicList(33) || [];
},
//
async _getPageList(isFirst, showOk) {
async _getTypeList() {
this.typeList = await getBasicList(33) || [];
},
//
async _getPageList(isFirst, showOk) {
//this.dataList = [];
//this.dataList = [];
this.pageInfo.total = 0;
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
if (this.dataInfoObj && this.dataInfoObj.FID) {
this.postData.FTeamID = this.dataInfoObj.FID;
this.postData.FIsUser = false;
}
if (this.pageTypeObj && this.pageTypeObj == 2) {
this.postData.FState = 99;
}
this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit;
let result = await getPageList(this.postData, "Task");
result.Data.List = result.Data.List || [];
result.Data.List.forEach((item) => {
let type = this.typeList.find(s => s.FValue === item.FType);
item.FTypeName = type == null ? "" : type.FName;
let state = this.stateList.find(s => s.id === item.FState)
item.FStateName = state == null ? "" : state.name;
item.FAddDate = item.FAddDate == null ? "" : this.dateFormat(item.FAddDate);
item.FEditDate = item.FEditDate == null ? "" : this.dateFormat(item.FEditDate);
item.FFinishDate = item.FFinishDate == null ? "" : this.dateFormat(item.FFinishDate);
});
this.pageInfo.total = result.Data.Total || 0;
debugger
this.dataList = [{"F1":"1","F2":"10020421",
"F3":"","F4":"物料分类选择",
"F5":"半成品","F6":"2022-10-24 11:00",
"F7":"Kai","F8":"Kai"},
{"F1":"2","F2":"10020421","F3":"","F4":"物料编辑",
"F5":"半成品","F6":"2022-10-24 11:00","F7":"Kai","F8":"Kai"}];
this.hasLoaded = true;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
getData(data){
this.MaterialModel = data;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
this.showEditBox[11] = true;
this.editType = 1;
}
if (this.dataInfoObj && this.dataInfoObj.FID) {
this.postData.FTeamID = this.dataInfoObj.FID;
this.postData.FIsUser = false;
}
if (this.pageTypeObj && this.pageTypeObj == 2) {
this.postData.FState = 99;
}
this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit;
let result = await getPageList(this.postData, "MaterialTask");
debugger
let $this=this;
this.dataList = result.Data.List.map(function (item) {
item.FAddDate = item.FAddDate == null ? "" : $this.dateFormat(item.FAddDate);
return item;
});
this.hasLoaded = true;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
getData(data) {
this.MaterialModel = data;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
this.showEditBox[11] = true;
this.editType = 1;
},
showEditMaterial(i){
this.showEditBox[i] = true;
},
_clickSetInfo(data, type) {
},
showEditMaterial(i) {
this.showEditBox[i] = true;
},
_clickSetInfo(data, type) {
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
if (data.FType == 1) {
data.FBoxType = 1; //
} else if (data.FType == 2) {
data.FBoxType = 2; //BOM
} else if (data.FType == 9 || data.FType == 10) {
data.FBoxType = 4; //
} else if ((data.FType >= 3 && data.FType <= 7) || data.FType == 11) {
data.FBoxType = 3; //
} else if (data.FType == 8) {
data.FBoxType = 5; //
} else if (data.FType == 12) {
data.FBoxType = 6; //
} else if (data.FType == 13) {
data.FBoxType = 7; //
} else if (data.FType == 14) {
data.FBoxType = 8; //
} else if (data.FType == 15) {
data.FBoxType = 9; //
}else if(data.FType==16){
this.dataItem=data;
data.FBoxType = 10; //
}else {
return layer.msg("未知事项类型");
}
this.objInfoObj = data;
this.editType = type;
this.showEditBox[data.FBoxType] = true;
},
debugger
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
if (data.FType == 1) {
data.FBoxType = 1; //
} else if (data.FType == 2) {
data.FBoxType = 2; //BOM
} else if (data.FType == 9 || data.FType == 10) {
data.FBoxType = 4; //
} else if ((data.FType >= 3 && data.FType <= 7) || data.FType == 11) {
data.FBoxType = 3; //
} else if (data.FType == 8) {
data.FBoxType = 5; //
} else if (data.FType == 12) {
data.FBoxType = 6; //
} else if (data.FType == 13) {
data.FBoxType = 7; //
} else if (data.FType == 14) {
data.FBoxType = 8; //
} else if (data.FType == 15) {
data.FBoxType = 9; //
} else if (data.FType == 16) {
this.dataItem = data;
data.FBoxType = 10; //
} else {
return layer.msg("未知事项类型");
}
this.objInfoObj = data;
this.editType = type;
this.showEditBox[data.FBoxType] = true;
},
//-
_clickSearch() {
this.postData = {};
for (let key in this.searchObj) {
let val = this.searchObj[key];
if (val != null && val !== "") this.postData[key] = val;
}
this._getPageList(true);
},
//-
_clickReset() {
this.searchObj = {};
this._clickSearch();
//-
_clickSearch() {
this.postData = {};
for (let key in this.searchObj) {
let val = this.searchObj[key];
if (val != null && val !== "") this.postData[key] = val;
}
this._getPageList(true);
},
//-
_clickReset() {
this.searchObj = {};
this._clickSearch();
}
}
}
</script>

Loading…
Cancel
Save