-
+
@@ -612,7 +625,7 @@ function ModelConf(props) {
-
diff --git a/src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx b/src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx
index acb4703..a9784d0 100644
--- a/src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx
+++ b/src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx
@@ -27,7 +27,7 @@ function StuffMgm(props) {
region_id: ['0'],//区域
code: '',//物品编号
brand_id: '0',//物品类型
- model_id: '',//物品型号
+ model_id: '0',//物品型号
operatorid: '0',//商户名称
name: '',//物品名称
status: '3',//状态
@@ -57,22 +57,30 @@ function StuffMgm(props) {
const [getBrandId, setGetBrandId] = useState('')
const handleOperator = (v) => {
setGetBrandId(v)
- setFormData({ ...formData, brand_id: v })
+ setFormData({ ...formData, brand_id: v, model_id: '' })
+ setGetAssetsModel([])
}
//商户名称
const handleDeployType = (value) => {
- setFormData({ ...formData, operatorid: value })
+ setGetOperatorValue(value)
+ if (value) {
+ setGetOperatorid(false)
+ }
+ setFormData({ ...formData, operatorid: value, brand_id: '', model_id: '' })
+ setGetOperationName([])
+ setGetAssetsModel([])
}
+
//区域
- const [getOption,setGetOption]=useState(['0'])
- const onChangeList = (value,options) => {
+ const [getOption, setGetOption] = useState(['0'])
+ const onChangeList = (value, options) => {
let res = [];
if (options) {
- let last = options[options.length - 1];
- if (last.children) {
- addChild(last, res);
- }
- res.push(last.id);
+ let last = options[options.length - 1];
+ if (last.children) {
+ addChild(last, res);
+ }
+ res.push(last.id);
}
setGetOption(res)
setFormData({ ...formData, region_id: value })
@@ -224,7 +232,7 @@ function StuffMgm(props) {
})
const [getId, setGetId] = useState({})
function findParents(treeData, id) {
- console.log(treeData, id);
+ console.log(treeData, id);
let allparents = []
if (treeData.length == 0) {
@@ -305,10 +313,7 @@ function StuffMgm(props) {
setFormData({
...parameter,
})
- setTimeout(()=>{
-
- getData({ ...parameter, pn: 1})
- },800)
+ getData({ ...parameter, pn: 1 }, [])
}
//检索数据
const getSearchData = (data = formData) => {
@@ -358,17 +363,17 @@ function StuffMgm(props) {
]
const addChild = (child, res) => {
if (child.children) {
- child.children.forEach((item) => {
- addChild(item, res);
- });
+ child.children.forEach((item) => {
+ addChild(item, res);
+ });
} else {
- res.push(child.id);
+ res.push(child.id);
}
- };
+ };
// 获取列表数据
- const getData = (data = formData) => {
+ const getData = (data = formData, region_id = getOption) => {
setAjaxLoading(true)
- ajax.assetsList({ ...data,region_id:getOption}).then(res => {
+ ajax.assetsList({ ...data, region_id }).then(res => {
setAjaxLoading(false)
if (res.status === 20000) {
utils.tableScrollTop()
@@ -413,9 +418,13 @@ function StuffMgm(props) {
const [getRecipient, setGetRecipient] = useState([])
+ const [getNewRecipient, setNewGetRecipient] = useState([])
const recipientName = () => {
ajax.recipient().then(res => {
+ let arr = res.data
+ let newArr = arr.slice(1)
setGetRecipient(res.data)
+ setNewGetRecipient(newArr)
})
}
//添加
@@ -473,7 +482,7 @@ function StuffMgm(props) {
if (value) {
setGetOperatorid(false)
}
- setCheckData({ ...checkData, operatorid: value, brand_id: '',model_id:'' })
+ setCheckData({ ...checkData, operatorid: value, brand_id: '', model_id: '' })
setNewGetOperationName([])
setNewGetAssetsModel([])
}
@@ -551,7 +560,7 @@ function StuffMgm(props) {
status: '',
uid: ''
})
- setGetSelectStatus(false)
+ setGetSelectStatus(true)
setGetUid({
uid: ''
})
@@ -642,6 +651,8 @@ function StuffMgm(props) {
// }, [])
const [getNewOperationName, setNewGetOperationName] = useState([])
+ const [getOperationName, setGetOperationName] = useState([])
+
useEffect(() => {
if (getOperatorValue != '') {
let data = {
@@ -696,7 +707,13 @@ function StuffMgm(props) {
// sessionStorage.removeItem('stuffMgm')
// }
// }, [])
- const [getOperationName, setGetOperationName] = useState([])
+ const getAssetData=()=>{
+ ajax.assetsModel().then(res => {
+ let arr = res.data
+ let newArr = arr.slice(1)
+ setGetAssetsModel(res.data)
+ })
+ }
const getOperName = () => {
ajax.assetsType().then(res => {
setGetOperationName(res.data)
@@ -707,6 +724,7 @@ function StuffMgm(props) {
operatorid()
getOperName()
merchantDataName()
+ getAssetData()
recipientName()
getCascaderList()
}, [])
@@ -762,6 +780,7 @@ function StuffMgm(props) {
@@ -773,6 +792,7 @@ function StuffMgm(props) {
placeholder="请选择"
value={formData.model_id}
options={getAssetsModel}
+ disabled={getOperatorid}
onChange={handleJobStatus}
/>
@@ -814,7 +834,7 @@ function StuffMgm(props) {