diff --git a/src/pages/database/goods/goodsInfo/service.js b/src/pages/database/goods/goodsInfo/service.js
index 9a14a2e..24df24e 100644
--- a/src/pages/database/goods/goodsInfo/service.js
+++ b/src/pages/database/goods/goodsInfo/service.js
@@ -112,9 +112,8 @@ export async function getbyidgoods (data) {
});
}
export async function GetGoodsTechnology(data) {
- return request(getDataBaseUrl()+`/api/goodstechnology/GetGoodsTechnology`, {
- method: 'Post',
- data: data,
+ return request(getDataBaseUrl()+`/api/technology/gettechnologylist?deviceId=`+data, {
+ method: 'Get',
});
}
export async function GetTechnologyactionList(data) {
diff --git a/src/pages/database/goods/goodsbom/components/CreateBom.jsx b/src/pages/database/goods/goodsbom/components/CreateBom.jsx
index 93392d6..9b3b4a3 100644
--- a/src/pages/database/goods/goodsbom/components/CreateBom.jsx
+++ b/src/pages/database/goods/goodsbom/components/CreateBom.jsx
@@ -47,11 +47,17 @@ const GoodsbomFrom = (props) => {
}
useEffect(() => {
- console.log("props.Bomdata",props.Bomdata)
+ var ty=form.getFieldValue("type");
+ console.log("props.Bomdata",form.getFieldValue("type"))
console.log(props.goodsname)
- setdisaenumbled('block')
- setdisnewd("none");
- setbomcheckRules([{ required: true, message: '请选择配方' }])
+ if(ty!=0){
+ setdisaenumbled('block')
+ setdisnewd("none");
+ setbomcheckRules([{ required: true, message: '请选择配方' }])
+ setbomNameRules( [{ required: false}])
+ setbomTypeListRules([{ required: false}])
+ }
+
// form.setFieldsValue({
// bomName: props.goodsname,
// // bomType:1
@@ -71,7 +77,7 @@ const GoodsbomFrom = (props) => {
setEditableRowKeys(soredata.map((item) => item.id))
setDataSource(soredata);
}
- },[])
+ },[props])
const columns=[
{
title: '物料名称',
diff --git a/src/pages/database/goods/goodstechnology/components/EditFrom.jsx b/src/pages/database/goods/goodstechnology/components/EditFrom.jsx
index af59d9a..5df4e2f 100644
--- a/src/pages/database/goods/goodstechnology/components/EditFrom.jsx
+++ b/src/pages/database/goods/goodstechnology/components/EditFrom.jsx
@@ -12,8 +12,8 @@ const EditFrom = (props) => {
useEffect(() => {
//setfromdata(props.fromdata)
//props.fromdata=fromdata
- console.log("增加编辑状态值",props.UpdataStatus)
- console.log("props.fromdata",props.fromdata)
+ console.log("增加编辑状态值",props.technologyattralldata)
+ console.log("props.fromdata",props.goodstechnologydata)
if(props.fromdata.length==0){
setfromdata([])
}else{
@@ -80,7 +80,7 @@ const EditFrom = (props) => {
const onHandleChange = (value, option, index) => {
console.log(fromdata)
console.log(index)
- var sd = props.technologyattralldata.filter(x => x.productFunctionId == value);
+ var sd = props.technologyattralldata.filter(x => x.technologyId == value);
var newdata = fromdata.map(x => {
if (x.index == index) {
diff --git a/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx b/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx
index 0a2d9eb..dee6c1e 100644
--- a/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx
+++ b/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx
@@ -92,9 +92,9 @@ const goodstechnologymaken = (props) => {
// setgoodstechnologydata(sd)
// }
// });
- GetTechnologyActionListAll().then((r) => {
- setTechnologyattralldata(r.data)
- })
+ // GetTechnologyActionListAll().then((r) => {
+ // setTechnologyattralldata(r.data)
+ // })
GetGoodsTechnologyAction(props.goodsid).then((r) => {
if (r.data.length > 0) {
setgoodstechnolog(r.data)
@@ -156,39 +156,13 @@ const goodstechnologymaken = (props) => {
setopreaction("update")
if (UpdataStatus != "add") {
setdefaultValue(item.deviceId)
- handleChange(item.deviceId)
- let attr = [];
- item.data.forEach(item => {
- const obj = {};
- let propsdatanew = [];
- let propsdata = technologyattralldata.filter(x => x.productFunctionId == item.chnologyId)
- obj.stepName = item.stepName;
- obj.id = item.id;
- obj.chnologyId = item.chnologyId;
- obj.sort = item.sort;
- obj.actionJson = item.actionJson
- obj.optiondata = JSON.parse(item.actionJson)
- propsdata.forEach(x => {
- let sd = {
- id: x.id,
- actionName: x.actionName,
- actionType: x.actionType,
- actionValue: x.actionValue,
- goodstechnologyId: x.productFunctionId,
- isBatch: x.isBatch,
- sort: x.sort,
- goddteid: item.id
- }
- propsdatanew.push(sd)
- })
- obj.propsdata = propsdatanew;
- obj.isBatch = item.isBatch;
- obj.typeName = item.stepName;
-
- attr.push(obj)
- })
- console.log("attr", attr)
- setfromdata(attr)
+ //handleChange(item.deviceId)
+ setdefaultValue(item.deviceId)
+ setddevideId(item.deviceId)
+ GetGoodsTechnologyvalue(item.deviceId,"edit",item)
+
+ //console.log("attr", attr)
+
setUpdataStatus("update")
} else {
message.error("请保存当前数据后在编辑");
@@ -196,6 +170,63 @@ const goodstechnologymaken = (props) => {
//setTechnologyattrdata(attr)
}
+ const editfrom=(item,Technologyacton)=>{
+ let attr = [];
+ item.data.forEach(item => {
+ const obj = {};
+ let propsdatanew = [];
+ let propsdata = Technologyacton.filter(x => x.technologyId == item.chnologyId)
+ obj.stepName = item.stepName;
+ obj.id = item.id;
+ obj.chnologyId = item.chnologyId;
+ obj.sort = item.sort;
+ obj.actionJson = item.actionJson
+ obj.optiondata = JSON.parse(item.actionJson)
+ propsdata.forEach(x => {
+ let sd = {
+ id: x.id,
+ actionName: x.actionName,
+ actionType: x.actionType,
+ actionValue: x.actionValue,
+ goodstechnologyId: x.technologyId,
+ isBatch: x.isBatch,
+ sort: x.sort,
+ goddteid: item.id
+ }
+ propsdatanew.push(sd)
+ })
+ obj.propsdata = propsdatanew;
+ obj.isBatch = item.isBatch;
+ obj.typeName = item.stepName;
+
+ attr.push(obj)
+ })
+ setfromdata(attr)
+ }
+ const GetGoodsTechnologyvalue=(value,va,item)=>{
+ let godata=[]
+ GetGoodsTechnology(value).then((r)=>{
+ if (r.data.length > 0) {
+ var Technologyacton=[];
+ godata = r.data.map(x => {
+
+ if(x.technologyActionInfo.length>0){
+ x.technologyActionInfo.forEach(p=>{
+ Technologyacton.push(p);
+ })
+ }
+ return { value: x.id, label: x.name }
+ })
+ setTechnologyattralldata(Technologyacton)
+ setgoodstechnologydata(godata)
+ }
+ //setfromdata([])
+ if(va=="edit"){
+ editfrom(item,Technologyacton)
+ }
+ })
+
+ }
//删除单个工艺
const onClickdele = (e, item, action) => {
DeleteGoodsTechnologyAction(item.id).then((res) => {
@@ -244,20 +275,20 @@ const goodstechnologymaken = (props) => {
console.log("进来了", value)
setdefaultValue(value)
setddevideId(value)
- let godata=[]
- let sd = DeviceTechnologydata.find(x => x.id == value);
- if (sd) {
- if (sd.goodsTechnologyInfo.length > 0) {
- godata = sd.goodsTechnologyInfo.map(x => {
- return { value: x.deviceTechnologyId, label: x.name }
- })
+ GetGoodsTechnologyvalue(value,"",null)
+ // let sd = DeviceTechnologydata.find(x => x.id == value);
+ // if (sd) {
+ // if (sd.goodsTechnologyInfo.length > 0) {
+ // godata = sd.goodsTechnologyInfo.map(x => {
+ // return { value: x.deviceTechnologyId, label: x.name }
+ // })
- setgoodstechnologydata(godata)
- }
- setfromdata([])
- }
- console.log("godata", godata)
- setgoodstechnologydata(godata)
+ // setgoodstechnologydata(godata)
+ // }
+ // setfromdata([])
+ // }
+ // console.log("godata", godata)
+ // setgoodstechnologydata(godata)
}
const onUpdataStatus = (val) => {
setUpdataStatus(val)
diff --git a/src/pages/database/goods/goodstypemanage/index.jsx b/src/pages/database/goods/goodstypemanage/index.jsx
index b3eb980..f00f787 100644
--- a/src/pages/database/goods/goodstypemanage/index.jsx
+++ b/src/pages/database/goods/goodstypemanage/index.jsx
@@ -160,7 +160,7 @@ const handleAdd = async (fields) => {
},
{
title: '排序',
- dataIndex: 'goodsType_Sort',
+ dataIndex: 'sort',
hideInSearch: true,
},
{
diff --git a/src/pages/device/deviceInfo/services.js b/src/pages/device/deviceInfo/services.js
index 82d638a..9cc2af4 100644
--- a/src/pages/device/deviceInfo/services.js
+++ b/src/pages/device/deviceInfo/services.js
@@ -54,7 +54,7 @@ export async function GetDeviceType() {
}
/** 添加设备标签 */
export async function AddDeviceType(data) {
- return request(`/saasbase/api/device/adddevicetype`, {
+ return request(getDataBaseUrl()+`/api/device/adddevicetype`, {
method: 'POST',
data: data,
});
diff --git a/src/pages/device/technology/components/ActionForm.jsx b/src/pages/device/technology/components/ActionForm.jsx
new file mode 100644
index 0000000..2bcfebd
--- /dev/null
+++ b/src/pages/device/technology/components/ActionForm.jsx
@@ -0,0 +1,173 @@
+import ProTable from '@ant-design/pro-table';
+import { Modal,Space, Form,Button,Select,message,Popconfirm} from 'antd';
+import { PlusOutlined } from '@ant-design/icons';
+import React, { useState,useRef } from 'react';
+import CreateAction from './CreateAction';
+
+const { Option, OptGroup } = Select;
+
+
+const ActionForm = (props) => {
+ const [currentRow , setcurrentRow ] = useState([]);;
+ const [dataSource, setDataSource] = useState([]);
+ const actionRef = useRef();
+ const [form] = Form.useForm();
+ const [actionValueName,setactionValueName]=useState();
+ const [createModalVisible, handleModalVisible] = useState(false);
+ const options = {
+ text:{value:'text',text: `文本框`},
+ select:{ value: `select`, text: `下拉框`},
+ // money:{ value: `money`, text: `金额输入`},
+ textarea:{ value: `textarea`, text: `文本域`},
+ // date:{ value: `date`, text: `日期`},
+ // dateTime:{ value: `dateTime`, text: `日期时间`},
+ // radio:{ value: `radio`, text: `单选框`},
+ // radioButton:{ value: `radioButton`, text: `按钮单选框`},
+ digit:{ value: `digit`, text: `数字输入框`},
+ switch:{ value: `switch`, text: `开关`},
+ }
+ const columns= [
+ {
+ title: '模型名称',
+ dataIndex: 'actionName',
+ width: '15%',
+ },
+
+ {
+ title: '输入类型',
+ key: 'actionType',
+ dataIndex: 'actionType',
+ valueType: 'select',
+ width: '15%',
+ valueEnum:options,
+
+ },
+ // {
+ // title: '类型值',
+ // dataIndex: 'actionValue',
+ // width: '15%',
+ // valueType:'select',
+ // valueEnum: {
+ // text:{
+ // text: '文本框',
+ // status: 'text',
+ // },
+ // select:{
+ // text: '下拉框',
+ // status: 'select',
+ // }
+ // }
+ // },
+ // {
+ // title: '单位',
+ // dataIndex: 'unit',
+ // width: '8%',
+ // },
+ // {
+ // title: '是否绑定物料',
+ // dataIndex: 'isBatch',
+ // width: '15%',
+ // valueEnum: {
+ // true:{
+ // text: '是',
+ // status: 'Success',
+ // },
+ // false:{
+ // text: '否',
+ // status: 'Processing',
+ // }
+ // }
+ // },
+ {
+ title: '排序',
+ dataIndex: 'sort',
+ valueType:'digit',
+ width: '8%',
+ },
+ {
+ title: '操作',
+ valueType: 'option',
+ width: 200,
+ render: (text, record, _, action) => [
+ {
+ handleModalVisible(true);
+ setcurrentRow(record);
+ }}
+ >
+ 查看
+ ,
+ //